diff --git a/.github/workflows/java-publish.yml b/.github/workflows/java-publish.yml index 26354a4c1..3b77aea6b 100644 --- a/.github/workflows/java-publish.yml +++ b/.github/workflows/java-publish.yml @@ -106,7 +106,9 @@ jobs: # List of some artifacts to check ARTIFACTS=( "lance-namespace-apache-client" + "lance-namespace-async-client" "lance-namespace-core" + "lance-namespace-core-async" ) echo "Waiting for version $VERSION to be available in Maven Central..." @@ -137,23 +139,41 @@ jobs: echo "" echo "Users can now add the following dependencies to their projects:" echo "" - echo "Maven (interface):" + echo "Maven (sync interface):" echo "" echo " org.lance" echo " lance-namespace-core" echo " ${VERSION}" echo "" echo "" - echo "Maven (generated client):" + echo "Maven (async interface - Java 11+):" + echo "" + echo " org.lance" + echo " lance-namespace-core-async" + echo " ${VERSION}" + echo "" + echo "" + echo "Maven (sync client):" echo "" echo " org.lance" echo " lance-namespace-apache-client" echo " ${VERSION}" echo "" echo "" - echo "Gradle:" + echo "Maven (async client - Java 11+):" + echo "" + echo " org.lance" + echo " lance-namespace-async-client" + echo " ${VERSION}" + echo "" + echo "" + echo "Gradle (sync):" echo "implementation 'org.lance:lance-namespace-core:${VERSION}'" echo "implementation 'org.lance:lance-namespace-apache-client:${VERSION}'" + echo "" + echo "Gradle (async - Java 11+):" + echo "implementation 'org.lance:lance-namespace-core-async:${VERSION}'" + echo "implementation 'org.lance:lance-namespace-async-client:${VERSION}'" exit 0 fi diff --git a/java/.async-client-ignore b/java/.async-client-ignore new file mode 100644 index 000000000..d8132013d --- /dev/null +++ b/java/.async-client-ignore @@ -0,0 +1,12 @@ +**build.gradle +**.travis.yml +**build.sbt +**git_push.sh +**gradle.properties +**gradlew +**gradlew.bat +**settings.gradle +**.gitignore +**/gradle/** +**/.github/** +**/src/test/** diff --git a/java/Makefile b/java/Makefile index 8c25e23cb..3fff76799 100644 --- a/java/Makefile +++ b/java/Makefile @@ -12,6 +12,36 @@ VERSION = 0.5.2 +.PHONY: clean-async-client +clean-async-client: + rm -rf lance-namespace-async-client + +.PHONY: gen-async-client +gen-async-client: clean-async-client + uv run openapi-generator-cli generate \ + -i ../docs/src/rest.yaml \ + -g java \ + -o lance-namespace-async-client \ + --ignore-file-override=.async-client-ignore \ + --type-mappings=file=byte[] \ + --additional-properties=groupId=org.lance,artifactId=lance-namespace-async-client,artifactVersion=$(VERSION),parentGroupId=org.lance,parentArtifactId=lance-namespace-root,parentVersion=$(VERSION),parentRelativePath=pom.xml,library=native,asyncNative=true,apiPackage=org.lance.namespace.client.async.api,modelPackage=org.lance.namespace.model,hideGenerationTimestamp=true,licenseName=Apache-2.0,licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.txt + rm -rf lance-namespace-async-client/.openapi-generator-ignore + rm -rf lance-namespace-async-client/.openapi-generator + rm -rf lance-namespace-async-client/pom.xml + cp async-client-pom.xml lance-namespace-async-client/pom.xml + +.PHONY: lint-async-client +lint-async-client: gen-async-client + ./mvnw spotless:apply -pl lance-namespace-async-client -am + +.PHONY: build-async-client +build-async-client: gen-async-client lint-async-client + ./mvnw install -pl lance-namespace-async-client -am + +.PHONY: check-async-client +check-async-client: + ./mvnw checkstyle:check spotless:check -pl lance-namespace-async-client -am + .PHONY: clean-apache-client clean-apache-client: rm -rf lance-namespace-apache-client @@ -75,11 +105,24 @@ build-core: build-apache-client lint-core check-core: ./mvnw checkstyle:check spotless:check -pl lance-namespace-core -am +# lance-namespace-core-async module (hand-written, no codegen) +.PHONY: lint-core-async +lint-core-async: gen-async-client + ./mvnw spotless:apply -pl lance-namespace-core-async -am + +.PHONY: build-core-async +build-core-async: build-async-client lint-core-async + ./mvnw install -pl lance-namespace-core-async -am + +.PHONY: check-core-async +check-core-async: + ./mvnw checkstyle:check spotless:check -pl lance-namespace-core-async -am + .PHONY: clean -clean: clean-apache-client clean-springboot-server +clean: clean-apache-client clean-async-client clean-springboot-server .PHONY: gen -gen: gen-apache-client gen-springboot-server lint-apache-client lint-springboot-server +gen: gen-apache-client gen-async-client gen-springboot-server lint-apache-client lint-async-client lint-springboot-server .PHONY: check-apache-client check-apache-client: @@ -90,10 +133,10 @@ check-springboot-server: ./mvnw checkstyle:check spotless:check -pl lance-namespace-springboot-server -am .PHONY: check -check: check-apache-client check-springboot-server check-core +check: check-apache-client check-async-client check-springboot-server check-core check-core-async .PHONY: lint -lint: lint-apache-client lint-springboot-server lint-core +lint: lint-apache-client lint-async-client lint-springboot-server lint-core lint-core-async .PHONY: build -build: build-apache-client build-springboot-server build-core \ No newline at end of file +build: build-apache-client build-async-client build-springboot-server build-core build-core-async \ No newline at end of file diff --git a/java/async-client-pom.xml b/java/async-client-pom.xml new file mode 100644 index 000000000..ff5b60596 --- /dev/null +++ b/java/async-client-pom.xml @@ -0,0 +1,116 @@ + + + 4.0.0 + + + org.lance + lance-namespace-root + 0.5.2 + + + lance-namespace-async-client + jar + + lance-namespace-async-client + Lance Namespace async HTTP client using Java 11+ native HttpClient + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 3 + + + 11 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 11 + 11 + 11 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + + + + 2.17.1 + 0.2.6 + 1.3.5 + + diff --git a/java/checkstyle-suppressions.xml b/java/checkstyle-suppressions.xml index 6c2ff26b6..30454d983 100644 --- a/java/checkstyle-suppressions.xml +++ b/java/checkstyle-suppressions.xml @@ -7,9 +7,13 @@ + + + + \ No newline at end of file diff --git a/java/lance-namespace-async-client/README.md b/java/lance-namespace-async-client/README.md new file mode 100644 index 000000000..26d6a0a80 --- /dev/null +++ b/java/lance-namespace-async-client/README.md @@ -0,0 +1,495 @@ +# lance-namespace-async-client + +Lance Namespace Specification + +- API version: 1.0.0 + +- Generator version: 7.12.0 + +This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: + +The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define +the request and response shape for each operation in a Lance Namespace across all implementations. +See https://lance.org/format/namespace/operations for more details. + +The `servers`, `security`, `paths`, `components/parameters` sections are for the +Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. +See https://lance.org/format/namespace/rest for more details. + + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 11+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.lance + lance-namespace-async-client + 0.5.2 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.lance:lance-namespace-async-client:0.5.2" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/lance-namespace-async-client-0.5.2.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.lance.namespace.client.async.*; +import org.lance.namespace.model.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class DataApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure clients using the `defaultClient` object, such as + // overriding the host and port, timeout, etc. + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAddColumnsRequest alterTableAddColumnsRequest = new AlterTableAddColumnsRequest(); // AlterTableAddColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableAddColumns(id, alterTableAddColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#alterTableAddColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:2333* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DataApi* | [**alterTableAddColumns**](docs/DataApi.md#alterTableAddColumns) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema +*DataApi* | [**alterTableAddColumnsWithHttpInfo**](docs/DataApi.md#alterTableAddColumnsWithHttpInfo) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema +*DataApi* | [**analyzeTableQueryPlan**](docs/DataApi.md#analyzeTableQueryPlan) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan +*DataApi* | [**analyzeTableQueryPlanWithHttpInfo**](docs/DataApi.md#analyzeTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan +*DataApi* | [**countTableRows**](docs/DataApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table +*DataApi* | [**countTableRowsWithHttpInfo**](docs/DataApi.md#countTableRowsWithHttpInfo) | **POST** /v1/table/{id}/count_rows | Count rows in a table +*DataApi* | [**createTable**](docs/DataApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name +*DataApi* | [**createTableWithHttpInfo**](docs/DataApi.md#createTableWithHttpInfo) | **POST** /v1/table/{id}/create | Create a table with the given name +*DataApi* | [**deleteFromTable**](docs/DataApi.md#deleteFromTable) | **POST** /v1/table/{id}/delete | Delete rows from a table +*DataApi* | [**deleteFromTableWithHttpInfo**](docs/DataApi.md#deleteFromTableWithHttpInfo) | **POST** /v1/table/{id}/delete | Delete rows from a table +*DataApi* | [**explainTableQueryPlan**](docs/DataApi.md#explainTableQueryPlan) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation +*DataApi* | [**explainTableQueryPlanWithHttpInfo**](docs/DataApi.md#explainTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation +*DataApi* | [**insertIntoTable**](docs/DataApi.md#insertIntoTable) | **POST** /v1/table/{id}/insert | Insert records into a table +*DataApi* | [**insertIntoTableWithHttpInfo**](docs/DataApi.md#insertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/insert | Insert records into a table +*DataApi* | [**mergeInsertIntoTable**](docs/DataApi.md#mergeInsertIntoTable) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table +*DataApi* | [**mergeInsertIntoTableWithHttpInfo**](docs/DataApi.md#mergeInsertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table +*DataApi* | [**queryTable**](docs/DataApi.md#queryTable) | **POST** /v1/table/{id}/query | Query a table +*DataApi* | [**queryTableWithHttpInfo**](docs/DataApi.md#queryTableWithHttpInfo) | **POST** /v1/table/{id}/query | Query a table +*DataApi* | [**updateTable**](docs/DataApi.md#updateTable) | **POST** /v1/table/{id}/update | Update rows in a table +*DataApi* | [**updateTableWithHttpInfo**](docs/DataApi.md#updateTableWithHttpInfo) | **POST** /v1/table/{id}/update | Update rows in a table +*IndexApi* | [**createTableIndex**](docs/IndexApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table +*IndexApi* | [**createTableIndexWithHttpInfo**](docs/IndexApi.md#createTableIndexWithHttpInfo) | **POST** /v1/table/{id}/create_index | Create an index on a table +*IndexApi* | [**createTableScalarIndex**](docs/IndexApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table +*IndexApi* | [**createTableScalarIndexWithHttpInfo**](docs/IndexApi.md#createTableScalarIndexWithHttpInfo) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table +*IndexApi* | [**describeTableIndexStats**](docs/IndexApi.md#describeTableIndexStats) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics +*IndexApi* | [**describeTableIndexStatsWithHttpInfo**](docs/IndexApi.md#describeTableIndexStatsWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics +*IndexApi* | [**dropTableIndex**](docs/IndexApi.md#dropTableIndex) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index +*IndexApi* | [**dropTableIndexWithHttpInfo**](docs/IndexApi.md#dropTableIndexWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index +*IndexApi* | [**listTableIndices**](docs/IndexApi.md#listTableIndices) | **POST** /v1/table/{id}/index/list | List indexes on a table +*IndexApi* | [**listTableIndicesWithHttpInfo**](docs/IndexApi.md#listTableIndicesWithHttpInfo) | **POST** /v1/table/{id}/index/list | List indexes on a table +*MetadataApi* | [**alterTableAlterColumns**](docs/MetadataApi.md#alterTableAlterColumns) | **POST** /v1/table/{id}/alter_columns | Modify existing columns +*MetadataApi* | [**alterTableAlterColumnsWithHttpInfo**](docs/MetadataApi.md#alterTableAlterColumnsWithHttpInfo) | **POST** /v1/table/{id}/alter_columns | Modify existing columns +*MetadataApi* | [**alterTableDropColumns**](docs/MetadataApi.md#alterTableDropColumns) | **POST** /v1/table/{id}/drop_columns | Remove columns from table +*MetadataApi* | [**alterTableDropColumnsWithHttpInfo**](docs/MetadataApi.md#alterTableDropColumnsWithHttpInfo) | **POST** /v1/table/{id}/drop_columns | Remove columns from table +*MetadataApi* | [**alterTransaction**](docs/MetadataApi.md#alterTransaction) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. +*MetadataApi* | [**alterTransactionWithHttpInfo**](docs/MetadataApi.md#alterTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. +*MetadataApi* | [**batchCreateTableVersions**](docs/MetadataApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables +*MetadataApi* | [**batchCreateTableVersionsWithHttpInfo**](docs/MetadataApi.md#batchCreateTableVersionsWithHttpInfo) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables +*MetadataApi* | [**batchDeleteTableVersions**](docs/MetadataApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records +*MetadataApi* | [**batchDeleteTableVersionsWithHttpInfo**](docs/MetadataApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records +*MetadataApi* | [**createEmptyTable**](docs/MetadataApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table +*MetadataApi* | [**createEmptyTableWithHttpInfo**](docs/MetadataApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table +*MetadataApi* | [**createNamespace**](docs/MetadataApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace +*MetadataApi* | [**createNamespaceWithHttpInfo**](docs/MetadataApi.md#createNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/create | Create a new namespace +*MetadataApi* | [**createTableIndex**](docs/MetadataApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table +*MetadataApi* | [**createTableIndexWithHttpInfo**](docs/MetadataApi.md#createTableIndexWithHttpInfo) | **POST** /v1/table/{id}/create_index | Create an index on a table +*MetadataApi* | [**createTableScalarIndex**](docs/MetadataApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table +*MetadataApi* | [**createTableScalarIndexWithHttpInfo**](docs/MetadataApi.md#createTableScalarIndexWithHttpInfo) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table +*MetadataApi* | [**createTableTag**](docs/MetadataApi.md#createTableTag) | **POST** /v1/table/{id}/tags/create | Create a new tag +*MetadataApi* | [**createTableTagWithHttpInfo**](docs/MetadataApi.md#createTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/create | Create a new tag +*MetadataApi* | [**createTableVersion**](docs/MetadataApi.md#createTableVersion) | **POST** /v1/table/{id}/version/create | Create a new table version +*MetadataApi* | [**createTableVersionWithHttpInfo**](docs/MetadataApi.md#createTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/create | Create a new table version +*MetadataApi* | [**declareTable**](docs/MetadataApi.md#declareTable) | **POST** /v1/table/{id}/declare | Declare a table +*MetadataApi* | [**declareTableWithHttpInfo**](docs/MetadataApi.md#declareTableWithHttpInfo) | **POST** /v1/table/{id}/declare | Declare a table +*MetadataApi* | [**deleteTableTag**](docs/MetadataApi.md#deleteTableTag) | **POST** /v1/table/{id}/tags/delete | Delete a tag +*MetadataApi* | [**deleteTableTagWithHttpInfo**](docs/MetadataApi.md#deleteTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/delete | Delete a tag +*MetadataApi* | [**deregisterTable**](docs/MetadataApi.md#deregisterTable) | **POST** /v1/table/{id}/deregister | Deregister a table +*MetadataApi* | [**deregisterTableWithHttpInfo**](docs/MetadataApi.md#deregisterTableWithHttpInfo) | **POST** /v1/table/{id}/deregister | Deregister a table +*MetadataApi* | [**describeNamespace**](docs/MetadataApi.md#describeNamespace) | **POST** /v1/namespace/{id}/describe | Describe a namespace +*MetadataApi* | [**describeNamespaceWithHttpInfo**](docs/MetadataApi.md#describeNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/describe | Describe a namespace +*MetadataApi* | [**describeTable**](docs/MetadataApi.md#describeTable) | **POST** /v1/table/{id}/describe | Describe information of a table +*MetadataApi* | [**describeTableWithHttpInfo**](docs/MetadataApi.md#describeTableWithHttpInfo) | **POST** /v1/table/{id}/describe | Describe information of a table +*MetadataApi* | [**describeTableIndexStats**](docs/MetadataApi.md#describeTableIndexStats) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics +*MetadataApi* | [**describeTableIndexStatsWithHttpInfo**](docs/MetadataApi.md#describeTableIndexStatsWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics +*MetadataApi* | [**describeTableVersion**](docs/MetadataApi.md#describeTableVersion) | **POST** /v1/table/{id}/version/describe | Describe a specific table version +*MetadataApi* | [**describeTableVersionWithHttpInfo**](docs/MetadataApi.md#describeTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/describe | Describe a specific table version +*MetadataApi* | [**describeTransaction**](docs/MetadataApi.md#describeTransaction) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction +*MetadataApi* | [**describeTransactionWithHttpInfo**](docs/MetadataApi.md#describeTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction +*MetadataApi* | [**dropNamespace**](docs/MetadataApi.md#dropNamespace) | **POST** /v1/namespace/{id}/drop | Drop a namespace +*MetadataApi* | [**dropNamespaceWithHttpInfo**](docs/MetadataApi.md#dropNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/drop | Drop a namespace +*MetadataApi* | [**dropTable**](docs/MetadataApi.md#dropTable) | **POST** /v1/table/{id}/drop | Drop a table +*MetadataApi* | [**dropTableWithHttpInfo**](docs/MetadataApi.md#dropTableWithHttpInfo) | **POST** /v1/table/{id}/drop | Drop a table +*MetadataApi* | [**dropTableIndex**](docs/MetadataApi.md#dropTableIndex) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index +*MetadataApi* | [**dropTableIndexWithHttpInfo**](docs/MetadataApi.md#dropTableIndexWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index +*MetadataApi* | [**getTableStats**](docs/MetadataApi.md#getTableStats) | **POST** /v1/table/{id}/stats | Get table statistics +*MetadataApi* | [**getTableStatsWithHttpInfo**](docs/MetadataApi.md#getTableStatsWithHttpInfo) | **POST** /v1/table/{id}/stats | Get table statistics +*MetadataApi* | [**getTableTagVersion**](docs/MetadataApi.md#getTableTagVersion) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag +*MetadataApi* | [**getTableTagVersionWithHttpInfo**](docs/MetadataApi.md#getTableTagVersionWithHttpInfo) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag +*MetadataApi* | [**listNamespaces**](docs/MetadataApi.md#listNamespaces) | **GET** /v1/namespace/{id}/list | List namespaces +*MetadataApi* | [**listNamespacesWithHttpInfo**](docs/MetadataApi.md#listNamespacesWithHttpInfo) | **GET** /v1/namespace/{id}/list | List namespaces +*MetadataApi* | [**listTableIndices**](docs/MetadataApi.md#listTableIndices) | **POST** /v1/table/{id}/index/list | List indexes on a table +*MetadataApi* | [**listTableIndicesWithHttpInfo**](docs/MetadataApi.md#listTableIndicesWithHttpInfo) | **POST** /v1/table/{id}/index/list | List indexes on a table +*MetadataApi* | [**listTableTags**](docs/MetadataApi.md#listTableTags) | **POST** /v1/table/{id}/tags/list | List all tags for a table +*MetadataApi* | [**listTableTagsWithHttpInfo**](docs/MetadataApi.md#listTableTagsWithHttpInfo) | **POST** /v1/table/{id}/tags/list | List all tags for a table +*MetadataApi* | [**listTableVersions**](docs/MetadataApi.md#listTableVersions) | **POST** /v1/table/{id}/version/list | List all versions of a table +*MetadataApi* | [**listTableVersionsWithHttpInfo**](docs/MetadataApi.md#listTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/list | List all versions of a table +*MetadataApi* | [**listTables**](docs/MetadataApi.md#listTables) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace +*MetadataApi* | [**listTablesWithHttpInfo**](docs/MetadataApi.md#listTablesWithHttpInfo) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace +*MetadataApi* | [**namespaceExists**](docs/MetadataApi.md#namespaceExists) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists +*MetadataApi* | [**namespaceExistsWithHttpInfo**](docs/MetadataApi.md#namespaceExistsWithHttpInfo) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists +*MetadataApi* | [**registerTable**](docs/MetadataApi.md#registerTable) | **POST** /v1/table/{id}/register | Register a table to a namespace +*MetadataApi* | [**registerTableWithHttpInfo**](docs/MetadataApi.md#registerTableWithHttpInfo) | **POST** /v1/table/{id}/register | Register a table to a namespace +*MetadataApi* | [**renameTable**](docs/MetadataApi.md#renameTable) | **POST** /v1/table/{id}/rename | Rename a table +*MetadataApi* | [**renameTableWithHttpInfo**](docs/MetadataApi.md#renameTableWithHttpInfo) | **POST** /v1/table/{id}/rename | Rename a table +*MetadataApi* | [**restoreTable**](docs/MetadataApi.md#restoreTable) | **POST** /v1/table/{id}/restore | Restore table to a specific version +*MetadataApi* | [**restoreTableWithHttpInfo**](docs/MetadataApi.md#restoreTableWithHttpInfo) | **POST** /v1/table/{id}/restore | Restore table to a specific version +*MetadataApi* | [**tableExists**](docs/MetadataApi.md#tableExists) | **POST** /v1/table/{id}/exists | Check if a table exists +*MetadataApi* | [**tableExistsWithHttpInfo**](docs/MetadataApi.md#tableExistsWithHttpInfo) | **POST** /v1/table/{id}/exists | Check if a table exists +*MetadataApi* | [**updateTableSchemaMetadata**](docs/MetadataApi.md#updateTableSchemaMetadata) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata +*MetadataApi* | [**updateTableSchemaMetadataWithHttpInfo**](docs/MetadataApi.md#updateTableSchemaMetadataWithHttpInfo) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata +*MetadataApi* | [**updateTableTag**](docs/MetadataApi.md#updateTableTag) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version +*MetadataApi* | [**updateTableTagWithHttpInfo**](docs/MetadataApi.md#updateTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version +*NamespaceApi* | [**createNamespace**](docs/NamespaceApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace +*NamespaceApi* | [**createNamespaceWithHttpInfo**](docs/NamespaceApi.md#createNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/create | Create a new namespace +*NamespaceApi* | [**describeNamespace**](docs/NamespaceApi.md#describeNamespace) | **POST** /v1/namespace/{id}/describe | Describe a namespace +*NamespaceApi* | [**describeNamespaceWithHttpInfo**](docs/NamespaceApi.md#describeNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/describe | Describe a namespace +*NamespaceApi* | [**dropNamespace**](docs/NamespaceApi.md#dropNamespace) | **POST** /v1/namespace/{id}/drop | Drop a namespace +*NamespaceApi* | [**dropNamespaceWithHttpInfo**](docs/NamespaceApi.md#dropNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/drop | Drop a namespace +*NamespaceApi* | [**listNamespaces**](docs/NamespaceApi.md#listNamespaces) | **GET** /v1/namespace/{id}/list | List namespaces +*NamespaceApi* | [**listNamespacesWithHttpInfo**](docs/NamespaceApi.md#listNamespacesWithHttpInfo) | **GET** /v1/namespace/{id}/list | List namespaces +*NamespaceApi* | [**listTables**](docs/NamespaceApi.md#listTables) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace +*NamespaceApi* | [**listTablesWithHttpInfo**](docs/NamespaceApi.md#listTablesWithHttpInfo) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace +*NamespaceApi* | [**namespaceExists**](docs/NamespaceApi.md#namespaceExists) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists +*NamespaceApi* | [**namespaceExistsWithHttpInfo**](docs/NamespaceApi.md#namespaceExistsWithHttpInfo) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists +*TableApi* | [**alterTableAddColumns**](docs/TableApi.md#alterTableAddColumns) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema +*TableApi* | [**alterTableAddColumnsWithHttpInfo**](docs/TableApi.md#alterTableAddColumnsWithHttpInfo) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema +*TableApi* | [**alterTableAlterColumns**](docs/TableApi.md#alterTableAlterColumns) | **POST** /v1/table/{id}/alter_columns | Modify existing columns +*TableApi* | [**alterTableAlterColumnsWithHttpInfo**](docs/TableApi.md#alterTableAlterColumnsWithHttpInfo) | **POST** /v1/table/{id}/alter_columns | Modify existing columns +*TableApi* | [**alterTableDropColumns**](docs/TableApi.md#alterTableDropColumns) | **POST** /v1/table/{id}/drop_columns | Remove columns from table +*TableApi* | [**alterTableDropColumnsWithHttpInfo**](docs/TableApi.md#alterTableDropColumnsWithHttpInfo) | **POST** /v1/table/{id}/drop_columns | Remove columns from table +*TableApi* | [**analyzeTableQueryPlan**](docs/TableApi.md#analyzeTableQueryPlan) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan +*TableApi* | [**analyzeTableQueryPlanWithHttpInfo**](docs/TableApi.md#analyzeTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan +*TableApi* | [**batchCreateTableVersions**](docs/TableApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables +*TableApi* | [**batchCreateTableVersionsWithHttpInfo**](docs/TableApi.md#batchCreateTableVersionsWithHttpInfo) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables +*TableApi* | [**batchDeleteTableVersions**](docs/TableApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records +*TableApi* | [**batchDeleteTableVersionsWithHttpInfo**](docs/TableApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records +*TableApi* | [**countTableRows**](docs/TableApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table +*TableApi* | [**countTableRowsWithHttpInfo**](docs/TableApi.md#countTableRowsWithHttpInfo) | **POST** /v1/table/{id}/count_rows | Count rows in a table +*TableApi* | [**createEmptyTable**](docs/TableApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table +*TableApi* | [**createEmptyTableWithHttpInfo**](docs/TableApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table +*TableApi* | [**createTable**](docs/TableApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name +*TableApi* | [**createTableWithHttpInfo**](docs/TableApi.md#createTableWithHttpInfo) | **POST** /v1/table/{id}/create | Create a table with the given name +*TableApi* | [**createTableIndex**](docs/TableApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table +*TableApi* | [**createTableIndexWithHttpInfo**](docs/TableApi.md#createTableIndexWithHttpInfo) | **POST** /v1/table/{id}/create_index | Create an index on a table +*TableApi* | [**createTableScalarIndex**](docs/TableApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table +*TableApi* | [**createTableScalarIndexWithHttpInfo**](docs/TableApi.md#createTableScalarIndexWithHttpInfo) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table +*TableApi* | [**createTableTag**](docs/TableApi.md#createTableTag) | **POST** /v1/table/{id}/tags/create | Create a new tag +*TableApi* | [**createTableTagWithHttpInfo**](docs/TableApi.md#createTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/create | Create a new tag +*TableApi* | [**createTableVersion**](docs/TableApi.md#createTableVersion) | **POST** /v1/table/{id}/version/create | Create a new table version +*TableApi* | [**createTableVersionWithHttpInfo**](docs/TableApi.md#createTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/create | Create a new table version +*TableApi* | [**declareTable**](docs/TableApi.md#declareTable) | **POST** /v1/table/{id}/declare | Declare a table +*TableApi* | [**declareTableWithHttpInfo**](docs/TableApi.md#declareTableWithHttpInfo) | **POST** /v1/table/{id}/declare | Declare a table +*TableApi* | [**deleteFromTable**](docs/TableApi.md#deleteFromTable) | **POST** /v1/table/{id}/delete | Delete rows from a table +*TableApi* | [**deleteFromTableWithHttpInfo**](docs/TableApi.md#deleteFromTableWithHttpInfo) | **POST** /v1/table/{id}/delete | Delete rows from a table +*TableApi* | [**deleteTableTag**](docs/TableApi.md#deleteTableTag) | **POST** /v1/table/{id}/tags/delete | Delete a tag +*TableApi* | [**deleteTableTagWithHttpInfo**](docs/TableApi.md#deleteTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/delete | Delete a tag +*TableApi* | [**deregisterTable**](docs/TableApi.md#deregisterTable) | **POST** /v1/table/{id}/deregister | Deregister a table +*TableApi* | [**deregisterTableWithHttpInfo**](docs/TableApi.md#deregisterTableWithHttpInfo) | **POST** /v1/table/{id}/deregister | Deregister a table +*TableApi* | [**describeTable**](docs/TableApi.md#describeTable) | **POST** /v1/table/{id}/describe | Describe information of a table +*TableApi* | [**describeTableWithHttpInfo**](docs/TableApi.md#describeTableWithHttpInfo) | **POST** /v1/table/{id}/describe | Describe information of a table +*TableApi* | [**describeTableIndexStats**](docs/TableApi.md#describeTableIndexStats) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics +*TableApi* | [**describeTableIndexStatsWithHttpInfo**](docs/TableApi.md#describeTableIndexStatsWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics +*TableApi* | [**describeTableVersion**](docs/TableApi.md#describeTableVersion) | **POST** /v1/table/{id}/version/describe | Describe a specific table version +*TableApi* | [**describeTableVersionWithHttpInfo**](docs/TableApi.md#describeTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/describe | Describe a specific table version +*TableApi* | [**dropTable**](docs/TableApi.md#dropTable) | **POST** /v1/table/{id}/drop | Drop a table +*TableApi* | [**dropTableWithHttpInfo**](docs/TableApi.md#dropTableWithHttpInfo) | **POST** /v1/table/{id}/drop | Drop a table +*TableApi* | [**dropTableIndex**](docs/TableApi.md#dropTableIndex) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index +*TableApi* | [**dropTableIndexWithHttpInfo**](docs/TableApi.md#dropTableIndexWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index +*TableApi* | [**explainTableQueryPlan**](docs/TableApi.md#explainTableQueryPlan) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation +*TableApi* | [**explainTableQueryPlanWithHttpInfo**](docs/TableApi.md#explainTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation +*TableApi* | [**getTableStats**](docs/TableApi.md#getTableStats) | **POST** /v1/table/{id}/stats | Get table statistics +*TableApi* | [**getTableStatsWithHttpInfo**](docs/TableApi.md#getTableStatsWithHttpInfo) | **POST** /v1/table/{id}/stats | Get table statistics +*TableApi* | [**getTableTagVersion**](docs/TableApi.md#getTableTagVersion) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag +*TableApi* | [**getTableTagVersionWithHttpInfo**](docs/TableApi.md#getTableTagVersionWithHttpInfo) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag +*TableApi* | [**insertIntoTable**](docs/TableApi.md#insertIntoTable) | **POST** /v1/table/{id}/insert | Insert records into a table +*TableApi* | [**insertIntoTableWithHttpInfo**](docs/TableApi.md#insertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/insert | Insert records into a table +*TableApi* | [**listAllTables**](docs/TableApi.md#listAllTables) | **GET** /v1/table | List all tables +*TableApi* | [**listAllTablesWithHttpInfo**](docs/TableApi.md#listAllTablesWithHttpInfo) | **GET** /v1/table | List all tables +*TableApi* | [**listTableIndices**](docs/TableApi.md#listTableIndices) | **POST** /v1/table/{id}/index/list | List indexes on a table +*TableApi* | [**listTableIndicesWithHttpInfo**](docs/TableApi.md#listTableIndicesWithHttpInfo) | **POST** /v1/table/{id}/index/list | List indexes on a table +*TableApi* | [**listTableTags**](docs/TableApi.md#listTableTags) | **POST** /v1/table/{id}/tags/list | List all tags for a table +*TableApi* | [**listTableTagsWithHttpInfo**](docs/TableApi.md#listTableTagsWithHttpInfo) | **POST** /v1/table/{id}/tags/list | List all tags for a table +*TableApi* | [**listTableVersions**](docs/TableApi.md#listTableVersions) | **POST** /v1/table/{id}/version/list | List all versions of a table +*TableApi* | [**listTableVersionsWithHttpInfo**](docs/TableApi.md#listTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/list | List all versions of a table +*TableApi* | [**listTables**](docs/TableApi.md#listTables) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace +*TableApi* | [**listTablesWithHttpInfo**](docs/TableApi.md#listTablesWithHttpInfo) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace +*TableApi* | [**mergeInsertIntoTable**](docs/TableApi.md#mergeInsertIntoTable) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table +*TableApi* | [**mergeInsertIntoTableWithHttpInfo**](docs/TableApi.md#mergeInsertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table +*TableApi* | [**queryTable**](docs/TableApi.md#queryTable) | **POST** /v1/table/{id}/query | Query a table +*TableApi* | [**queryTableWithHttpInfo**](docs/TableApi.md#queryTableWithHttpInfo) | **POST** /v1/table/{id}/query | Query a table +*TableApi* | [**registerTable**](docs/TableApi.md#registerTable) | **POST** /v1/table/{id}/register | Register a table to a namespace +*TableApi* | [**registerTableWithHttpInfo**](docs/TableApi.md#registerTableWithHttpInfo) | **POST** /v1/table/{id}/register | Register a table to a namespace +*TableApi* | [**renameTable**](docs/TableApi.md#renameTable) | **POST** /v1/table/{id}/rename | Rename a table +*TableApi* | [**renameTableWithHttpInfo**](docs/TableApi.md#renameTableWithHttpInfo) | **POST** /v1/table/{id}/rename | Rename a table +*TableApi* | [**restoreTable**](docs/TableApi.md#restoreTable) | **POST** /v1/table/{id}/restore | Restore table to a specific version +*TableApi* | [**restoreTableWithHttpInfo**](docs/TableApi.md#restoreTableWithHttpInfo) | **POST** /v1/table/{id}/restore | Restore table to a specific version +*TableApi* | [**tableExists**](docs/TableApi.md#tableExists) | **POST** /v1/table/{id}/exists | Check if a table exists +*TableApi* | [**tableExistsWithHttpInfo**](docs/TableApi.md#tableExistsWithHttpInfo) | **POST** /v1/table/{id}/exists | Check if a table exists +*TableApi* | [**updateTable**](docs/TableApi.md#updateTable) | **POST** /v1/table/{id}/update | Update rows in a table +*TableApi* | [**updateTableWithHttpInfo**](docs/TableApi.md#updateTableWithHttpInfo) | **POST** /v1/table/{id}/update | Update rows in a table +*TableApi* | [**updateTableSchemaMetadata**](docs/TableApi.md#updateTableSchemaMetadata) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata +*TableApi* | [**updateTableSchemaMetadataWithHttpInfo**](docs/TableApi.md#updateTableSchemaMetadataWithHttpInfo) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata +*TableApi* | [**updateTableTag**](docs/TableApi.md#updateTableTag) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version +*TableApi* | [**updateTableTagWithHttpInfo**](docs/TableApi.md#updateTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version +*TagApi* | [**createTableTag**](docs/TagApi.md#createTableTag) | **POST** /v1/table/{id}/tags/create | Create a new tag +*TagApi* | [**createTableTagWithHttpInfo**](docs/TagApi.md#createTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/create | Create a new tag +*TagApi* | [**deleteTableTag**](docs/TagApi.md#deleteTableTag) | **POST** /v1/table/{id}/tags/delete | Delete a tag +*TagApi* | [**deleteTableTagWithHttpInfo**](docs/TagApi.md#deleteTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/delete | Delete a tag +*TagApi* | [**getTableTagVersion**](docs/TagApi.md#getTableTagVersion) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag +*TagApi* | [**getTableTagVersionWithHttpInfo**](docs/TagApi.md#getTableTagVersionWithHttpInfo) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag +*TagApi* | [**listTableTags**](docs/TagApi.md#listTableTags) | **POST** /v1/table/{id}/tags/list | List all tags for a table +*TagApi* | [**listTableTagsWithHttpInfo**](docs/TagApi.md#listTableTagsWithHttpInfo) | **POST** /v1/table/{id}/tags/list | List all tags for a table +*TagApi* | [**updateTableTag**](docs/TagApi.md#updateTableTag) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version +*TagApi* | [**updateTableTagWithHttpInfo**](docs/TagApi.md#updateTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version +*TransactionApi* | [**alterTransaction**](docs/TransactionApi.md#alterTransaction) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. +*TransactionApi* | [**alterTransactionWithHttpInfo**](docs/TransactionApi.md#alterTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. +*TransactionApi* | [**describeTransaction**](docs/TransactionApi.md#describeTransaction) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction +*TransactionApi* | [**describeTransactionWithHttpInfo**](docs/TransactionApi.md#describeTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction + + +## Documentation for Models + + - [AddVirtualColumnEntry](docs/AddVirtualColumnEntry.md) + - [AlterColumnsEntry](docs/AlterColumnsEntry.md) + - [AlterTableAddColumnsRequest](docs/AlterTableAddColumnsRequest.md) + - [AlterTableAddColumnsResponse](docs/AlterTableAddColumnsResponse.md) + - [AlterTableAlterColumnsRequest](docs/AlterTableAlterColumnsRequest.md) + - [AlterTableAlterColumnsResponse](docs/AlterTableAlterColumnsResponse.md) + - [AlterTableDropColumnsRequest](docs/AlterTableDropColumnsRequest.md) + - [AlterTableDropColumnsResponse](docs/AlterTableDropColumnsResponse.md) + - [AlterTransactionAction](docs/AlterTransactionAction.md) + - [AlterTransactionRequest](docs/AlterTransactionRequest.md) + - [AlterTransactionResponse](docs/AlterTransactionResponse.md) + - [AlterTransactionSetProperty](docs/AlterTransactionSetProperty.md) + - [AlterTransactionSetStatus](docs/AlterTransactionSetStatus.md) + - [AlterTransactionUnsetProperty](docs/AlterTransactionUnsetProperty.md) + - [AlterVirtualColumnEntry](docs/AlterVirtualColumnEntry.md) + - [AnalyzeTableQueryPlanRequest](docs/AnalyzeTableQueryPlanRequest.md) + - [AnalyzeTableQueryPlanResponse](docs/AnalyzeTableQueryPlanResponse.md) + - [BatchCreateTableVersionsRequest](docs/BatchCreateTableVersionsRequest.md) + - [BatchCreateTableVersionsResponse](docs/BatchCreateTableVersionsResponse.md) + - [BatchDeleteTableVersionsRequest](docs/BatchDeleteTableVersionsRequest.md) + - [BatchDeleteTableVersionsResponse](docs/BatchDeleteTableVersionsResponse.md) + - [BooleanQuery](docs/BooleanQuery.md) + - [BoostQuery](docs/BoostQuery.md) + - [CountTableRowsRequest](docs/CountTableRowsRequest.md) + - [CreateEmptyTableRequest](docs/CreateEmptyTableRequest.md) + - [CreateEmptyTableResponse](docs/CreateEmptyTableResponse.md) + - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) + - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) + - [CreateTableIndexRequest](docs/CreateTableIndexRequest.md) + - [CreateTableIndexResponse](docs/CreateTableIndexResponse.md) + - [CreateTableRequest](docs/CreateTableRequest.md) + - [CreateTableResponse](docs/CreateTableResponse.md) + - [CreateTableScalarIndexResponse](docs/CreateTableScalarIndexResponse.md) + - [CreateTableTagRequest](docs/CreateTableTagRequest.md) + - [CreateTableTagResponse](docs/CreateTableTagResponse.md) + - [CreateTableVersionEntry](docs/CreateTableVersionEntry.md) + - [CreateTableVersionRequest](docs/CreateTableVersionRequest.md) + - [CreateTableVersionResponse](docs/CreateTableVersionResponse.md) + - [DeclareTableRequest](docs/DeclareTableRequest.md) + - [DeclareTableResponse](docs/DeclareTableResponse.md) + - [DeleteFromTableRequest](docs/DeleteFromTableRequest.md) + - [DeleteFromTableResponse](docs/DeleteFromTableResponse.md) + - [DeleteTableTagRequest](docs/DeleteTableTagRequest.md) + - [DeleteTableTagResponse](docs/DeleteTableTagResponse.md) + - [DeregisterTableRequest](docs/DeregisterTableRequest.md) + - [DeregisterTableResponse](docs/DeregisterTableResponse.md) + - [DescribeNamespaceRequest](docs/DescribeNamespaceRequest.md) + - [DescribeNamespaceResponse](docs/DescribeNamespaceResponse.md) + - [DescribeTableIndexStatsRequest](docs/DescribeTableIndexStatsRequest.md) + - [DescribeTableIndexStatsResponse](docs/DescribeTableIndexStatsResponse.md) + - [DescribeTableRequest](docs/DescribeTableRequest.md) + - [DescribeTableResponse](docs/DescribeTableResponse.md) + - [DescribeTableVersionRequest](docs/DescribeTableVersionRequest.md) + - [DescribeTableVersionResponse](docs/DescribeTableVersionResponse.md) + - [DescribeTransactionRequest](docs/DescribeTransactionRequest.md) + - [DescribeTransactionResponse](docs/DescribeTransactionResponse.md) + - [DropNamespaceRequest](docs/DropNamespaceRequest.md) + - [DropNamespaceResponse](docs/DropNamespaceResponse.md) + - [DropTableIndexRequest](docs/DropTableIndexRequest.md) + - [DropTableIndexResponse](docs/DropTableIndexResponse.md) + - [DropTableRequest](docs/DropTableRequest.md) + - [DropTableResponse](docs/DropTableResponse.md) + - [ErrorResponse](docs/ErrorResponse.md) + - [ExplainTableQueryPlanRequest](docs/ExplainTableQueryPlanRequest.md) + - [ExplainTableQueryPlanResponse](docs/ExplainTableQueryPlanResponse.md) + - [FragmentStats](docs/FragmentStats.md) + - [FragmentSummary](docs/FragmentSummary.md) + - [FtsQuery](docs/FtsQuery.md) + - [GetTableStatsRequest](docs/GetTableStatsRequest.md) + - [GetTableStatsResponse](docs/GetTableStatsResponse.md) + - [GetTableTagVersionRequest](docs/GetTableTagVersionRequest.md) + - [GetTableTagVersionResponse](docs/GetTableTagVersionResponse.md) + - [Identity](docs/Identity.md) + - [IndexContent](docs/IndexContent.md) + - [InsertIntoTableRequest](docs/InsertIntoTableRequest.md) + - [InsertIntoTableResponse](docs/InsertIntoTableResponse.md) + - [JsonArrowDataType](docs/JsonArrowDataType.md) + - [JsonArrowField](docs/JsonArrowField.md) + - [JsonArrowSchema](docs/JsonArrowSchema.md) + - [ListNamespacesRequest](docs/ListNamespacesRequest.md) + - [ListNamespacesResponse](docs/ListNamespacesResponse.md) + - [ListTableIndicesRequest](docs/ListTableIndicesRequest.md) + - [ListTableIndicesResponse](docs/ListTableIndicesResponse.md) + - [ListTableTagsRequest](docs/ListTableTagsRequest.md) + - [ListTableTagsResponse](docs/ListTableTagsResponse.md) + - [ListTableVersionsRequest](docs/ListTableVersionsRequest.md) + - [ListTableVersionsResponse](docs/ListTableVersionsResponse.md) + - [ListTablesRequest](docs/ListTablesRequest.md) + - [ListTablesResponse](docs/ListTablesResponse.md) + - [MatchQuery](docs/MatchQuery.md) + - [MergeInsertIntoTableRequest](docs/MergeInsertIntoTableRequest.md) + - [MergeInsertIntoTableResponse](docs/MergeInsertIntoTableResponse.md) + - [MultiMatchQuery](docs/MultiMatchQuery.md) + - [NamespaceExistsRequest](docs/NamespaceExistsRequest.md) + - [NewColumnTransform](docs/NewColumnTransform.md) + - [PartitionField](docs/PartitionField.md) + - [PartitionSpec](docs/PartitionSpec.md) + - [PartitionTransform](docs/PartitionTransform.md) + - [PhraseQuery](docs/PhraseQuery.md) + - [QueryTableRequest](docs/QueryTableRequest.md) + - [QueryTableRequestColumns](docs/QueryTableRequestColumns.md) + - [QueryTableRequestFullTextQuery](docs/QueryTableRequestFullTextQuery.md) + - [QueryTableRequestVector](docs/QueryTableRequestVector.md) + - [RegisterTableRequest](docs/RegisterTableRequest.md) + - [RegisterTableResponse](docs/RegisterTableResponse.md) + - [RenameTableRequest](docs/RenameTableRequest.md) + - [RenameTableResponse](docs/RenameTableResponse.md) + - [RestoreTableRequest](docs/RestoreTableRequest.md) + - [RestoreTableResponse](docs/RestoreTableResponse.md) + - [StringFtsQuery](docs/StringFtsQuery.md) + - [StructuredFtsQuery](docs/StructuredFtsQuery.md) + - [TableBasicStats](docs/TableBasicStats.md) + - [TableExistsRequest](docs/TableExistsRequest.md) + - [TableVersion](docs/TableVersion.md) + - [TagContents](docs/TagContents.md) + - [UpdateTableRequest](docs/UpdateTableRequest.md) + - [UpdateTableResponse](docs/UpdateTableResponse.md) + - [UpdateTableSchemaMetadataRequest](docs/UpdateTableSchemaMetadataRequest.md) + - [UpdateTableSchemaMetadataResponse](docs/UpdateTableSchemaMetadataResponse.md) + - [UpdateTableTagRequest](docs/UpdateTableTagRequest.md) + - [UpdateTableTagResponse](docs/UpdateTableTagResponse.md) + - [VersionRange](docs/VersionRange.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### OAuth2 + + +- **Type**: OAuth +- **Flow**: application +- **Authorization URL**: +- **Scopes**: N/A + + +### BearerAuth + + +- **Type**: HTTP Bearer Token authentication + + +### ApiKeyAuth + + +- **Type**: API key +- **API key parameter name**: x-api-key +- **Location**: HTTP header + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. +However, the instances of the api clients created from the `ApiClient` are thread-safe and can be re-used. + +## Author + + + diff --git a/java/lance-namespace-async-client/api/openapi.yaml b/java/lance-namespace-async-client/api/openapi.yaml new file mode 100644 index 000000000..3c0e38ad4 --- /dev/null +++ b/java/lance-namespace-async-client/api/openapi.yaml @@ -0,0 +1,7201 @@ +openapi: 3.1.1 +info: + description: | + This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: + + The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define + the request and response shape for each operation in a Lance Namespace across all implementations. + See https://lance.org/format/namespace/operations for more details. + + The `servers`, `security`, `paths`, `components/parameters` sections are for the + Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. + See https://lance.org/format/namespace/rest for more details. + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Lance Namespace Specification + version: 1.0.0 +servers: +- description: Generic server URL with all parts configurable + url: "{scheme}://{host}:{port}/{basePath}" + variables: + scheme: + default: http + host: + default: localhost + port: + default: "2333" + basePath: + default: "" +- description: Server URL when the port can be inferred from the scheme + url: "{scheme}://{host}/{basePath}" + variables: + scheme: + default: http + host: + default: localhost + basePath: + default: "" +security: +- OAuth2: [] +- BearerAuth: [] +- ApiKeyAuth: [] +tags: +- description: | + Operations that are related to a namespace + name: Namespace +- description: | + Operations that are related to a table + name: Table +- description: | + Operations that are related to an index + name: Index +- description: | + Operations that are related to tags + name: Tag +- description: | + Operations that are related to a transaction + name: Transaction +- description: | + Operations that only interact with object metadata and should be computationally lightweight + name: Metadata +- description: | + Operations that interact with object data and might be computationally intensive + name: Data +paths: + /v1/namespace/{id}/create: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Create new namespace `id`. + + During the creation process, the implementation may modify user-provided `properties`, + such as adding additional properties like `created_at` to user-provided properties, + omitting any specific property, or performing actions based on any property value. + operationId: CreateNamespace + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateNamespaceRequest' + required: true + responses: + "200": + $ref: '#/components/responses/CreateNamespaceResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "406": + $ref: '#/components/responses/UnsupportedOperationErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create a new namespace + tags: + - Namespace + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/namespace/{id}/list: + get: + description: | + List all child namespace names of the parent namespace `id`. + + REST NAMESPACE ONLY + REST namespace uses GET to perform this operation without a request body. + It passes in the `ListNamespacesRequest` information in the following way: + - `id`: pass through path parameter of the same name + - `page_token`: pass through query parameter of the same name + - `limit`: pass through query parameter of the same name + operationId: ListNamespaces + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + responses: + "200": + $ref: '#/components/responses/ListNamespacesResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "406": + $ref: '#/components/responses/UnsupportedOperationErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: List namespaces + tags: + - Namespace + - Metadata + x-accepts: + - application/json + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + /v1/namespace/{id}/describe: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Describe the detailed information for namespace `id`. + operationId: DescribeNamespace + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeNamespaceRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DescribeNamespaceResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Describe a namespace + tags: + - Namespace + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/namespace/{id}/drop: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Drop namespace `id` from its parent namespace. + operationId: DropNamespace + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DropNamespaceRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DropNamespaceResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Drop a namespace + tags: + - Namespace + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/namespace/{id}/exists: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Check if namespace `id` exists. + + This operation must behave exactly like the DescribeNamespace API, + except it does not contain a response body. + operationId: NamespaceExists + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NamespaceExistsRequest' + required: true + responses: + "200": + description: "Success, no content" + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Check if a namespace exists + tags: + - Namespace + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/namespace/{id}/table/list: + get: + description: | + List all child table names of the parent namespace `id`. + + REST NAMESPACE ONLY + REST namespace uses GET to perform this operation without a request body. + It passes in the `ListTablesRequest` information in the following way: + - `id`: pass through path parameter of the same name + - `page_token`: pass through query parameter of the same name + - `limit`: pass through query parameter of the same name + operationId: ListTables + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + responses: + "200": + $ref: '#/components/responses/ListTablesResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "406": + $ref: '#/components/responses/UnsupportedOperationErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: List tables in a namespace + tags: + - Namespace + - Table + - Metadata + x-accepts: + - application/json + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + /v1/table: + get: + description: | + List all tables across all namespaces. + + REST NAMESPACE ONLY + REST namespace uses GET to perform this operation without a request body. + It passes in the `ListAllTablesRequest` information in the following way: + - `page_token`: pass through query parameter of the same name + - `limit`: pass through query parameter of the same name + - `delimiter`: pass through query parameter of the same name + operationId: ListAllTables + parameters: + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + responses: + "200": + $ref: '#/components/responses/ListTablesResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: List all tables + tags: + - Table + x-accepts: + - application/json + /v1/table/{id}/register: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Register an existing table at a given storage location as `id`. + operationId: RegisterTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/RegisterTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "406": + $ref: '#/components/responses/UnsupportedOperationErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Register a table to a namespace + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/describe: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/with_table_uri' + - $ref: '#/components/parameters/load_detailed_metadata' + post: + description: | + Describe the detailed information for table `id`. + + REST NAMESPACE ONLY + REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + operationId: DescribeTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/with_table_uri' + - $ref: '#/components/parameters/load_detailed_metadata' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DescribeTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Describe information of a table + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/exists: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Check if table `id` exists. + + This operation should behave exactly like DescribeTable, + except it does not contain a response body. + + For DirectoryNamespace implementation, a table exists if either: + - The table has Lance data versions (regular table created with CreateTable) + - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + operationId: TableExists + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TableExistsRequest' + required: true + responses: + "200": + description: "Success, no content" + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Check if a table exists + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/drop: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Drop table `id` and delete its data. + + REST NAMESPACE ONLY + REST namespace does not use a request body for this operation. + The `DropTableRequest` information is passed in the following way: + - `id`: pass through path parameter of the same name + operationId: DropTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + responses: + "200": + $ref: '#/components/responses/DropTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Drop a table + tags: + - Table + - Metadata + x-accepts: + - application/json + /v1/table/{id}/deregister: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Deregister table `id` from its namespace. + operationId: DeregisterTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeregisterTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DeregisterTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Deregister a table + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/restore: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Restore table `id` to a specific version. + operationId: RestoreTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestoreTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/RestoreTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Restore table to a specific version + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/rename: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Rename table `id` to a new name. + operationId: RenameTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RenameTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/RenameTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Rename a table + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/schema_metadata/update: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Replace the schema metadata for table `id` with the provided key-value pairs. + + REST NAMESPACE ONLY + REST namespace uses a direct object (map of string to string) as both request and response body + instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + operationId: UpdateTableSchemaMetadata + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + description: Schema metadata key-value pairs + required: true + responses: + "200": + content: + application/json: + schema: + additionalProperties: + type: string + description: The updated schema metadata + description: Schema metadata update result + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Update table schema metadata + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/version/list: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + - description: | + When true, versions are guaranteed to be returned in descending order (latest to oldest). + When false or not specified, the ordering is implementation-defined. + explode: true + in: query + name: descending + required: false + schema: + type: boolean + style: form + post: + description: | + List all versions (commits) of table `id` with their metadata. + + Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). + Otherwise, the ordering is implementation-defined. + + REST NAMESPACE ONLY + REST namespace does not use a request body for this operation. + The `ListTableVersionsRequest` information is passed in the following way: + - `id`: pass through path parameter of the same name + - `page_token`: pass through query parameter of the same name + - `limit`: pass through query parameter of the same name + - `descending`: pass through query parameter of the same name + operationId: ListTableVersions + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + - description: | + When true, versions are guaranteed to be returned in descending order (latest to oldest). + When false or not specified, the ordering is implementation-defined. + explode: true + in: query + name: descending + required: false + schema: + type: boolean + style: form + responses: + "200": + $ref: '#/components/responses/ListTableVersionsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: List all versions of a table + tags: + - Table + - Metadata + x-accepts: + - application/json + /v1/table/{id}/version/create: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Create a new version entry for table `id`. + + This operation supports `put_if_not_exists` semantics. + The operation will fail with 409 Conflict if the version already exists. + operationId: CreateTableVersion + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableVersionRequest' + required: true + responses: + "200": + $ref: '#/components/responses/CreateTableVersionResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create a new table version + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/version/describe: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Describe the detailed information for a specific version of table `id`. + + Returns the manifest path and metadata for the specified version. + operationId: DescribeTableVersion + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTableVersionRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DescribeTableVersionResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Describe a specific table version + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/version/delete: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Delete version metadata records for table `id`. + + This operation deletes version tracking records, NOT the actual table data. + It supports deleting ranges of versions for efficient bulk cleanup. + + Special range values: + - `start_version: 0` with `end_version: -1` means delete ALL version records + operationId: BatchDeleteTableVersions + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchDeleteTableVersionsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/BatchDeleteTableVersionsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Delete table version records + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/version/batch-create: + parameters: + - $ref: '#/components/parameters/delimiter' + post: + description: | + Atomically create new version entries for multiple tables. + + This operation is atomic: either all table versions are created successfully, + or none are created. If any version creation fails (e.g., due to conflict), + the entire batch operation fails. + + Each entry in the request specifies the table identifier and version details. + This supports `put_if_not_exists` semantics for each version entry. + operationId: BatchCreateTableVersions + parameters: + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchCreateTableVersionsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/BatchCreateTableVersionsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Atomically create versions for multiple tables + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/alter_columns: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Modify existing columns in table `id`, such as renaming or changing data types. + operationId: AlterTableAlterColumns + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTableAlterColumnsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/AlterTableAlterColumnsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Modify existing columns + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/drop_columns: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Remove specified columns from table `id`. + operationId: AlterTableDropColumns + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTableDropColumnsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/AlterTableDropColumnsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Remove columns from table + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/stats: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Get statistics for table `id`, including row counts, data sizes, and column statistics. + operationId: GetTableStats + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTableStatsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/GetTableStatsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Get table statistics + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/insert: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: | + How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Append (default): insert data to the existing table + - Overwrite: remove all data in the table and then insert data to it + explode: true + in: query + name: mode + required: false + schema: + default: append + type: string + style: form + post: + description: | + Insert new records into table `id`. + + REST NAMESPACE ONLY + REST namespace uses Arrow IPC stream as the request body. + It passes in the `InsertIntoTableRequest` information in the following way: + - `id`: pass through path parameter of the same name + - `mode`: pass through query parameter of the same name + operationId: InsertIntoTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: | + How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Append (default): insert data to the existing table + - Overwrite: remove all data in the table and then insert data to it + explode: true + in: query + name: mode + required: false + schema: + default: append + type: string + style: form + requestBody: + content: + application/vnd.apache.arrow.stream: + schema: + format: binary + type: string + description: Arrow IPC stream containing the records to insert + required: true + responses: + "200": + $ref: '#/components/responses/InsertIntoTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Insert records into a table + tags: + - Table + - Data + x-content-type: application/vnd.apache.arrow.stream + x-accepts: + - application/json + /v1/table/{id}/merge_insert: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: Column name to use for matching rows (required) + explode: true + in: query + name: "on" + required: true + schema: + type: string + style: form + - description: Update all columns when rows match + explode: true + in: query + name: when_matched_update_all + required: false + schema: + default: false + type: boolean + style: form + - description: The row is updated (similar to UpdateAll) only for rows where the + SQL expression evaluates to true + explode: true + in: query + name: when_matched_update_all_filt + required: false + schema: + type: string + style: form + - description: Insert all columns when rows don't match + explode: true + in: query + name: when_not_matched_insert_all + required: false + schema: + default: false + type: boolean + style: form + - description: Delete all rows from target table that don't match a row in the + source table + explode: true + in: query + name: when_not_matched_by_source_delete + required: false + schema: + default: false + type: boolean + style: form + - description: Delete rows from the target table if there is no match AND the + SQL expression evaluates to true + explode: true + in: query + name: when_not_matched_by_source_delete_filt + required: false + schema: + type: string + style: form + - description: "Timeout for the operation (e.g., \"30s\", \"5m\")" + explode: true + in: query + name: timeout + required: false + schema: + type: string + style: form + - description: Whether to use index for matching rows + explode: true + in: query + name: use_index + required: false + schema: + default: false + type: boolean + style: form + post: + description: | + Performs a merge insert (upsert) operation on table `id`. + This operation updates existing rows + based on a matching column and inserts new rows that don't match. + It returns the number of rows inserted and updated. + + REST NAMESPACE ONLY + REST namespace uses Arrow IPC stream as the request body. + It passes in the `MergeInsertIntoTableRequest` information in the following way: + - `id`: pass through path parameter of the same name + - `on`: pass through query parameter of the same name + - `when_matched_update_all`: pass through query parameter of the same name + - `when_matched_update_all_filt`: pass through query parameter of the same name + - `when_not_matched_insert_all`: pass through query parameter of the same name + - `when_not_matched_by_source_delete`: pass through query parameter of the same name + - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + operationId: MergeInsertIntoTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: Column name to use for matching rows (required) + explode: true + in: query + name: "on" + required: true + schema: + type: string + style: form + - description: Update all columns when rows match + explode: true + in: query + name: when_matched_update_all + required: false + schema: + default: false + type: boolean + style: form + - description: The row is updated (similar to UpdateAll) only for rows where + the SQL expression evaluates to true + explode: true + in: query + name: when_matched_update_all_filt + required: false + schema: + type: string + style: form + - description: Insert all columns when rows don't match + explode: true + in: query + name: when_not_matched_insert_all + required: false + schema: + default: false + type: boolean + style: form + - description: Delete all rows from target table that don't match a row in the + source table + explode: true + in: query + name: when_not_matched_by_source_delete + required: false + schema: + default: false + type: boolean + style: form + - description: Delete rows from the target table if there is no match AND the + SQL expression evaluates to true + explode: true + in: query + name: when_not_matched_by_source_delete_filt + required: false + schema: + type: string + style: form + - description: "Timeout for the operation (e.g., \"30s\", \"5m\")" + explode: true + in: query + name: timeout + required: false + schema: + type: string + style: form + - description: Whether to use index for matching rows + explode: true + in: query + name: use_index + required: false + schema: + default: false + type: boolean + style: form + requestBody: + content: + application/vnd.apache.arrow.stream: + schema: + format: binary + type: string + description: Arrow IPC stream containing the records to merge + required: true + responses: + "200": + $ref: '#/components/responses/MergeInsertIntoTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Merge insert (upsert) records into a table + tags: + - Table + - Data + x-content-type: application/vnd.apache.arrow.stream + x-accepts: + - application/json + /v1/table/{id}/update: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Update existing rows in table `id`. + operationId: UpdateTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTableRequest' + description: Update request + required: true + responses: + "200": + $ref: '#/components/responses/UpdateTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Update rows in a table + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/delete: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Delete rows from table `id`. + operationId: DeleteFromTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteFromTableRequest' + description: Delete request + required: true + responses: + "200": + $ref: '#/components/responses/DeleteFromTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Delete rows from a table + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/query: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Query table `id` with vector search, full text search and optional SQL filtering. + Returns results in Arrow IPC file or stream format. + + REST NAMESPACE ONLY + REST namespace returns the response as Arrow IPC file binary data + instead of the `QueryTableResponse` JSON object. + operationId: QueryTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryTableRequest' + description: Query request + required: true + responses: + "200": + $ref: '#/components/responses/QueryTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Query a table + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + - application/vnd.apache.arrow.file + /v1/table/{id}/count_rows: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Count the number of rows in table `id` + + REST NAMESPACE ONLY + REST namespace returns the response as a plain integer + instead of the `CountTableRowsResponse` JSON object. + operationId: CountTableRows + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CountTableRowsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/CountTableRowsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Count rows in a table + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/create: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - explode: true + in: query + name: mode + required: false + schema: + type: string + style: form + post: + description: | + Create table `id` in the namespace with the given data in Arrow IPC stream. + + The schema of the Arrow IPC stream is used as the table schema. + If the stream is empty, the API creates a new empty table. + + REST NAMESPACE ONLY + REST namespace uses Arrow IPC stream as the request body. + It passes in the `CreateTableRequest` information in the following way: + - `id`: pass through path parameter of the same name + - `mode`: pass through query parameter of the same name + operationId: CreateTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - explode: true + in: query + name: mode + required: false + schema: + type: string + style: form + requestBody: + content: + application/vnd.apache.arrow.stream: + schema: + format: binary + type: string + description: Arrow IPC data + required: true + responses: + "200": + $ref: '#/components/responses/CreateTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create a table with the given name + tags: + - Table + - Data + x-content-type: application/vnd.apache.arrow.stream + x-accepts: + - application/json + /v1/table/{id}/explain_plan: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Get the query execution plan for a query against table `id`. + Returns a human-readable explanation of how the query will be executed. + + REST NAMESPACE ONLY + REST namespace returns the response as a plain string + instead of the `ExplainTableQueryPlanResponse` JSON object. + operationId: ExplainTableQueryPlan + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExplainTableQueryPlanRequest' + required: true + responses: + "200": + $ref: '#/components/responses/ExplainTableQueryPlanResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Get query execution plan explanation + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/analyze_plan: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Analyze the query execution plan for a query against table `id`. + Returns detailed statistics and analysis of the query execution plan. + + REST NAMESPACE ONLY + REST namespace returns the response as a plain string + instead of the `AnalyzeTableQueryPlanResponse` JSON object. + operationId: AnalyzeTableQueryPlan + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyzeTableQueryPlanRequest' + required: true + responses: + "200": + $ref: '#/components/responses/AnalyzeTableQueryPlanResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Analyze query execution plan + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/add_columns: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Add new columns to table `id` using SQL expressions or default values. + operationId: AlterTableAddColumns + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTableAddColumnsRequest' + required: true + responses: + "200": + $ref: '#/components/responses/AlterTableAddColumnsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Add new columns to table schema + tags: + - Table + - Data + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/create_index: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Create an index on a table column for faster search operations. + Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). + Index creation is handled asynchronously. + Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + operationId: CreateTableIndex + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableIndexRequest' + description: Index creation request + required: true + responses: + "200": + $ref: '#/components/responses/CreateTableIndexResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create an index on a table + tags: + - Table + - Index + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/create_scalar_index: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Create a scalar index on a table column for faster filtering operations. + Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). + This is an alias for CreateTableIndex specifically for scalar indexes. + Index creation is handled asynchronously. + Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + operationId: CreateTableScalarIndex + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableIndexRequest' + description: Scalar index creation request + required: true + responses: + "200": + $ref: '#/components/responses/CreateTableScalarIndexResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create a scalar index on a table + tags: + - Table + - Index + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/index/list: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + List all indices created on a table. Returns information about each index + including name, columns, status, and UUID. + operationId: ListTableIndices + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListTableIndicesRequest' + description: Index list request + required: true + responses: + "200": + $ref: '#/components/responses/ListTableIndicesResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: List indexes on a table + tags: + - Table + - Index + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/index/{index_name}/stats: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: Name of the index to get stats for + explode: false + in: path + name: index_name + required: true + schema: + type: string + style: simple + post: + description: | + Get statistics for a specific index on a table. Returns information about + the index type, distance type (for vector indices), and row counts. + operationId: DescribeTableIndexStats + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: Name of the index to get stats for + explode: false + in: path + name: index_name + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTableIndexStatsRequest' + description: Index stats request + required: true + responses: + "200": + $ref: '#/components/responses/DescribeTableIndexStatsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Get table index statistics + tags: + - Table + - Index + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/index/{index_name}/drop: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: Name of the index to drop + explode: false + in: path + name: index_name + required: true + schema: + type: string + style: simple + post: + description: | + Drop the specified index from table `id`. + + REST NAMESPACE ONLY + REST namespace does not use a request body for this operation. + The `DropTableIndexRequest` information is passed in the following way: + - `id`: pass through path parameter of the same name + - `index_name`: pass through path parameter of the same name + operationId: DropTableIndex + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - description: Name of the index to drop + explode: false + in: path + name: index_name + required: true + schema: + type: string + style: simple + responses: + "200": + $ref: '#/components/responses/DropTableIndexResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Drop a specific index + tags: + - Table + - Index + - Metadata + x-accepts: + - application/json + /v1/table/{id}/tags/list: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + post: + description: | + List all tags that have been created for table `id`. + Returns a map of tag names to their corresponding version numbers and metadata. + + REST NAMESPACE ONLY + REST namespace does not use a request body for this operation. + The `ListTableTagsRequest` information is passed in the following way: + - `id`: pass through path parameter of the same name + - `page_token`: pass through query parameter of the same name + - `limit`: pass through query parameter of the same name + operationId: ListTableTags + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + - $ref: '#/components/parameters/page_token' + - $ref: '#/components/parameters/limit' + responses: + "200": + $ref: '#/components/responses/ListTableTagsResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: List all tags for a table + tags: + - Table + - Tag + - Metadata + x-accepts: + - application/json + /v1/table/{id}/tags/version: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Get the version number that a specific tag points to for table `id`. + operationId: GetTableTagVersion + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTableTagVersionRequest' + required: true + responses: + "200": + $ref: '#/components/responses/GetTableTagVersionResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Get version for a specific tag + tags: + - Table + - Tag + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/declare: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Declare a table with the given name without touching storage. + This is a metadata-only operation that records the table existence and sets up aspects like access control. + + For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory + to mark the table's existence without creating actual Lance data files. + operationId: DeclareTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeclareTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DeclareTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Declare a table + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/create-empty: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + deprecated: true + description: | + Create an empty table with the given name without touching storage. + This is a metadata-only operation that records the table existence and sets up aspects like access control. + + For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory + to mark the table's existence without creating actual Lance data files. + + **Deprecated**: Use `DeclareTable` instead. + operationId: CreateEmptyTable + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEmptyTableRequest' + required: true + responses: + "200": + $ref: '#/components/responses/CreateEmptyTableResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create an empty table + tags: + - Table + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/tags/create: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Create a new tag for table `id` that points to a specific version. + operationId: CreateTableTag + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableTagRequest' + required: true + responses: + "200": + $ref: '#/components/responses/CreateTableTagResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Create a new tag + tags: + - Table + - Tag + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/tags/delete: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Delete an existing tag from table `id`. + operationId: DeleteTableTag + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteTableTagRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DeleteTableTagResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Delete a tag + tags: + - Table + - Tag + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/table/{id}/tags/update: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Update an existing tag for table `id` to point to a different version. + operationId: UpdateTableTag + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTableTagRequest' + required: true + responses: + "200": + $ref: '#/components/responses/UpdateTableTagResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Update a tag to point to a different version + tags: + - Table + - Tag + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/transaction/{id}/describe: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Return a detailed information for a given transaction + operationId: DescribeTransaction + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTransactionRequest' + required: true + responses: + "200": + $ref: '#/components/responses/DescribeTransactionResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Describe information about a transaction + tags: + - Transaction + - Metadata + x-content-type: application/json + x-accepts: + - application/json + /v1/transaction/{id}/alter: + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + post: + description: | + Alter a transaction with a list of actions such as setting status or properties. + The server should either succeed and apply all actions, or fail and apply no action. + operationId: AlterTransaction + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/delimiter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTransactionRequest' + required: true + responses: + "200": + $ref: '#/components/responses/AlterTransactionResponse' + "400": + $ref: '#/components/responses/BadRequestErrorResponse' + "401": + $ref: '#/components/responses/UnauthorizedErrorResponse' + "403": + $ref: '#/components/responses/ForbiddenErrorResponse' + "404": + $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' + "503": + $ref: '#/components/responses/ServiceUnavailableErrorResponse' + "5XX": + $ref: '#/components/responses/ServerErrorResponse' + summary: Alter information of a transaction. + tags: + - Transaction + - Metadata + x-content-type: application/json + x-accepts: + - application/json +components: + examples: + ListNamespacesEmptyExample: + summary: An empty list of namespaces + value: + namespaces: [] + ListNamespacesNonEmptyExample: + summary: A non-empty list of namespaces + value: + namespaces: + - accounting + - credits + parameters: + id: + description: | + `string identifier` of an object in a namespace, following the Lance Namespace spec. + When the value is equal to the delimiter, it represents the root namespace. + For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + delimiter: + description: | + An optional delimiter of the `string identifier`, following the Lance Namespace spec. + When not specified, the `$` delimiter must be used. + explode: true + in: query + name: delimiter + required: false + schema: + type: string + style: form + page_token: + description: Pagination token from a previous request + explode: true + in: query + name: page_token + required: false + schema: + $ref: '#/components/schemas/PageToken' + style: form + limit: + description: Maximum number of items to return + explode: true + in: query + name: limit + required: false + schema: + $ref: '#/components/schemas/PageLimit' + style: form + with_table_uri: + description: Whether to include the table URI in the response + explode: true + in: query + name: with_table_uri + required: false + schema: + default: false + type: boolean + style: form + load_detailed_metadata: + description: | + Whether to load detailed metadata that requires opening the dataset. + When false (default), only `location` is required in the response. + When true, the response includes additional metadata such as `version`, `schema`, and `stats`. + explode: true + in: query + name: load_detailed_metadata + required: false + schema: + default: false + type: boolean + style: form + responses: + ListNamespacesResponse: + content: + application/json: + examples: + NonEmptyResponse: + $ref: '#/components/examples/ListNamespacesNonEmptyExample' + EmptyResponse: + $ref: '#/components/examples/ListNamespacesEmptyExample' + schema: + $ref: '#/components/schemas/ListNamespacesResponse' + description: A list of namespaces + DescribeNamespaceResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeNamespaceResponse' + description: "Returns a namespace, as well as any properties stored on the namespace\ + \ if namespace properties are supported by the server." + CreateNamespaceResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateNamespaceResponse' + description: Result of creating a namespace + DropNamespaceResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DropNamespaceResponse' + description: Result of dropping a namespace + ListTablesResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/ListTablesResponse' + description: A list of tables + DescribeTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTableResponse' + description: Table properties result when loading a table + CountTableRowsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CountTableRowsResponse' + description: Result of counting rows in a table + CreateTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableResponse' + description: Table properties result when creating a table + InsertIntoTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/InsertIntoTableResponse' + description: Result of inserting records into a table + MergeInsertIntoTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/MergeInsertIntoTableResponse' + description: Result of merge insert operation + RegisterTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterTableResponse' + description: Table properties result when registering a table + DescribeTransactionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTransactionResponse' + description: Response of DescribeTransaction + AlterTransactionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTransactionResponse' + description: Response of AlterTransaction + DropTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DropTableResponse' + description: Response of DropTable + DeregisterTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DeregisterTableResponse' + description: Response of DeregisterTable + UpdateTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTableResponse' + description: Update successful + DeleteFromTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteFromTableResponse' + description: Delete successful + QueryTableResponse: + content: + application/vnd.apache.arrow.file: + schema: + format: binary + type: string + description: Query results in Arrow IPC file format + CreateTableIndexResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableIndexResponse' + description: Index created successfully + CreateTableScalarIndexResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableScalarIndexResponse' + description: Scalar index created successfully + ListTableIndicesResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/ListTableIndicesResponse' + description: List of indices on the table + DescribeTableIndexStatsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTableIndexStatsResponse' + description: Index statistics + ListTableTagsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/ListTableTagsResponse' + description: List of table tags + GetTableTagVersionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTableTagVersionResponse' + description: Tag version information + CreateTableTagResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableTagResponse' + description: Create tag response + DeleteTableTagResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteTableTagResponse' + description: Delete tag response + UpdateTableTagResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTableTagResponse' + description: Update tag response + ListTableVersionsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/ListTableVersionsResponse' + description: List of table versions + CreateTableVersionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableVersionResponse' + description: Result of creating a table version + DescribeTableVersionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeTableVersionResponse' + description: Table version information + BatchDeleteTableVersionsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchDeleteTableVersionsResponse' + description: Result of deleting table version records + BatchCreateTableVersionsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchCreateTableVersionsResponse' + description: Result of atomically creating table versions + ExplainTableQueryPlanResponse: + content: + application/json: + schema: + description: Human-readable query execution plan + type: string + description: Query execution plan explanation + AnalyzeTableQueryPlanResponse: + content: + application/json: + schema: + description: Human-readable query execution plan analysis + type: string + description: Query execution plan analysis + AlterTableAddColumnsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTableAddColumnsResponse' + description: Add columns operation result + AlterTableAlterColumnsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTableAlterColumnsResponse' + description: Alter columns operation result + AlterTableDropColumnsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/AlterTableDropColumnsResponse' + description: Drop columns operation result + GetTableStatsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTableStatsResponse' + description: Table statistics + RestoreTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/RestoreTableResponse' + description: Table restore operation result + RenameTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/RenameTableResponse' + description: Table rename operation result + DropTableIndexResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DropTableIndexResponse' + description: Index drop operation result + DeclareTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/DeclareTableResponse' + description: Table properties result when declaring a table + CreateEmptyTableResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEmptyTableResponse' + description: Table properties result when creating an empty table + BadRequestErrorResponse: + content: + application/json: + example: + type: /errors/bad-request + title: Malformed request + status: 400 + detail: "" + instance: /v1/namespaces + schema: + $ref: '#/components/schemas/ErrorResponse' + description: "Indicates a bad request error. It could be caused by an unexpected\ + \ request body format or other forms of request validation failure, such as\ + \ invalid json. Usually serves application/json content, although in some\ + \ cases simple text/plain content might be returned by the server's middleware." + UnauthorizedErrorResponse: + content: + application/json: + example: + type: /errors/unauthorized-request + title: No valid authentication credentials for the operation + status: 401 + detail: "" + instance: /v1/namespaces + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Unauthorized. The request lacks valid authentication credentials + for the operation. + ForbiddenErrorResponse: + content: + application/json: + example: + type: /errors/forbidden-request + title: Not authorized to make this request + status: 403 + detail: "" + instance: /v1/namespaces + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Forbidden. Authenticated user does not have the necessary permissions. + NotFoundErrorResponse: + content: + application/json: + example: + type: /errors/not-found-error + title: Not found Error + status: 404 + detail: "" + instance: "/v1/namespaces/{ns}" + schema: + $ref: '#/components/schemas/ErrorResponse' + description: A server-side problem that means can not find the specified resource. + UnsupportedOperationErrorResponse: + content: + application/json: + example: + type: /errors/unsupported-operation + title: The server does not support this operation + status: 406 + detail: "" + instance: /v1/namespaces + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Not Acceptable / Unsupported Operation. The server does not support + this operation. + ConflictErrorResponse: + content: + application/json: + example: + type: /errors/conflict + title: The namespace has been concurrently modified + status: 409 + detail: "" + instance: "/v1/namespaces/{ns}" + schema: + $ref: '#/components/schemas/ErrorResponse' + description: The request conflicts with the current state of the target resource. + ServiceUnavailableErrorResponse: + content: + application/json: + example: + type: /errors/service-unavailable + title: Slow down + status: 503 + detail: "" + instance: /v1/namespaces + schema: + $ref: '#/components/schemas/ErrorResponse' + description: The service is not ready to handle the request. The client should + wait and retry. The service may additionally send a Retry-After header to + indicate when to retry. + ServerErrorResponse: + content: + application/json: + example: + type: /errors/server-error + title: Internal Server Error + status: 500 + detail: "" + instance: /v1/namespaces + schema: + $ref: '#/components/schemas/ErrorResponse' + description: A server-side problem that might not be addressable from the client + side. Used for server 5xx errors without more specific documentation in individual + routes. + schemas: + ErrorResponse: + description: Common JSON error response model + example: + code: 4 + instance: /v1/table/production$users/describe + detail: The table may have been dropped or renamed + error: Table 'users' not found in namespace 'production' + properties: + error: + description: "A brief, human-readable message about the error." + example: Table 'users' not found in namespace 'production' + type: string + code: + description: | + Lance Namespace error code identifying the error type. + + Error codes: + 0 - Unsupported: Operation not supported by this backend + 1 - NamespaceNotFound: The specified namespace does not exist + 2 - NamespaceAlreadyExists: A namespace with this name already exists + 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces + 4 - TableNotFound: The specified table does not exist + 5 - TableAlreadyExists: A table with this name already exists + 6 - TableIndexNotFound: The specified table index does not exist + 7 - TableIndexAlreadyExists: A table index with this name already exists + 8 - TableTagNotFound: The specified table tag does not exist + 9 - TableTagAlreadyExists: A table tag with this name already exists + 10 - TransactionNotFound: The specified transaction does not exist + 11 - TableVersionNotFound: The specified table version does not exist + 12 - TableColumnNotFound: The specified table column does not exist + 13 - InvalidInput: Malformed request or invalid parameters + 14 - ConcurrentModification: Optimistic concurrency conflict + 15 - PermissionDenied: User lacks permission for this operation + 16 - Unauthenticated: Authentication credentials are missing or invalid + 17 - ServiceUnavailable: Service is temporarily unavailable + 18 - Internal: Unexpected server/implementation error + 19 - InvalidTableState: Table is in an invalid state for the operation + 20 - TableSchemaValidationError: Table schema validation failed + example: 4 + minimum: 0 + type: integer + detail: + description: | + An optional human-readable explanation of the error. + This can be used to record additional information such as stack trace. + example: The table may have been dropped or renamed + type: string + instance: + description: | + A string that identifies the specific occurrence of the error. + This can be a URI, a request or response ID, + or anything that the implementation can recognize to trace specific occurrence of the error. + example: /v1/table/production$users/describe + type: string + required: + - code + Identity: + description: | + Identity information of a request. + example: + api_key: api_key + auth_token: auth_token + properties: + api_key: + description: | + API key for authentication. + + REST NAMESPACE ONLY + This is passed via the `x-api-key` header. + type: string + auth_token: + description: | + Bearer token for authentication. + + REST NAMESPACE ONLY + This is passed via the `Authorization` header + with the Bearer scheme (e.g., `Bearer `). + type: string + Context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + CreateNamespaceRequest: + example: + mode: mode + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + key: properties + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + mode: + description: | + There are three modes when trying to create a namespace, + to differentiate the behavior when a namespace of the same name already exists. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + * Create: the operation fails with 409. + * ExistOk: the operation succeeds and the existing namespace is kept. + * Overwrite: the existing namespace is dropped and a new empty namespace with this name is created. + type: string + properties: + additionalProperties: + type: string + description: | + Properties stored on the namespace, if supported by the implementation. + CreateNamespaceResponse: + example: + transaction_id: transaction_id + properties: + key: properties + properties: + transaction_id: + description: Optional transaction identifier + type: string + properties: + additionalProperties: + type: string + description: | + Properties after the namespace is created. + + If the server does not support namespace properties, it should return null for this field. + If namespace properties are supported, but none are set, it should return an empty object. + ListNamespacesRequest: + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + limit: + description: | + An inclusive upper bound of the + number of results that a caller will receive. + type: integer + nullable: true + ListNamespacesResponse: + example: + page_token: page_token + namespaces: + - namespaces + - namespaces + properties: + namespaces: + description: | + The list of names of the child namespaces relative to the parent namespace `id` in the request. + items: + type: string + type: array + uniqueItems: true + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + required: + - namespaces + DescribeNamespaceRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + DescribeNamespaceResponse: + example: + properties: + owner: Ralph + created_at: "1452120468" + properties: + properties: + additionalProperties: + type: string + default: {} + description: "Properties stored on the namespace, if supported by the server.\ + \ If the server does not support namespace properties, it should return\ + \ null for this field. If namespace properties are supported, but none\ + \ are set, it should return an empty object." + example: + owner: Ralph + created_at: "1452120468" + nullable: true + DropNamespaceRequest: + example: + mode: mode + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + behavior: behavior + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + mode: + description: | + The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Fail (default): the server must return 400 indicating the namespace to drop does not exist. + - Skip: the server must return 204 indicating the drop operation has succeeded. + type: string + behavior: + description: | + The behavior for dropping a namespace. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Restrict (default): the namespace should not contain any table or child namespace when drop is initiated. + If tables are found, the server should return error and not drop the namespace. + - Cascade: all tables and child namespaces in the namespace are dropped before the namespace is dropped. + type: string + DropNamespaceResponse: + example: + transaction_id: + - transaction_id + - transaction_id + properties: + key: properties + properties: + properties: + additionalProperties: + type: string + description: | + If the implementation does not support namespace properties, it should return null for this field. Otherwise it should return the properties. + transaction_id: + description: | + If present, indicating the operation is long running and should be tracked using DescribeTransaction + items: + type: string + type: array + NamespaceExistsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + PageToken: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + PageLimit: + description: | + An inclusive upper bound of the + number of results that a caller will receive. + type: integer + nullable: true + RegisterTableRequest: + example: + mode: mode + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + location: location + id: + - id + - id + properties: + key: properties + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + location: + type: string + mode: + description: | + There are two modes when trying to register a table, + to differentiate the behavior when a table of the same name already exists. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + * Create (default): the operation fails with 409. + * Overwrite: the existing table registration is replaced with the new registration. + type: string + properties: + additionalProperties: + type: string + description: | + Properties stored on the table, if supported by the implementation. + required: + - location + RegisterTableResponse: + example: + transaction_id: transaction_id + location: location + properties: + key: properties + properties: + transaction_id: + description: Optional transaction identifier + type: string + location: + type: string + properties: + additionalProperties: + type: string + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. + ListTablesRequest: + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + limit: + description: | + An inclusive upper bound of the + number of results that a caller will receive. + type: integer + nullable: true + ListTablesResponse: + example: + tables: + - tables + - tables + page_token: page_token + properties: + tables: + description: | + The list of names of all the tables under the connected namespace implementation. + This should recursively list all the tables in all child namespaces. + Each string in the list is the full identifier in string form. + items: + type: string + type: array + uniqueItems: true + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + required: + - tables + DescribeTableRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + version: 0 + with_table_uri: false + load_detailed_metadata: true + vend_credentials: true + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + version: + description: | + Version of the table to describe. + If not specified, server should resolve it to the latest version. + format: int64 + minimum: 0 + type: integer + with_table_uri: + default: false + description: | + Whether to include the table URI in the response. + Default is false. + type: boolean + load_detailed_metadata: + description: | + Whether to load detailed metadata that requires opening the dataset. + When true, the response must include all detailed metadata such as `version`, `schema`, and `stats` + which require reading the dataset. + When not set, the implementation can decide whether to return detailed metadata + and which parts of detailed metadata to return. + type: boolean + vend_credentials: + description: | + Whether to include vended credentials in the response `storage_options`. + When true, the implementation should provide vended credentials for accessing storage. + When not set, the implementation can decide whether to return vended credentials. + type: boolean + DescribeTableResponse: + example: + schema: + metadata: + key: metadata + fields: + - metadata: + key: metadata + nullable: true + name: name + type: + length: 0 + fields: + - null + - null + type: type + - metadata: + key: metadata + nullable: true + name: name + type: + length: 0 + fields: + - null + - null + type: type + metadata: + key: metadata + table_uri: table_uri + stats: + num_deleted_rows: 0 + num_fragments: 0 + namespace: + - namespace + - namespace + location: location + version: 0 + table: table + properties: + owner: Ralph + created_at: "1452120468" + managed_versioning: true + storage_options: + key: storage_options + properties: + table: + description: | + Table name. + Only populated when `load_detailed_metadata` is true. + type: string + namespace: + description: | + The namespace identifier as a list of parts. + Only populated when `load_detailed_metadata` is true. + items: + type: string + type: array + version: + description: | + Table version number. + Only populated when `load_detailed_metadata` is true. + format: int64 + minimum: 0 + type: integer + location: + description: | + Table storage location (e.g., S3/GCS path). + type: string + table_uri: + description: | + Table URI. Unlike location, this field must be a complete and valid URI. + Only returned when `with_table_uri` is true. + type: string + schema: + $ref: '#/components/schemas/JsonArrowSchema' + storage_options: + additionalProperties: + type: string + description: | + Configuration options to be used to access storage. The available + options depend on the type of storage in use. These will be + passed directly to Lance to initialize storage access. + When `vend_credentials` is true, this field may include vended credentials. + If the vended credentials are temporary, the `expires_at_millis` key should be + included to indicate the millisecond timestamp when the credentials expire. + stats: + $ref: '#/components/schemas/TableBasicStats' + metadata: + additionalProperties: + type: string + description: | + Optional table metadata as key-value pairs. This records the information of the table + and requires loading the table. + It is only populated when `load_detailed_metadata` is true. + properties: + additionalProperties: + type: string + default: {} + description: "Properties stored on the table, if supported by the server.\ + \ This records the information managed by the namespace. If the server\ + \ does not support table properties, it should return null for this field.\ + \ If table properties are supported, but none are set, it should return\ + \ an empty object." + example: + owner: Ralph + created_at: "1452120468" + nullable: true + managed_versioning: + description: | + When true, the caller should use namespace table version operations + (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) + to manage table versions instead of relying on Lance's native version management. + type: boolean + TableBasicStats: + example: + num_deleted_rows: 0 + num_fragments: 0 + properties: + num_deleted_rows: + description: Number of deleted rows in the table + minimum: 0 + type: integer + num_fragments: + description: Number of fragments in the table + minimum: 0 + type: integer + required: + - num_deleted_rows + - num_fragments + CountTableRowsRequest: + example: + predicate: predicate + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + version: + description: | + Version of the table to describe. + If not specified, server should resolve it to the latest version. + format: int64 + minimum: 0 + type: integer + predicate: + description: | + Optional SQL predicate to filter rows for counting + type: string + CountTableRowsResponse: + description: | + Response containing the count of rows. + Serializes transparently as just the number for backward compatibility. + format: int64 + minimum: 0 + type: integer + InsertIntoTableRequest: + description: | + Request for inserting records into a table, excluding the Arrow IPC stream. + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + mode: + default: append + description: | + How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Append (default): insert data to the existing table + - Overwrite: remove all data in the table and then insert data to it + type: string + InsertIntoTableResponse: + description: Response from inserting records into a table + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + MergeInsertIntoTableRequest: + description: | + Request for merging or inserting records into a table, excluding the Arrow IPC stream. + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + "on": + description: Column name to use for matching rows (required) + type: string + when_matched_update_all: + default: false + description: Update all columns when rows match + type: boolean + when_matched_update_all_filt: + description: The row is updated (similar to UpdateAll) only for rows where + the SQL expression evaluates to true + type: string + when_not_matched_insert_all: + default: false + description: Insert all columns when rows don't match + type: boolean + when_not_matched_by_source_delete: + default: false + description: Delete all rows from target table that don't match a row in + the source table + type: boolean + when_not_matched_by_source_delete_filt: + description: Delete rows from the target table if there is no match AND + the SQL expression evaluates to true + type: string + timeout: + description: "Timeout for the operation (e.g., \"30s\", \"5m\")" + type: string + use_index: + default: false + description: Whether to use index for matching rows + type: boolean + MergeInsertIntoTableResponse: + description: Response from merge insert operation + example: + transaction_id: transaction_id + num_inserted_rows: 0 + num_updated_rows: 0 + num_deleted_rows: 0 + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + num_updated_rows: + description: Number of rows updated + format: int64 + minimum: 0 + type: integer + num_inserted_rows: + description: Number of rows inserted + format: int64 + minimum: 0 + type: integer + num_deleted_rows: + description: Number of rows deleted (typically 0 for merge insert) + format: int64 + minimum: 0 + type: integer + version: + description: The commit version associated with the operation + format: int64 + minimum: 0 + type: integer + UpdateTableRequest: + description: | + Each update consists of a column name and an SQL expression that will be + evaluated against the current row's value. Optionally, a predicate can be + provided to filter which rows to update. + example: + predicate: predicate + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + updates: + - - updates + - updates + - - updates + - updates + properties: + key: properties + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + predicate: + description: Optional SQL predicate to filter rows for update + type: string + nullable: true + updates: + description: "List of column updates as [column_name, expression] pairs" + items: + items: + type: string + maxItems: 2 + minItems: 2 + type: array + type: array + properties: + additionalProperties: + type: string + description: | + Properties stored on the table, if supported by the implementation. + required: + - updates + UpdateTableResponse: + example: + transaction_id: transaction_id + updated_rows: 0 + version: 0 + properties: + key: properties + properties: + transaction_id: + description: Optional transaction identifier + type: string + updated_rows: + description: Number of rows updated + format: int64 + minimum: 0 + type: integer + version: + description: The commit version associated with the operation + format: int64 + minimum: 0 + type: integer + properties: + additionalProperties: + type: string + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. + required: + - updated_rows + - version + DeleteFromTableRequest: + description: | + Delete data from table based on a SQL predicate. + Returns the number of rows that were deleted. + example: + predicate: predicate + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The namespace identifier + items: + type: string + type: array + predicate: + description: SQL predicate to filter rows for deletion + type: string + required: + - predicate + DeleteFromTableResponse: + example: + transaction_id: transaction_id + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + version: + description: The commit version associated with the operation + format: int64 + minimum: 0 + type: integer + QueryTableRequest: + example: + ef: 0 + offset: 0 + columns: + column_aliases: + key: column_aliases + column_names: + - column_names + - column_names + vector_column: vector_column + fast_search: true + k: 0 + upper_bound: 1.2315135 + version: 0 + with_row_id: true + prefilter: true + filter: filter + refine_factor: 0 + full_text_query: + string_query: + columns: + - columns + - columns + query: query + structured_query: + query: + boolean: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + phrase: + terms: terms + column: column + slop: 0 + match: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + boost: + negative: null + negative_boost: 7.0614014 + positive: null + multi_match: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + distance_type: distance_type + lower_bound: 3.6160767 + identity: + api_key: api_key + auth_token: auth_token + bypass_vector_index: true + nprobes: 0 + context: + key: context + vector: + single_vector: + - 1.0246457 + - 1.0246457 + multi_vector: + - - 1.4894159 + - 1.4894159 + - - 1.4894159 + - 1.4894159 + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + bypass_vector_index: + description: Whether to bypass vector index + type: boolean + columns: + $ref: '#/components/schemas/QueryTableRequest_columns' + distance_type: + description: Distance metric to use + type: string + ef: + description: Search effort parameter for HNSW index + minimum: 0 + type: integer + fast_search: + description: Whether to use fast search + type: boolean + filter: + description: Optional SQL filter expression + type: string + full_text_query: + $ref: '#/components/schemas/QueryTableRequest_full_text_query' + k: + description: Number of results to return + minimum: 0 + type: integer + lower_bound: + description: Lower bound for search + format: float + type: number + nprobes: + description: Number of probes for IVF index + minimum: 0 + type: integer + offset: + description: Number of results to skip + minimum: 0 + type: integer + prefilter: + description: Whether to apply filtering before vector search + type: boolean + refine_factor: + description: Refine factor for search + format: int32 + minimum: 0 + type: integer + upper_bound: + description: Upper bound for search + format: float + type: number + vector: + $ref: '#/components/schemas/QueryTableRequest_vector' + vector_column: + description: Name of the vector column to search + type: string + version: + description: Table version to query + format: int64 + minimum: 0 + type: integer + with_row_id: + description: "If true, return the row id as a column called `_rowid`" + type: boolean + required: + - k + - vector + CreateTableIndexRequest: + example: + base_tokenizer: base_tokenizer + column: column + max_token_length: 0 + language: language + index_type: index_type + with_position: true + lower_case: true + distance_type: distance_type + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + name: name + ascii_folding: true + id: + - id + - id + remove_stop_words: true + stem: true + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + column: + description: Name of the column to create index on + type: string + index_type: + description: "Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST,\ + \ IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS)" + type: string + name: + description: "Optional name for the index. If not provided, a name will\ + \ be auto-generated." + type: string + nullable: true + distance_type: + description: "Distance metric type for vector indexes (e.g., l2, cosine,\ + \ dot)" + type: string + with_position: + description: Optional FTS parameter for position tracking + type: boolean + nullable: true + base_tokenizer: + description: Optional FTS parameter for base tokenizer + type: string + nullable: true + language: + description: Optional FTS parameter for language + type: string + nullable: true + max_token_length: + description: Optional FTS parameter for maximum token length + minimum: 0 + type: integer + nullable: true + lower_case: + description: Optional FTS parameter for lowercase conversion + type: boolean + nullable: true + stem: + description: Optional FTS parameter for stemming + type: boolean + nullable: true + remove_stop_words: + description: Optional FTS parameter for stop word removal + type: boolean + nullable: true + ascii_folding: + description: Optional FTS parameter for ASCII folding + type: boolean + nullable: true + required: + - column + - index_type + CreateTableIndexResponse: + description: Response for create index operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + CreateTableScalarIndexResponse: + description: Response for create scalar index operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + ListTableIndicesRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + page_token: page_token + limit: 6 + id: + - id + - id + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The namespace identifier + items: + type: string + type: array + version: + description: Optional table version to list indexes from + format: int64 + minimum: 0 + type: integer + nullable: true + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + limit: + description: | + An inclusive upper bound of the + number of results that a caller will receive. + type: integer + nullable: true + ListTableIndicesResponse: + example: + indexes: + - index_uuid: index_uuid + columns: + - columns + - columns + index_name: index_name + status: status + - index_uuid: index_uuid + columns: + - columns + - columns + index_name: index_name + status: status + page_token: page_token + properties: + indexes: + description: List of indexes on the table + items: + $ref: '#/components/schemas/IndexContent' + type: array + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + required: + - indexes + IndexContent: + example: + index_uuid: index_uuid + columns: + - columns + - columns + index_name: index_name + status: status + properties: + index_name: + description: Name of the index + type: string + index_uuid: + description: Unique identifier for the index + type: string + columns: + description: Columns covered by this index + items: + type: string + type: array + status: + description: Current status of the index + type: string + required: + - columns + - index_name + - index_uuid + - status + DescribeTableIndexStatsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + version: 0 + index_name: index_name + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + version: + description: Optional table version to get stats for + format: int64 + minimum: 0 + type: integer + nullable: true + index_name: + description: Name of the index + type: string + DescribeTableIndexStatsResponse: + example: + num_indices: 0 + distance_type: distance_type + num_unindexed_rows: 0 + num_indexed_rows: 0 + index_type: index_type + properties: + distance_type: + description: Distance type for vector indexes + type: string + nullable: true + index_type: + description: Type of the index + type: string + nullable: true + num_indexed_rows: + description: Number of indexed rows + format: int64 + minimum: 0 + type: integer + nullable: true + num_unindexed_rows: + description: Number of unindexed rows + format: int64 + minimum: 0 + type: integer + nullable: true + num_indices: + description: Number of indices + format: int32 + minimum: 0 + type: integer + nullable: true + JsonArrowSchema: + description: | + JSON representation of a Apache Arrow schema. + example: + metadata: + key: metadata + fields: + - metadata: + key: metadata + nullable: true + name: name + type: + length: 0 + fields: + - null + - null + type: type + - metadata: + key: metadata + nullable: true + name: name + type: + length: 0 + fields: + - null + - null + type: type + properties: + fields: + items: + $ref: '#/components/schemas/JsonArrowField' + type: array + metadata: + additionalProperties: + type: string + required: + - fields + JsonArrowField: + description: | + JSON representation of an Apache Arrow field. + example: + metadata: + key: metadata + nullable: true + name: name + type: + length: 0 + fields: + - null + - null + type: type + properties: + metadata: + additionalProperties: + type: string + name: + type: string + nullable: + type: boolean + type: + $ref: '#/components/schemas/JsonArrowDataType' + required: + - name + - nullable + - type + JsonArrowDataType: + description: JSON representation of an Apache Arrow DataType + example: + length: 0 + fields: + - null + - null + type: type + properties: + fields: + description: "Fields for complex types like Struct, Union, etc." + items: + $ref: '#/components/schemas/JsonArrowField' + type: array + length: + description: Length for fixed-size types + format: int64 + minimum: 0 + type: integer + type: + description: The data type name + type: string + required: + - type + Binary: + format: binary + type: string + CreateTableRequest: + description: | + Request for creating a table, excluding the Arrow IPC stream. + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + mode: + description: | + There are three modes when trying to create a table, + to differentiate the behavior when a table of the same name already exists. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + * Create: the operation fails with 409. + * ExistOk: the operation succeeds and the existing table is kept. + * Overwrite: the existing table is dropped and a new table with this name is created. + type: string + properties: + additionalProperties: + type: string + description: | + Properties stored on the table, if supported by the implementation. + CreateTableResponse: + example: + transaction_id: transaction_id + location: location + version: 0 + properties: + owner: Ralph + created_at: "1452120468" + storage_options: + key: storage_options + properties: + transaction_id: + description: Optional transaction identifier + type: string + location: + type: string + version: + format: int64 + minimum: 0 + type: integer + storage_options: + additionalProperties: + type: string + description: | + Configuration options to be used to access storage. The available + options depend on the type of storage in use. These will be + passed directly to Lance to initialize storage access. + properties: + additionalProperties: + type: string + default: {} + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + example: + owner: Ralph + created_at: "1452120468" + nullable: true + CreateEmptyTableRequest: + deprecated: true + description: | + Request for creating an empty table. + + **Deprecated**: Use `DeclareTableRequest` instead. + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + location: location + id: + - id + - id + properties: + key: properties + vend_credentials: true + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + location: + description: | + Optional storage location for the table. + If not provided, the namespace implementation should determine the table location. + type: string + vend_credentials: + description: | + Whether to include vended credentials in the response `storage_options`. + When true, the implementation should provide vended credentials for accessing storage. + When not set, the implementation can decide whether to return vended credentials. + type: boolean + properties: + additionalProperties: + type: string + description: | + Properties stored on the table, if supported by the server. + CreateEmptyTableResponse: + deprecated: true + description: | + Response for creating an empty table. + + **Deprecated**: Use `DeclareTableResponse` instead. + example: + transaction_id: transaction_id + location: location + properties: + owner: Ralph + created_at: "1452120468" + storage_options: + key: storage_options + properties: + transaction_id: + description: Optional transaction identifier + type: string + location: + type: string + storage_options: + additionalProperties: + type: string + description: | + Configuration options to be used to access storage. The available + options depend on the type of storage in use. These will be + passed directly to Lance to initialize storage access. + properties: + additionalProperties: + type: string + default: {} + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + example: + owner: Ralph + created_at: "1452120468" + nullable: true + DeclareTableRequest: + description: | + Request for declaring a table. + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + location: location + id: + - id + - id + properties: + key: properties + vend_credentials: true + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + location: + description: | + Optional storage location for the table. + If not provided, the namespace implementation should determine the table location. + type: string + vend_credentials: + description: | + Whether to include vended credentials in the response `storage_options`. + When true, the implementation should provide vended credentials for accessing storage. + When not set, the implementation can decide whether to return vended credentials. + type: boolean + properties: + additionalProperties: + type: string + description: | + Properties stored on the table, if supported by the server. + DeclareTableResponse: + description: | + Response for declaring a table. + example: + transaction_id: transaction_id + location: location + properties: + owner: Ralph + created_at: "1452120468" + managed_versioning: true + storage_options: + key: storage_options + properties: + transaction_id: + description: Optional transaction identifier + type: string + location: + type: string + storage_options: + additionalProperties: + type: string + description: | + Configuration options to be used to access storage. The available + options depend on the type of storage in use. These will be + passed directly to Lance to initialize storage access. + properties: + additionalProperties: + type: string + default: {} + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + example: + owner: Ralph + created_at: "1452120468" + nullable: true + managed_versioning: + description: | + When true, the caller should use namespace table version operations + (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) + to manage table versions instead of relying on Lance's native version management. + type: boolean + TableExistsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + version: + description: | + Version of the table to check existence. + If not specified, server should resolve it to the latest version. + format: int64 + minimum: 0 + type: integer + TransactionStatus: + description: | + The status of a transaction. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Queued: the transaction is queued and not yet started + - Running: the transaction is currently running + - Succeeded: the transaction has completed successfully + - Failed: the transaction has failed + - Canceled: the transaction was canceled + type: string + DescribeTransactionRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + DescribeTransactionResponse: + example: + properties: + key: properties + status: status + properties: + status: + description: | + The status of a transaction. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Queued: the transaction is queued and not yet started + - Running: the transaction is currently running + - Succeeded: the transaction has completed successfully + - Failed: the transaction has failed + - Canceled: the transaction was canceled + type: string + properties: + additionalProperties: + type: string + required: + - status + AlterTransactionSetStatus: + example: + status: status + properties: + status: + description: | + The status of a transaction. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Queued: the transaction is queued and not yet started + - Running: the transaction is currently running + - Succeeded: the transaction has completed successfully + - Failed: the transaction has failed + - Canceled: the transaction was canceled + type: string + AlterTransactionSetProperty: + example: + mode: mode + value: value + key: key + properties: + key: + type: string + value: + type: string + mode: + description: | + The behavior if the property key already exists. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Overwrite (default): overwrite the existing value with the provided value + - Fail: fail the entire operation + - Skip: keep the existing value and skip setting the provided value + type: string + SetPropertyMode: + description: | + The behavior if the property key already exists. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Overwrite (default): overwrite the existing value with the provided value + - Fail: fail the entire operation + - Skip: keep the existing value and skip setting the provided value + type: string + AlterTransactionUnsetProperty: + example: + mode: mode + key: key + properties: + key: + type: string + mode: + description: | + The behavior if the property key to unset does not exist. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Skip (default): skip the property to unset + - Fail: fail the entire operation + type: string + UnsetPropertyMode: + description: | + The behavior if the property key to unset does not exist. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Skip (default): skip the property to unset + - Fail: fail the entire operation + type: string + AlterTransactionAction: + description: | + A single action that could be performed to alter a transaction. + This action holds the model definition for all types of specific actions models, + this is to minimize difference and compatibility issue across codegen in different languages. + When used, only one of the actions should be non-null for each action. + If you would like to perform multiple actions, set a list of actions in the AlterTransactionRequest. + example: + setStatusAction: + status: status + unsetPropertyAction: + mode: mode + key: key + setPropertyAction: + mode: mode + value: value + key: key + properties: + setStatusAction: + $ref: '#/components/schemas/AlterTransactionSetStatus' + setPropertyAction: + $ref: '#/components/schemas/AlterTransactionSetProperty' + unsetPropertyAction: + $ref: '#/components/schemas/AlterTransactionUnsetProperty' + AlterTransactionRequest: + description: | + Alter a transaction with a list of actions. + The server should either succeed and apply all actions, or fail and apply no action. + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + actions: + - setStatusAction: + status: status + unsetPropertyAction: + mode: mode + key: key + setPropertyAction: + mode: mode + value: value + key: key + - setStatusAction: + status: status + unsetPropertyAction: + mode: mode + key: key + setPropertyAction: + mode: mode + value: value + key: key + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + actions: + items: + $ref: '#/components/schemas/AlterTransactionAction' + minItems: 1 + type: array + required: + - actions + AlterTransactionResponse: + example: + properties: + key: properties + status: status + properties: + status: + description: | + The status of a transaction. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - Queued: the transaction is queued and not yet started + - Running: the transaction is currently running + - Succeeded: the transaction has completed successfully + - Failed: the transaction has failed + - Canceled: the transaction was canceled + type: string + properties: + additionalProperties: + type: string + required: + - status + DropTableRequest: + description: | + If the table and its data can be immediately deleted, return information of the deleted table. + Otherwise, return a transaction ID that client can use to track deletion progress. + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + DropTableResponse: + example: + transaction_id: transaction_id + location: location + id: + - id + - id + properties: + owner: Ralph + created_at: "1452120468" + properties: + transaction_id: + description: Optional transaction identifier + type: string + id: + items: + type: string + type: array + location: + type: string + properties: + additionalProperties: + type: string + default: {} + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + example: + owner: Ralph + created_at: "1452120468" + nullable: true + DeregisterTableRequest: + description: | + The table content remains available in the storage. + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + DeregisterTableResponse: + example: + transaction_id: transaction_id + location: location + id: + - id + - id + properties: + owner: Ralph + created_at: "1452120468" + properties: + transaction_id: + description: Optional transaction identifier + type: string + id: + items: + type: string + type: array + location: + type: string + properties: + additionalProperties: + type: string + default: {} + description: | + If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + example: + owner: Ralph + created_at: "1452120468" + nullable: true + StringFtsQuery: + example: + columns: + - columns + - columns + query: query + properties: + columns: + items: + type: string + type: array + query: + type: string + required: + - query + StructuredFtsQuery: + example: + query: + boolean: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + phrase: + terms: terms + column: column + slop: 0 + match: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + boost: + negative: null + negative_boost: 7.0614014 + positive: null + multi_match: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + properties: + query: + $ref: '#/components/schemas/FtsQuery' + required: + - query + FtsQuery: + description: | + Full-text search query. Exactly one query type field must be provided. + This structure follows the same pattern as AlterTransactionAction to minimize + differences and compatibility issues across codegen in different languages. + example: + boolean: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + phrase: + terms: terms + column: column + slop: 0 + match: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + boost: + negative: null + negative_boost: 7.0614014 + positive: null + multi_match: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + properties: + match: + $ref: '#/components/schemas/MatchQuery' + phrase: + $ref: '#/components/schemas/PhraseQuery' + boost: + $ref: '#/components/schemas/BoostQuery' + multi_match: + $ref: '#/components/schemas/MultiMatchQuery' + boolean: + $ref: '#/components/schemas/BooleanQuery' + MatchQuery: + example: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + properties: + boost: + format: float + type: number + column: + type: string + fuzziness: + format: int32 + minimum: 0 + type: integer + max_expansions: + description: |- + The maximum number of terms to expand for fuzzy matching. + Default to 50. + minimum: 0 + type: integer + operator: + description: | + The operator to use for combining terms. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - And: All terms must match. + - Or: At least one term must match. + type: string + prefix_length: + description: |- + The number of beginning characters being unchanged for fuzzy matching. + Default to 0. + format: int32 + minimum: 0 + type: integer + terms: + type: string + required: + - terms + PhraseQuery: + example: + terms: terms + column: column + slop: 0 + properties: + column: + type: string + slop: + format: int32 + minimum: 0 + type: integer + terms: + type: string + required: + - terms + BoostQuery: + description: Boost query that scores documents matching positive query higher + and negative query lower + example: + negative: null + negative_boost: 7.0614014 + positive: null + properties: + positive: + $ref: '#/components/schemas/FtsQuery' + negative: + $ref: '#/components/schemas/FtsQuery' + negative_boost: + default: 0.5 + description: "Boost factor for negative query (default: 0.5)" + format: float + type: number + required: + - negative + - positive + MultiMatchQuery: + example: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + properties: + match_queries: + items: + $ref: '#/components/schemas/MatchQuery' + type: array + required: + - match_queries + BooleanQuery: + description: "Boolean query with must, should, and must_not clauses" + example: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + properties: + must: + description: Queries that must match (AND) + items: + $ref: '#/components/schemas/FtsQuery' + type: array + must_not: + description: Queries that must not match (NOT) + items: + $ref: '#/components/schemas/FtsQuery' + type: array + should: + description: Queries that should match (OR) + items: + $ref: '#/components/schemas/FtsQuery' + type: array + required: + - must + - must_not + - should + Operator: + description: | + The operator to use for combining terms. + Case insensitive, supports both PascalCase and snake_case. Valid values are: + - And: All terms must match. + - Or: At least one term must match. + type: string + GetTableTagVersionRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + tag: tag + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + tag: + description: Name of the tag to get version for + type: string + required: + - tag + GetTableTagVersionResponse: + example: + version: 0 + properties: + version: + description: version number that the tag points to + format: int64 + minimum: 0 + type: integer + required: + - version + CreateTableTagRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + tag: tag + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + tag: + description: Name of the tag to create + type: string + version: + description: Version number for the tag to point to + format: int64 + minimum: 0 + type: integer + required: + - tag + - version + CreateTableTagResponse: + description: Response for create tag operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + DeleteTableTagRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + tag: tag + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + tag: + description: Name of the tag to delete + type: string + required: + - tag + DeleteTableTagResponse: + description: Response for delete tag operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + UpdateTableTagRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + tag: tag + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + tag: + description: Name of the tag to update + type: string + version: + description: New version number for the tag to point to + format: int64 + minimum: 0 + type: integer + required: + - tag + - version + UpdateTableTagResponse: + description: Response for update tag operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + ListTableTagsRequest: + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The table identifier + items: + type: string + type: array + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + limit: + description: | + An inclusive upper bound of the + number of results that a caller will receive. + type: integer + nullable: true + ListTableTagsResponse: + description: Response containing table tags + example: + page_token: page_token + tags: + key: + branch: branch + version: 0 + manifestSize: 0 + properties: + tags: + additionalProperties: + $ref: '#/components/schemas/TagContents' + description: Map of tag names to their contents + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + required: + - tags + TagContents: + example: + branch: branch + version: 0 + manifestSize: 0 + properties: + branch: + description: Branch name that the tag was created on (if any) + type: string + version: + description: Version number that the tag points to + format: int64 + minimum: 0 + type: integer + manifestSize: + description: Size of the manifest file in bytes + format: int64 + minimum: 0 + type: integer + required: + - manifestSize + - version + RestoreTableRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + version: + description: Version to restore to + format: int64 + minimum: 0 + type: integer + required: + - version + RestoreTableResponse: + description: Response for restore table operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + RenameTableRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + new_table_name: new_table_name + id: + - id + - id + new_namespace_id: + - new_namespace_id + - new_namespace_id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The table identifier + items: + type: string + type: array + new_table_name: + description: New name for the table + type: string + new_namespace_id: + description: "New namespace identifier to move the table to (optional, if\ + \ not specified the table stays in the same namespace)" + items: + type: string + type: array + required: + - new_table_name + RenameTableResponse: + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + UpdateTableSchemaMetadataRequest: + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The table identifier + items: + type: string + type: array + metadata: + additionalProperties: + type: string + description: Schema metadata key-value pairs to set + UpdateTableSchemaMetadataResponse: + properties: + metadata: + additionalProperties: + type: string + description: The updated schema metadata + transaction_id: + description: Optional transaction identifier + type: string + ListTableVersionsRequest: + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + limit: + description: | + An inclusive upper bound of the + number of results that a caller will receive. + type: integer + nullable: true + descending: + description: | + When true, versions are guaranteed to be returned in descending order (latest to oldest). + When false or not specified, the ordering is implementation-defined. + type: boolean + ListTableVersionsResponse: + example: + versions: + - metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + - metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + page_token: page_token + properties: + versions: + description: | + List of table versions. When `descending=true`, guaranteed to be ordered from latest to oldest. + Otherwise, ordering is implementation-defined. + items: + $ref: '#/components/schemas/TableVersion' + type: array + page_token: + description: | + An opaque token that allows pagination for list operations (e.g. ListNamespaces). + + For an initial request of a list operation, + if the implementation cannot return all items in one response, + or if there are more items than the page limit specified in the request, + the implementation must return a page token in the response, + indicating there are more results available. + + After the initial request, + the value of the page token from each response must be used + as the page token value for the next request. + + Caller must interpret either `null`, + missing value or empty string value of the page token from + the implementation's response as the end of the listing results. + type: string + nullable: true + required: + - versions + CreateTableVersionRequest: + description: | + Request to create a new table version entry. + This supports `put_if_not_exists` semantics, + where the operation fails if the version already exists. + example: + naming_scheme: V2 + metadata: + key: metadata + manifest_path: manifest_path + identity: + api_key: api_key + auth_token: auth_token + manifest_size: 0 + context: + key: context + id: + - id + - id + e_tag: e_tag + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The table identifier + items: + type: string + type: array + version: + description: Version number to create + format: int64 + minimum: 0 + type: integer + manifest_path: + description: Path to the manifest file for this version + type: string + manifest_size: + description: Size of the manifest file in bytes + format: int64 + minimum: 0 + type: integer + e_tag: + description: Optional ETag for the manifest file + type: string + metadata: + additionalProperties: + type: string + description: Optional metadata for the version + naming_scheme: + description: | + The naming scheme used for manifest files in the `_versions/` directory. + + Known values: + - `V1`: `_versions/{version}.manifest` - Simple version-based naming + - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number + (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores + + V2 is preferred for new tables as it enables efficient latest-version discovery + without needing to list all versions. + example: V2 + type: string + required: + - manifest_path + - version + CreateTableVersionResponse: + description: Response for creating a table version + example: + transaction_id: transaction_id + version: + metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + version: + $ref: '#/components/schemas/TableVersion' + DescribeTableVersionRequest: + description: Request to describe a specific table version + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + version: 0 + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The table identifier + items: + type: string + type: array + version: + description: Version number to describe + format: int64 + minimum: 0 + type: integer + DescribeTableVersionResponse: + description: Response containing the table version information + example: + version: + metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + properties: + version: + $ref: '#/components/schemas/TableVersion' + required: + - version + BatchDeleteTableVersionsRequest: + description: | + Request to delete table version records. + Supports deleting ranges of versions for efficient bulk cleanup. + example: + ranges: + - start_version: 0 + end_version: 6 + - start_version: 0 + end_version: 6 + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + description: The table identifier + items: + type: string + type: array + ranges: + description: | + List of version ranges to delete. + Each range specifies start (inclusive) and end (exclusive) versions. + items: + $ref: '#/components/schemas/VersionRange' + type: array + required: + - ranges + VersionRange: + description: | + A range of versions to delete (start inclusive, end exclusive). + Special values: + - `start_version: 0` with `end_version: -1` means ALL versions + example: + start_version: 0 + end_version: 6 + properties: + start_version: + description: | + Start version of the range (inclusive). + Use 0 to start from the first version. + format: int64 + type: integer + end_version: + description: | + End version of the range (exclusive). + Use -1 to indicate all versions up to and including the latest. + format: int64 + type: integer + required: + - end_version + - start_version + BatchDeleteTableVersionsResponse: + description: Response for deleting table version records + example: + transaction_id: transaction_id + deleted_count: 0 + properties: + deleted_count: + description: Number of version records deleted + format: int64 + minimum: 0 + type: integer + transaction_id: + description: Optional transaction identifier + type: string + BatchCreateTableVersionsRequest: + description: | + Request to atomically create new version entries for multiple tables. + The operation is atomic: all versions are created or none are. + example: + entries: + - naming_scheme: V2 + metadata: + key: metadata + manifest_path: manifest_path + manifest_size: 0 + id: + - id + - id + e_tag: e_tag + version: 0 + - naming_scheme: V2 + metadata: + key: metadata + manifest_path: manifest_path + manifest_size: 0 + id: + - id + - id + e_tag: e_tag + version: 0 + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + entries: + description: List of table version entries to create atomically + items: + $ref: '#/components/schemas/CreateTableVersionEntry' + type: array + required: + - entries + CreateTableVersionEntry: + description: | + An entry for creating a new table version in a batch operation. + This supports `put_if_not_exists` semantics, + where the operation fails if the version already exists. + example: + naming_scheme: V2 + metadata: + key: metadata + manifest_path: manifest_path + manifest_size: 0 + id: + - id + - id + e_tag: e_tag + version: 0 + properties: + id: + description: The table identifier + items: + type: string + type: array + version: + description: Version number to create + format: int64 + minimum: 0 + type: integer + manifest_path: + description: Path to the manifest file for this version + type: string + manifest_size: + description: Size of the manifest file in bytes + format: int64 + minimum: 0 + type: integer + e_tag: + description: Optional ETag for the manifest file + type: string + metadata: + additionalProperties: + type: string + description: Optional metadata for the version + naming_scheme: + description: | + The naming scheme used for manifest files in the `_versions/` directory. + + Known values: + - `V1`: `_versions/{version}.manifest` - Simple version-based naming + - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number + (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores + + V2 is preferred for new tables as it enables efficient latest-version discovery + without needing to list all versions. + example: V2 + type: string + required: + - id + - manifest_path + - version + BatchCreateTableVersionsResponse: + description: | + Response for batch creating table versions. + Contains the created versions for each table in the same order as the request. + example: + transaction_id: transaction_id + versions: + - metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + - metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + versions: + description: List of created table versions in the same order as the request + entries + items: + $ref: '#/components/schemas/TableVersion' + type: array + required: + - versions + TableVersion: + example: + metadata: + key: metadata + manifest_path: manifest_path + timestamp_millis: 1 + manifest_size: 0 + e_tag: e_tag + version: 0 + properties: + version: + description: Version number + format: int64 + minimum: 0 + type: integer + manifest_path: + description: Path to the manifest file for this version. + type: string + manifest_size: + description: Size of the manifest file in bytes + format: int64 + minimum: 0 + type: integer + e_tag: + description: | + Optional ETag for optimistic concurrency control. + Useful for S3 and similar object stores. + type: string + timestamp_millis: + description: "Timestamp when the version was created, in milliseconds since\ + \ epoch (Unix time)" + format: int64 + type: integer + metadata: + additionalProperties: + type: string + description: Optional key-value pairs of metadata + required: + - manifest_path + - version + ManifestNamingScheme: + description: | + The naming scheme used for manifest files in the `_versions/` directory. + + Known values: + - `V1`: `_versions/{version}.manifest` - Simple version-based naming + - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number + (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores + + V2 is preferred for new tables as it enables efficient latest-version discovery + without needing to list all versions. + example: V2 + type: string + ExplainTableQueryPlanRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + query: + ef: 0 + offset: 0 + columns: + column_aliases: + key: column_aliases + column_names: + - column_names + - column_names + vector_column: vector_column + fast_search: true + k: 0 + upper_bound: 1.2315135 + version: 0 + with_row_id: true + prefilter: true + filter: filter + refine_factor: 0 + full_text_query: + string_query: + columns: + - columns + - columns + query: query + structured_query: + query: + boolean: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + phrase: + terms: terms + column: column + slop: 0 + match: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + boost: + negative: null + negative_boost: 7.0614014 + positive: null + multi_match: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + distance_type: distance_type + lower_bound: 3.6160767 + identity: + api_key: api_key + auth_token: auth_token + bypass_vector_index: true + nprobes: 0 + context: + key: context + vector: + single_vector: + - 1.0246457 + - 1.0246457 + multi_vector: + - - 1.4894159 + - 1.4894159 + - - 1.4894159 + - 1.4894159 + id: + - id + - id + context: + key: context + id: + - id + - id + verbose: false + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + query: + $ref: '#/components/schemas/QueryTableRequest' + verbose: + default: false + description: Whether to return verbose explanation + type: boolean + required: + - query + ExplainTableQueryPlanResponse: + properties: + plan: + description: Human-readable query execution plan + type: string + required: + - plan + AnalyzeTableQueryPlanRequest: + example: + ef: 0 + offset: 0 + columns: + column_aliases: + key: column_aliases + column_names: + - column_names + - column_names + vector_column: vector_column + fast_search: true + k: 0 + upper_bound: 1.2315135 + version: 0 + with_row_id: true + prefilter: true + filter: filter + refine_factor: 0 + full_text_query: + string_query: + columns: + - columns + - columns + query: query + structured_query: + query: + boolean: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + phrase: + terms: terms + column: column + slop: 0 + match: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + boost: + negative: null + negative_boost: 7.0614014 + positive: null + multi_match: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + distance_type: distance_type + lower_bound: 3.6160767 + identity: + api_key: api_key + auth_token: auth_token + bypass_vector_index: true + nprobes: 0 + context: + key: context + vector: + single_vector: + - 1.0246457 + - 1.0246457 + multi_vector: + - - 1.4894159 + - 1.4894159 + - - 1.4894159 + - 1.4894159 + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + bypass_vector_index: + description: Whether to bypass vector index + type: boolean + columns: + $ref: '#/components/schemas/QueryTableRequest_columns' + distance_type: + description: Distance metric to use + type: string + ef: + description: Search effort parameter for HNSW index + minimum: 0 + type: integer + fast_search: + description: Whether to use fast search + type: boolean + filter: + description: Optional SQL filter expression + type: string + full_text_query: + $ref: '#/components/schemas/QueryTableRequest_full_text_query' + k: + description: Number of results to return + minimum: 0 + type: integer + lower_bound: + description: Lower bound for search + format: float + type: number + nprobes: + description: Number of probes for IVF index + minimum: 0 + type: integer + offset: + description: Number of results to skip + minimum: 0 + type: integer + prefilter: + description: Whether to apply filtering before vector search + type: boolean + refine_factor: + description: Refine factor for search + format: int32 + minimum: 0 + type: integer + upper_bound: + description: Upper bound for search + format: float + type: number + vector: + $ref: '#/components/schemas/QueryTableRequest_vector' + vector_column: + description: Name of the vector column to search + type: string + version: + description: Table version to query + format: int64 + minimum: 0 + type: integer + with_row_id: + description: "If true, return the row id as a column called `_rowid`" + type: boolean + required: + - k + - vector + AnalyzeTableQueryPlanResponse: + properties: + analysis: + description: Detailed analysis of the query execution plan + type: string + required: + - analysis + AlterTableAddColumnsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + new_columns: + - expression: expression + name: name + virtual_column: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + data_type: "{}" + udf_version: udf_version + - expression: expression + name: name + virtual_column: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + data_type: "{}" + udf_version: udf_version + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + new_columns: + description: List of new columns to add + items: + $ref: '#/components/schemas/NewColumnTransform' + type: array + required: + - new_columns + NewColumnTransform: + example: + expression: expression + name: name + virtual_column: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + data_type: "{}" + udf_version: udf_version + properties: + name: + description: Name of the new column + type: string + expression: + description: SQL expression to compute the column value (optional if virtual_column + is specified) + type: string + nullable: true + virtual_column: + $ref: '#/components/schemas/AddVirtualColumnEntry' + required: + - name + AddVirtualColumnEntry: + example: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + data_type: "{}" + udf_version: udf_version + properties: + input_columns: + description: List of input column names for the virtual column + items: + type: string + type: array + data_type: + description: Data type of the virtual column using JSON representation + type: object + image: + description: Docker image to use for the UDF + type: string + udf: + description: Base64 encoded pickled UDF + type: string + udf_name: + description: Name of the UDF + type: string + udf_version: + description: Version of the UDF + type: string + required: + - data_type + - image + - input_columns + - udf + - udf_name + - udf_version + AlterTableAddColumnsResponse: + example: + transaction_id: transaction_id + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + version: + description: Version of the table after adding columns + format: int64 + minimum: 0 + type: integer + required: + - version + AlterTableAlterColumnsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + alterations: + - path: path + nullable: true + rename: rename + data_type: "{}" + virtual_column: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + udf_version: udf_version + - path: path + nullable: true + rename: rename + data_type: "{}" + virtual_column: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + udf_version: udf_version + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + alterations: + description: List of column alterations to perform + items: + $ref: '#/components/schemas/AlterColumnsEntry' + type: array + required: + - alterations + AlterColumnsEntry: + example: + path: path + nullable: true + rename: rename + data_type: "{}" + virtual_column: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + udf_version: udf_version + properties: + path: + description: Column path to alter + type: string + data_type: + description: New data type for the column using JSON representation (optional) + type: object + rename: + description: New name for the column (optional) + type: string + nullable: true + nullable: + description: Whether the column should be nullable (optional) + type: boolean + nullable: true + virtual_column: + $ref: '#/components/schemas/AlterVirtualColumnEntry' + required: + - data_type + - path + AlterVirtualColumnEntry: + example: + image: image + udf: udf + udf_name: udf_name + input_columns: + - input_columns + - input_columns + udf_version: udf_version + properties: + input_columns: + description: List of input column names for the virtual column (optional) + items: + type: string + type: array + nullable: true + image: + description: Docker image to use for the UDF (optional) + type: string + nullable: true + udf: + description: Base64 encoded pickled UDF (optional) + type: string + nullable: true + udf_name: + description: Name of the UDF (optional) + type: string + nullable: true + udf_version: + description: Version of the UDF (optional) + type: string + nullable: true + AlterTableAlterColumnsResponse: + example: + transaction_id: transaction_id + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + version: + description: Version of the table after altering columns + format: int64 + minimum: 0 + type: integer + required: + - version + AlterTableDropColumnsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + columns: + - columns + - columns + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + columns: + description: Names of columns to drop + items: + type: string + type: array + required: + - columns + AlterTableDropColumnsResponse: + example: + transaction_id: transaction_id + version: 0 + properties: + transaction_id: + description: Optional transaction identifier + type: string + version: + description: Version of the table after dropping columns + format: int64 + minimum: 0 + type: integer + required: + - version + GetTableStatsRequest: + example: + identity: + api_key: api_key + auth_token: auth_token + context: + key: context + id: + - id + - id + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + GetTableStatsResponse: + example: + num_indices: 0 + total_bytes: 0 + num_rows: 0 + fragment_stats: + num_small_fragments: 0 + lengths: + p99: 0 + p25: 0 + min: 0 + max: 0 + mean: 0 + p50: 0 + p75: 0 + num_fragments: 0 + properties: + total_bytes: + description: The total number of bytes in the table + format: int64 + minimum: 0 + type: integer + num_rows: + description: The number of rows in the table + format: int64 + minimum: 0 + type: integer + num_indices: + description: The number of indices in the table + format: int64 + minimum: 0 + type: integer + fragment_stats: + $ref: '#/components/schemas/FragmentStats' + required: + - fragment_stats + - num_indices + - num_rows + - total_bytes + FragmentStats: + example: + num_small_fragments: 0 + lengths: + p99: 0 + p25: 0 + min: 0 + max: 0 + mean: 0 + p50: 0 + p75: 0 + num_fragments: 0 + properties: + num_fragments: + description: The number of fragments in the table + format: int64 + minimum: 0 + type: integer + num_small_fragments: + description: The number of uncompacted fragments in the table + format: int64 + minimum: 0 + type: integer + lengths: + $ref: '#/components/schemas/FragmentSummary' + required: + - lengths + - num_fragments + - num_small_fragments + FragmentSummary: + example: + p99: 0 + p25: 0 + min: 0 + max: 0 + mean: 0 + p50: 0 + p75: 0 + properties: + min: + format: int64 + minimum: 0 + type: integer + max: + format: int64 + minimum: 0 + type: integer + mean: + format: int64 + minimum: 0 + type: integer + p25: + format: int64 + minimum: 0 + type: integer + p50: + format: int64 + minimum: 0 + type: integer + p75: + format: int64 + minimum: 0 + type: integer + p99: + format: int64 + minimum: 0 + type: integer + required: + - max + - mean + - min + - p25 + - p50 + - p75 + - p99 + DropTableIndexRequest: + properties: + identity: + $ref: '#/components/schemas/Identity' + context: + additionalProperties: + type: string + description: | + Arbitrary context for a request as key-value pairs. + How to use the context is custom to the specific implementation. + + REST NAMESPACE ONLY + Context entries are passed via HTTP headers using the naming convention + `x-lance-ctx-: `. For example, a context entry + `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + id: + items: + type: string + type: array + index_name: + description: Name of the index to drop + type: string + DropTableIndexResponse: + description: Response for drop index operation + example: + transaction_id: transaction_id + properties: + transaction_id: + description: Optional transaction identifier + type: string + PartitionTransform: + description: Well-known partition transform + properties: + type: + description: "Transform type (identity, year, month, day, hour, bucket,\ + \ multi_bucket, truncate)" + type: string + num_buckets: + description: Number of buckets for bucket transforms + type: integer + width: + description: Truncation width for truncate transforms + type: integer + required: + - type + PartitionField: + description: Partition field definition + properties: + field_id: + description: Unique identifier for this partition field (must not be renamed) + example: event_year + type: string + source_ids: + description: Field IDs of the source columns in the schema + example: + - 1 + items: + type: integer + type: array + transform: + $ref: '#/components/schemas/PartitionTransform' + expression: + description: "DataFusion SQL expression using col0, col1, ... as column\ + \ references. Exactly one of transform or expression must be specified." + example: "date_part('year', col0)" + type: string + result_type: + $ref: '#/components/schemas/JsonArrowDataType' + required: + - field_id + - result_type + - source_ids + PartitionSpec: + description: Partition spec definition + properties: + id: + description: The spec version ID + example: 1 + type: integer + fields: + description: Array of partition field definitions + items: + $ref: '#/components/schemas/PartitionField' + type: array + required: + - fields + - id + QueryTableRequest_columns: + description: | + Optional columns to return. Provide either column_names or column_aliases, not both. + example: + column_aliases: + key: column_aliases + column_names: + - column_names + - column_names + properties: + column_names: + description: List of column names to return + items: + type: string + type: array + column_aliases: + additionalProperties: + type: string + description: Object mapping output aliases to source column names + nullable: true + QueryTableRequest_full_text_query: + description: "Optional full-text search query. Provide either string_query or\ + \ structured_query, not both." + example: + string_query: + columns: + - columns + - columns + query: query + structured_query: + query: + boolean: + must_not: + - null + - null + should: + - null + - null + must: + - null + - null + phrase: + terms: terms + column: column + slop: 0 + match: + fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + boost: + negative: null + negative_boost: 7.0614014 + positive: null + multi_match: + match_queries: + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + - fuzziness: 0 + terms: terms + column: column + boost: 6.0274563 + prefix_length: 0 + operator: operator + max_expansions: 0 + properties: + string_query: + $ref: '#/components/schemas/StringFtsQuery' + structured_query: + $ref: '#/components/schemas/StructuredFtsQuery' + nullable: true + QueryTableRequest_vector: + description: "Query vector(s) for similarity search. Provide either single_vector\ + \ or multi_vector, not both." + example: + single_vector: + - 1.0246457 + - 1.0246457 + multi_vector: + - - 1.4894159 + - 1.4894159 + - - 1.4894159 + - 1.4894159 + properties: + single_vector: + description: Single query vector + items: + format: float + type: number + type: array + multi_vector: + description: Multiple query vectors for batch search + items: + items: + format: float + type: number + type: array + type: array + nullable: true + securitySchemes: + OAuth2: + flows: + clientCredentials: + scopes: {} + tokenUrl: /oauth/token + type: oauth2 + BearerAuth: + scheme: bearer + type: http + ApiKeyAuth: + in: header + name: x-api-key + type: apiKey + diff --git a/java/lance-namespace-async-client/docs/AddVirtualColumnEntry.md b/java/lance-namespace-async-client/docs/AddVirtualColumnEntry.md new file mode 100644 index 000000000..652921e9d --- /dev/null +++ b/java/lance-namespace-async-client/docs/AddVirtualColumnEntry.md @@ -0,0 +1,18 @@ + + +# AddVirtualColumnEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**inputColumns** | **List<String>** | List of input column names for the virtual column | | +|**dataType** | **Object** | Data type of the virtual column using JSON representation | | +|**image** | **String** | Docker image to use for the UDF | | +|**udf** | **String** | Base64 encoded pickled UDF | | +|**udfName** | **String** | Name of the UDF | | +|**udfVersion** | **String** | Version of the UDF | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterColumnsEntry.md b/java/lance-namespace-async-client/docs/AlterColumnsEntry.md new file mode 100644 index 000000000..83925d4fd --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterColumnsEntry.md @@ -0,0 +1,17 @@ + + +# AlterColumnsEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**path** | **String** | Column path to alter | | +|**dataType** | **Object** | New data type for the column using JSON representation (optional) | | +|**rename** | **String** | New name for the column (optional) | [optional] | +|**nullable** | **Boolean** | Whether the column should be nullable (optional) | [optional] | +|**virtualColumn** | [**AlterVirtualColumnEntry**](AlterVirtualColumnEntry.md) | Virtual column alterations (optional) | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTableAddColumnsRequest.md b/java/lance-namespace-async-client/docs/AlterTableAddColumnsRequest.md new file mode 100644 index 000000000..ea151f04a --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTableAddColumnsRequest.md @@ -0,0 +1,16 @@ + + +# AlterTableAddColumnsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**newColumns** | [**List<NewColumnTransform>**](NewColumnTransform.md) | List of new columns to add | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTableAddColumnsResponse.md b/java/lance-namespace-async-client/docs/AlterTableAddColumnsResponse.md new file mode 100644 index 000000000..480e055c7 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTableAddColumnsResponse.md @@ -0,0 +1,14 @@ + + +# AlterTableAddColumnsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**version** | **Long** | Version of the table after adding columns | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTableAlterColumnsRequest.md b/java/lance-namespace-async-client/docs/AlterTableAlterColumnsRequest.md new file mode 100644 index 000000000..ff5520c83 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTableAlterColumnsRequest.md @@ -0,0 +1,16 @@ + + +# AlterTableAlterColumnsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**alterations** | [**List<AlterColumnsEntry>**](AlterColumnsEntry.md) | List of column alterations to perform | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTableAlterColumnsResponse.md b/java/lance-namespace-async-client/docs/AlterTableAlterColumnsResponse.md new file mode 100644 index 000000000..ec6418ca1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTableAlterColumnsResponse.md @@ -0,0 +1,14 @@ + + +# AlterTableAlterColumnsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**version** | **Long** | Version of the table after altering columns | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTableDropColumnsRequest.md b/java/lance-namespace-async-client/docs/AlterTableDropColumnsRequest.md new file mode 100644 index 000000000..038eb1119 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTableDropColumnsRequest.md @@ -0,0 +1,16 @@ + + +# AlterTableDropColumnsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**columns** | **List<String>** | Names of columns to drop | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTableDropColumnsResponse.md b/java/lance-namespace-async-client/docs/AlterTableDropColumnsResponse.md new file mode 100644 index 000000000..fb6c06c7b --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTableDropColumnsResponse.md @@ -0,0 +1,14 @@ + + +# AlterTableDropColumnsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**version** | **Long** | Version of the table after dropping columns | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTransactionAction.md b/java/lance-namespace-async-client/docs/AlterTransactionAction.md new file mode 100644 index 000000000..384adc8e2 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTransactionAction.md @@ -0,0 +1,16 @@ + + +# AlterTransactionAction + +A single action that could be performed to alter a transaction. This action holds the model definition for all types of specific actions models, this is to minimize difference and compatibility issue across codegen in different languages. When used, only one of the actions should be non-null for each action. If you would like to perform multiple actions, set a list of actions in the AlterTransactionRequest. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**setStatusAction** | [**AlterTransactionSetStatus**](AlterTransactionSetStatus.md) | | [optional] | +|**setPropertyAction** | [**AlterTransactionSetProperty**](AlterTransactionSetProperty.md) | | [optional] | +|**unsetPropertyAction** | [**AlterTransactionUnsetProperty**](AlterTransactionUnsetProperty.md) | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTransactionRequest.md b/java/lance-namespace-async-client/docs/AlterTransactionRequest.md new file mode 100644 index 000000000..9d455e8a9 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTransactionRequest.md @@ -0,0 +1,17 @@ + + +# AlterTransactionRequest + +Alter a transaction with a list of actions. The server should either succeed and apply all actions, or fail and apply no action. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**actions** | [**List<AlterTransactionAction>**](AlterTransactionAction.md) | | | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTransactionResponse.md b/java/lance-namespace-async-client/docs/AlterTransactionResponse.md new file mode 100644 index 000000000..26dad8c45 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTransactionResponse.md @@ -0,0 +1,14 @@ + + +# AlterTransactionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **String** | The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Queued: the transaction is queued and not yet started - Running: the transaction is currently running - Succeeded: the transaction has completed successfully - Failed: the transaction has failed - Canceled: the transaction was canceled | | +|**properties** | **Map<String, String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTransactionSetProperty.md b/java/lance-namespace-async-client/docs/AlterTransactionSetProperty.md new file mode 100644 index 000000000..e9cf8efca --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTransactionSetProperty.md @@ -0,0 +1,15 @@ + + +# AlterTransactionSetProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | | [optional] | +|**value** | **String** | | [optional] | +|**mode** | **String** | The behavior if the property key already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Overwrite (default): overwrite the existing value with the provided value - Fail: fail the entire operation - Skip: keep the existing value and skip setting the provided value | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTransactionSetStatus.md b/java/lance-namespace-async-client/docs/AlterTransactionSetStatus.md new file mode 100644 index 000000000..faf8aef9b --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTransactionSetStatus.md @@ -0,0 +1,13 @@ + + +# AlterTransactionSetStatus + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **String** | The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Queued: the transaction is queued and not yet started - Running: the transaction is currently running - Succeeded: the transaction has completed successfully - Failed: the transaction has failed - Canceled: the transaction was canceled | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AlterTransactionUnsetProperty.md b/java/lance-namespace-async-client/docs/AlterTransactionUnsetProperty.md new file mode 100644 index 000000000..67fbe94db --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterTransactionUnsetProperty.md @@ -0,0 +1,14 @@ + + +# AlterTransactionUnsetProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | | [optional] | +|**mode** | **String** | The behavior if the property key to unset does not exist. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Skip (default): skip the property to unset - Fail: fail the entire operation | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AlterVirtualColumnEntry.md b/java/lance-namespace-async-client/docs/AlterVirtualColumnEntry.md new file mode 100644 index 000000000..cc10bbffa --- /dev/null +++ b/java/lance-namespace-async-client/docs/AlterVirtualColumnEntry.md @@ -0,0 +1,17 @@ + + +# AlterVirtualColumnEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**inputColumns** | **List<String>** | List of input column names for the virtual column (optional) | [optional] | +|**image** | **String** | Docker image to use for the UDF (optional) | [optional] | +|**udf** | **String** | Base64 encoded pickled UDF (optional) | [optional] | +|**udfName** | **String** | Name of the UDF (optional) | [optional] | +|**udfVersion** | **String** | Version of the UDF (optional) | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AnalyzeTableQueryPlanRequest.md b/java/lance-namespace-async-client/docs/AnalyzeTableQueryPlanRequest.md new file mode 100644 index 000000000..66f5a8cc4 --- /dev/null +++ b/java/lance-namespace-async-client/docs/AnalyzeTableQueryPlanRequest.md @@ -0,0 +1,33 @@ + + +# AnalyzeTableQueryPlanRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**bypassVectorIndex** | **Boolean** | Whether to bypass vector index | [optional] | +|**columns** | [**QueryTableRequestColumns**](QueryTableRequestColumns.md) | | [optional] | +|**distanceType** | **String** | Distance metric to use | [optional] | +|**ef** | **Integer** | Search effort parameter for HNSW index | [optional] | +|**fastSearch** | **Boolean** | Whether to use fast search | [optional] | +|**filter** | **String** | Optional SQL filter expression | [optional] | +|**fullTextQuery** | [**QueryTableRequestFullTextQuery**](QueryTableRequestFullTextQuery.md) | | [optional] | +|**k** | **Integer** | Number of results to return | | +|**lowerBound** | **Float** | Lower bound for search | [optional] | +|**nprobes** | **Integer** | Number of probes for IVF index | [optional] | +|**offset** | **Integer** | Number of results to skip | [optional] | +|**prefilter** | **Boolean** | Whether to apply filtering before vector search | [optional] | +|**refineFactor** | **Integer** | Refine factor for search | [optional] | +|**upperBound** | **Float** | Upper bound for search | [optional] | +|**vector** | [**QueryTableRequestVector**](QueryTableRequestVector.md) | | | +|**vectorColumn** | **String** | Name of the vector column to search | [optional] | +|**version** | **Long** | Table version to query | [optional] | +|**withRowId** | **Boolean** | If true, return the row id as a column called `_rowid` | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/AnalyzeTableQueryPlanResponse.md b/java/lance-namespace-async-client/docs/AnalyzeTableQueryPlanResponse.md new file mode 100644 index 000000000..d629aaabe --- /dev/null +++ b/java/lance-namespace-async-client/docs/AnalyzeTableQueryPlanResponse.md @@ -0,0 +1,13 @@ + + +# AnalyzeTableQueryPlanResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**analysis** | **String** | Detailed analysis of the query execution plan | | + + + diff --git a/java/lance-namespace-async-client/docs/BatchCreateTableVersionsRequest.md b/java/lance-namespace-async-client/docs/BatchCreateTableVersionsRequest.md new file mode 100644 index 000000000..77a320599 --- /dev/null +++ b/java/lance-namespace-async-client/docs/BatchCreateTableVersionsRequest.md @@ -0,0 +1,16 @@ + + +# BatchCreateTableVersionsRequest + +Request to atomically create new version entries for multiple tables. The operation is atomic: all versions are created or none are. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**entries** | [**List<CreateTableVersionEntry>**](CreateTableVersionEntry.md) | List of table version entries to create atomically | | + + + diff --git a/java/lance-namespace-async-client/docs/BatchCreateTableVersionsResponse.md b/java/lance-namespace-async-client/docs/BatchCreateTableVersionsResponse.md new file mode 100644 index 000000000..ec5bccd34 --- /dev/null +++ b/java/lance-namespace-async-client/docs/BatchCreateTableVersionsResponse.md @@ -0,0 +1,15 @@ + + +# BatchCreateTableVersionsResponse + +Response for batch creating table versions. Contains the created versions for each table in the same order as the request. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**versions** | [**List<TableVersion>**](TableVersion.md) | List of created table versions in the same order as the request entries | | + + + diff --git a/java/lance-namespace-async-client/docs/BatchDeleteTableVersionsRequest.md b/java/lance-namespace-async-client/docs/BatchDeleteTableVersionsRequest.md new file mode 100644 index 000000000..3988e8e35 --- /dev/null +++ b/java/lance-namespace-async-client/docs/BatchDeleteTableVersionsRequest.md @@ -0,0 +1,17 @@ + + +# BatchDeleteTableVersionsRequest + +Request to delete table version records. Supports deleting ranges of versions for efficient bulk cleanup. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The table identifier | [optional] | +|**ranges** | [**List<VersionRange>**](VersionRange.md) | List of version ranges to delete. Each range specifies start (inclusive) and end (exclusive) versions. | | + + + diff --git a/java/lance-namespace-async-client/docs/BatchDeleteTableVersionsResponse.md b/java/lance-namespace-async-client/docs/BatchDeleteTableVersionsResponse.md new file mode 100644 index 000000000..c2e37f115 --- /dev/null +++ b/java/lance-namespace-async-client/docs/BatchDeleteTableVersionsResponse.md @@ -0,0 +1,15 @@ + + +# BatchDeleteTableVersionsResponse + +Response for deleting table version records + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deletedCount** | **Long** | Number of version records deleted | [optional] | +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/BooleanQuery.md b/java/lance-namespace-async-client/docs/BooleanQuery.md new file mode 100644 index 000000000..ddf031cce --- /dev/null +++ b/java/lance-namespace-async-client/docs/BooleanQuery.md @@ -0,0 +1,16 @@ + + +# BooleanQuery + +Boolean query with must, should, and must_not clauses + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**must** | [**List<FtsQuery>**](FtsQuery.md) | Queries that must match (AND) | | +|**mustNot** | [**List<FtsQuery>**](FtsQuery.md) | Queries that must not match (NOT) | | +|**should** | [**List<FtsQuery>**](FtsQuery.md) | Queries that should match (OR) | | + + + diff --git a/java/lance-namespace-async-client/docs/BoostQuery.md b/java/lance-namespace-async-client/docs/BoostQuery.md new file mode 100644 index 000000000..84a0f560b --- /dev/null +++ b/java/lance-namespace-async-client/docs/BoostQuery.md @@ -0,0 +1,16 @@ + + +# BoostQuery + +Boost query that scores documents matching positive query higher and negative query lower + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**positive** | [**FtsQuery**](FtsQuery.md) | | | +|**negative** | [**FtsQuery**](FtsQuery.md) | | | +|**negativeBoost** | **Float** | Boost factor for negative query (default: 0.5) | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CountTableRowsRequest.md b/java/lance-namespace-async-client/docs/CountTableRowsRequest.md new file mode 100644 index 000000000..b03c81794 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CountTableRowsRequest.md @@ -0,0 +1,17 @@ + + +# CountTableRowsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**version** | **Long** | Version of the table to describe. If not specified, server should resolve it to the latest version. | [optional] | +|**predicate** | **String** | Optional SQL predicate to filter rows for counting | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md b/java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md new file mode 100644 index 000000000..ed3845f46 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md @@ -0,0 +1,19 @@ + + +# CreateEmptyTableRequest + +Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | +|**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | +|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md b/java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md new file mode 100644 index 000000000..39ce092a1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md @@ -0,0 +1,17 @@ + + +# CreateEmptyTableResponse + +Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**location** | **String** | | [optional] | +|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateNamespaceRequest.md b/java/lance-namespace-async-client/docs/CreateNamespaceRequest.md new file mode 100644 index 000000000..592fe0c1f --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateNamespaceRequest.md @@ -0,0 +1,17 @@ + + +# CreateNamespaceRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**mode** | **String** | There are three modes when trying to create a namespace, to differentiate the behavior when a namespace of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing namespace is kept. * Overwrite: the existing namespace is dropped and a new empty namespace with this name is created. | [optional] | +|**properties** | **Map<String, String>** | Properties stored on the namespace, if supported by the implementation. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateNamespaceResponse.md b/java/lance-namespace-async-client/docs/CreateNamespaceResponse.md new file mode 100644 index 000000000..92ed5d6a5 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateNamespaceResponse.md @@ -0,0 +1,14 @@ + + +# CreateNamespaceResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**properties** | **Map<String, String>** | Properties after the namespace is created. If the server does not support namespace properties, it should return null for this field. If namespace properties are supported, but none are set, it should return an empty object. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableIndexRequest.md b/java/lance-namespace-async-client/docs/CreateTableIndexRequest.md new file mode 100644 index 000000000..aa0acca48 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableIndexRequest.md @@ -0,0 +1,27 @@ + + +# CreateTableIndexRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**column** | **String** | Name of the column to create index on | | +|**indexType** | **String** | Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS) | | +|**name** | **String** | Optional name for the index. If not provided, a name will be auto-generated. | [optional] | +|**distanceType** | **String** | Distance metric type for vector indexes (e.g., l2, cosine, dot) | [optional] | +|**withPosition** | **Boolean** | Optional FTS parameter for position tracking | [optional] | +|**baseTokenizer** | **String** | Optional FTS parameter for base tokenizer | [optional] | +|**language** | **String** | Optional FTS parameter for language | [optional] | +|**maxTokenLength** | **Integer** | Optional FTS parameter for maximum token length | [optional] | +|**lowerCase** | **Boolean** | Optional FTS parameter for lowercase conversion | [optional] | +|**stem** | **Boolean** | Optional FTS parameter for stemming | [optional] | +|**removeStopWords** | **Boolean** | Optional FTS parameter for stop word removal | [optional] | +|**asciiFolding** | **Boolean** | Optional FTS parameter for ASCII folding | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableIndexResponse.md b/java/lance-namespace-async-client/docs/CreateTableIndexResponse.md new file mode 100644 index 000000000..0e26afa32 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableIndexResponse.md @@ -0,0 +1,14 @@ + + +# CreateTableIndexResponse + +Response for create index operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableRequest.md b/java/lance-namespace-async-client/docs/CreateTableRequest.md new file mode 100644 index 000000000..38a18ebaf --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableRequest.md @@ -0,0 +1,18 @@ + + +# CreateTableRequest + +Request for creating a table, excluding the Arrow IPC stream. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**mode** | **String** | There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. | [optional] | +|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the implementation. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableResponse.md b/java/lance-namespace-async-client/docs/CreateTableResponse.md new file mode 100644 index 000000000..3997eb4d1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableResponse.md @@ -0,0 +1,17 @@ + + +# CreateTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**location** | **String** | | [optional] | +|**version** | **Long** | | [optional] | +|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableScalarIndexResponse.md b/java/lance-namespace-async-client/docs/CreateTableScalarIndexResponse.md new file mode 100644 index 000000000..9d1760def --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableScalarIndexResponse.md @@ -0,0 +1,14 @@ + + +# CreateTableScalarIndexResponse + +Response for create scalar index operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableTagRequest.md b/java/lance-namespace-async-client/docs/CreateTableTagRequest.md new file mode 100644 index 000000000..94612d5b4 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableTagRequest.md @@ -0,0 +1,17 @@ + + +# CreateTableTagRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**tag** | **String** | Name of the tag to create | | +|**version** | **Long** | Version number for the tag to point to | | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableTagResponse.md b/java/lance-namespace-async-client/docs/CreateTableTagResponse.md new file mode 100644 index 000000000..24090f218 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableTagResponse.md @@ -0,0 +1,14 @@ + + +# CreateTableTagResponse + +Response for create tag operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableVersionEntry.md b/java/lance-namespace-async-client/docs/CreateTableVersionEntry.md new file mode 100644 index 000000000..77a1adec2 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableVersionEntry.md @@ -0,0 +1,20 @@ + + +# CreateTableVersionEntry + +An entry for creating a new table version in a batch operation. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **List<String>** | The table identifier | | +|**version** | **Long** | Version number to create | | +|**manifestPath** | **String** | Path to the manifest file for this version | | +|**manifestSize** | **Long** | Size of the manifest file in bytes | [optional] | +|**eTag** | **String** | Optional ETag for the manifest file | [optional] | +|**metadata** | **Map<String, String>** | Optional metadata for the version | [optional] | +|**namingScheme** | **String** | The naming scheme used for manifest files in the `_versions/` directory. Known values: - `V1`: `_versions/{version}.manifest` - Simple version-based naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores V2 is preferred for new tables as it enables efficient latest-version discovery without needing to list all versions. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableVersionRequest.md b/java/lance-namespace-async-client/docs/CreateTableVersionRequest.md new file mode 100644 index 000000000..30802f114 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableVersionRequest.md @@ -0,0 +1,22 @@ + + +# CreateTableVersionRequest + +Request to create a new table version entry. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The table identifier | [optional] | +|**version** | **Long** | Version number to create | | +|**manifestPath** | **String** | Path to the manifest file for this version | | +|**manifestSize** | **Long** | Size of the manifest file in bytes | [optional] | +|**eTag** | **String** | Optional ETag for the manifest file | [optional] | +|**metadata** | **Map<String, String>** | Optional metadata for the version | [optional] | +|**namingScheme** | **String** | The naming scheme used for manifest files in the `_versions/` directory. Known values: - `V1`: `_versions/{version}.manifest` - Simple version-based naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores V2 is preferred for new tables as it enables efficient latest-version discovery without needing to list all versions. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/CreateTableVersionResponse.md b/java/lance-namespace-async-client/docs/CreateTableVersionResponse.md new file mode 100644 index 000000000..e5acc8a54 --- /dev/null +++ b/java/lance-namespace-async-client/docs/CreateTableVersionResponse.md @@ -0,0 +1,15 @@ + + +# CreateTableVersionResponse + +Response for creating a table version + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**version** | [**TableVersion**](TableVersion.md) | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DataApi.md b/java/lance-namespace-async-client/docs/DataApi.md new file mode 100644 index 000000000..15f0caae1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DataApi.md @@ -0,0 +1,1998 @@ +# DataApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**alterTableAddColumns**](DataApi.md#alterTableAddColumns) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema | +| [**alterTableAddColumnsWithHttpInfo**](DataApi.md#alterTableAddColumnsWithHttpInfo) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema | +| [**analyzeTableQueryPlan**](DataApi.md#analyzeTableQueryPlan) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan | +| [**analyzeTableQueryPlanWithHttpInfo**](DataApi.md#analyzeTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan | +| [**countTableRows**](DataApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table | +| [**countTableRowsWithHttpInfo**](DataApi.md#countTableRowsWithHttpInfo) | **POST** /v1/table/{id}/count_rows | Count rows in a table | +| [**createTable**](DataApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name | +| [**createTableWithHttpInfo**](DataApi.md#createTableWithHttpInfo) | **POST** /v1/table/{id}/create | Create a table with the given name | +| [**deleteFromTable**](DataApi.md#deleteFromTable) | **POST** /v1/table/{id}/delete | Delete rows from a table | +| [**deleteFromTableWithHttpInfo**](DataApi.md#deleteFromTableWithHttpInfo) | **POST** /v1/table/{id}/delete | Delete rows from a table | +| [**explainTableQueryPlan**](DataApi.md#explainTableQueryPlan) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation | +| [**explainTableQueryPlanWithHttpInfo**](DataApi.md#explainTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation | +| [**insertIntoTable**](DataApi.md#insertIntoTable) | **POST** /v1/table/{id}/insert | Insert records into a table | +| [**insertIntoTableWithHttpInfo**](DataApi.md#insertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/insert | Insert records into a table | +| [**mergeInsertIntoTable**](DataApi.md#mergeInsertIntoTable) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table | +| [**mergeInsertIntoTableWithHttpInfo**](DataApi.md#mergeInsertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table | +| [**queryTable**](DataApi.md#queryTable) | **POST** /v1/table/{id}/query | Query a table | +| [**queryTableWithHttpInfo**](DataApi.md#queryTableWithHttpInfo) | **POST** /v1/table/{id}/query | Query a table | +| [**updateTable**](DataApi.md#updateTable) | **POST** /v1/table/{id}/update | Update rows in a table | +| [**updateTableWithHttpInfo**](DataApi.md#updateTableWithHttpInfo) | **POST** /v1/table/{id}/update | Update rows in a table | + + + +## alterTableAddColumns + +> CompletableFuture alterTableAddColumns(id, alterTableAddColumnsRequest, delimiter) + +Add new columns to table schema + +Add new columns to table `id` using SQL expressions or default values. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAddColumnsRequest alterTableAddColumnsRequest = new AlterTableAddColumnsRequest(); // AlterTableAddColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableAddColumns(id, alterTableAddColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#alterTableAddColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAddColumnsRequest** | [**AlterTableAddColumnsRequest**](AlterTableAddColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTableAddColumnsResponse**](AlterTableAddColumnsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Add columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTableAddColumnsWithHttpInfo + +> CompletableFuture> alterTableAddColumns alterTableAddColumnsWithHttpInfo(id, alterTableAddColumnsRequest, delimiter) + +Add new columns to table schema + +Add new columns to table `id` using SQL expressions or default values. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAddColumnsRequest alterTableAddColumnsRequest = new AlterTableAddColumnsRequest(); // AlterTableAddColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTableAddColumnsWithHttpInfo(id, alterTableAddColumnsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#alterTableAddColumns"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#alterTableAddColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAddColumnsRequest** | [**AlterTableAddColumnsRequest**](AlterTableAddColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Add columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## analyzeTableQueryPlan + +> CompletableFuture analyzeTableQueryPlan(id, analyzeTableQueryPlanRequest, delimiter) + +Analyze query execution plan + +Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest = new AnalyzeTableQueryPlanRequest(); // AnalyzeTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.analyzeTableQueryPlan(id, analyzeTableQueryPlanRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#analyzeTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **analyzeTableQueryPlanRequest** | [**AnalyzeTableQueryPlanRequest**](AnalyzeTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**String**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan analysis | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## analyzeTableQueryPlanWithHttpInfo + +> CompletableFuture> analyzeTableQueryPlan analyzeTableQueryPlanWithHttpInfo(id, analyzeTableQueryPlanRequest, delimiter) + +Analyze query execution plan + +Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest = new AnalyzeTableQueryPlanRequest(); // AnalyzeTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.analyzeTableQueryPlanWithHttpInfo(id, analyzeTableQueryPlanRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#analyzeTableQueryPlan"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#analyzeTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **analyzeTableQueryPlanRequest** | [**AnalyzeTableQueryPlanRequest**](AnalyzeTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan analysis | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## countTableRows + +> CompletableFuture countTableRows(id, countTableRowsRequest, delimiter) + +Count rows in a table + +Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CountTableRowsRequest countTableRowsRequest = new CountTableRowsRequest(); // CountTableRowsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.countTableRows(id, countTableRowsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#countTableRows"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **countTableRowsRequest** | [**CountTableRowsRequest**](CountTableRowsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**Long**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of counting rows in a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## countTableRowsWithHttpInfo + +> CompletableFuture> countTableRows countTableRowsWithHttpInfo(id, countTableRowsRequest, delimiter) + +Count rows in a table + +Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CountTableRowsRequest countTableRowsRequest = new CountTableRowsRequest(); // CountTableRowsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.countTableRowsWithHttpInfo(id, countTableRowsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#countTableRows"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#countTableRows"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **countTableRowsRequest** | [**CountTableRowsRequest**](CountTableRowsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of counting rows in a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTable + +> CompletableFuture createTable(id, body, delimiter, mode) + +Create a table with the given name + +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC data + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "mode_example"; // String | + try { + CompletableFuture result = apiInstance.createTable(id, body, delimiter, mode); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#createTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC data | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| | [optional] | + +### Return type + +CompletableFuture<[**CreateTableResponse**](CreateTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableWithHttpInfo + +> CompletableFuture> createTable createTableWithHttpInfo(id, body, delimiter, mode) + +Create a table with the given name + +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC data + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "mode_example"; // String | + try { + CompletableFuture> response = apiInstance.createTableWithHttpInfo(id, body, delimiter, mode); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#createTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#createTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC data | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deleteFromTable + +> CompletableFuture deleteFromTable(id, deleteFromTableRequest, delimiter) + +Delete rows from a table + +Delete rows from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteFromTableRequest deleteFromTableRequest = new DeleteFromTableRequest(); // DeleteFromTableRequest | Delete request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deleteFromTable(id, deleteFromTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#deleteFromTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteFromTableRequest** | [**DeleteFromTableRequest**](DeleteFromTableRequest.md)| Delete request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeleteFromTableResponse**](DeleteFromTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deleteFromTableWithHttpInfo + +> CompletableFuture> deleteFromTable deleteFromTableWithHttpInfo(id, deleteFromTableRequest, delimiter) + +Delete rows from a table + +Delete rows from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteFromTableRequest deleteFromTableRequest = new DeleteFromTableRequest(); // DeleteFromTableRequest | Delete request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deleteFromTableWithHttpInfo(id, deleteFromTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#deleteFromTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#deleteFromTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteFromTableRequest** | [**DeleteFromTableRequest**](DeleteFromTableRequest.md)| Delete request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## explainTableQueryPlan + +> CompletableFuture explainTableQueryPlan(id, explainTableQueryPlanRequest, delimiter) + +Get query execution plan explanation + +Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ExplainTableQueryPlanRequest explainTableQueryPlanRequest = new ExplainTableQueryPlanRequest(); // ExplainTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.explainTableQueryPlan(id, explainTableQueryPlanRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#explainTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **explainTableQueryPlanRequest** | [**ExplainTableQueryPlanRequest**](ExplainTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**String**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan explanation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## explainTableQueryPlanWithHttpInfo + +> CompletableFuture> explainTableQueryPlan explainTableQueryPlanWithHttpInfo(id, explainTableQueryPlanRequest, delimiter) + +Get query execution plan explanation + +Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ExplainTableQueryPlanRequest explainTableQueryPlanRequest = new ExplainTableQueryPlanRequest(); // ExplainTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.explainTableQueryPlanWithHttpInfo(id, explainTableQueryPlanRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#explainTableQueryPlan"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#explainTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **explainTableQueryPlanRequest** | [**ExplainTableQueryPlanRequest**](ExplainTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan explanation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## insertIntoTable + +> CompletableFuture insertIntoTable(id, body, delimiter, mode) + +Insert records into a table + +Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC stream containing the records to insert + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "append"; // String | How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it + try { + CompletableFuture result = apiInstance.insertIntoTable(id, body, delimiter, mode); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#insertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC stream containing the records to insert | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it | [optional] [default to append] | + +### Return type + +CompletableFuture<[**InsertIntoTableResponse**](InsertIntoTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of inserting records into a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## insertIntoTableWithHttpInfo + +> CompletableFuture> insertIntoTable insertIntoTableWithHttpInfo(id, body, delimiter, mode) + +Insert records into a table + +Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC stream containing the records to insert + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "append"; // String | How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it + try { + CompletableFuture> response = apiInstance.insertIntoTableWithHttpInfo(id, body, delimiter, mode); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#insertIntoTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#insertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC stream containing the records to insert | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it | [optional] [default to append] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of inserting records into a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## mergeInsertIntoTable + +> CompletableFuture mergeInsertIntoTable(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex) + +Merge insert (upsert) records into a table + +Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String on = "on_example"; // String | Column name to use for matching rows (required) + byte[] body = null; // byte[] | Arrow IPC stream containing the records to merge + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean whenMatchedUpdateAll = false; // Boolean | Update all columns when rows match + String whenMatchedUpdateAllFilt = "whenMatchedUpdateAllFilt_example"; // String | The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true + Boolean whenNotMatchedInsertAll = false; // Boolean | Insert all columns when rows don't match + Boolean whenNotMatchedBySourceDelete = false; // Boolean | Delete all rows from target table that don't match a row in the source table + String whenNotMatchedBySourceDeleteFilt = "whenNotMatchedBySourceDeleteFilt_example"; // String | Delete rows from the target table if there is no match AND the SQL expression evaluates to true + String timeout = "timeout_example"; // String | Timeout for the operation (e.g., \"30s\", \"5m\") + Boolean useIndex = false; // Boolean | Whether to use index for matching rows + try { + CompletableFuture result = apiInstance.mergeInsertIntoTable(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#mergeInsertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **on** | **String**| Column name to use for matching rows (required) | | +| **body** | **byte[]**| Arrow IPC stream containing the records to merge | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **whenMatchedUpdateAll** | **Boolean**| Update all columns when rows match | [optional] [default to false] | +| **whenMatchedUpdateAllFilt** | **String**| The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true | [optional] | +| **whenNotMatchedInsertAll** | **Boolean**| Insert all columns when rows don't match | [optional] [default to false] | +| **whenNotMatchedBySourceDelete** | **Boolean**| Delete all rows from target table that don't match a row in the source table | [optional] [default to false] | +| **whenNotMatchedBySourceDeleteFilt** | **String**| Delete rows from the target table if there is no match AND the SQL expression evaluates to true | [optional] | +| **timeout** | **String**| Timeout for the operation (e.g., \"30s\", \"5m\") | [optional] | +| **useIndex** | **Boolean**| Whether to use index for matching rows | [optional] [default to false] | + +### Return type + +CompletableFuture<[**MergeInsertIntoTableResponse**](MergeInsertIntoTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of merge insert operation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## mergeInsertIntoTableWithHttpInfo + +> CompletableFuture> mergeInsertIntoTable mergeInsertIntoTableWithHttpInfo(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex) + +Merge insert (upsert) records into a table + +Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String on = "on_example"; // String | Column name to use for matching rows (required) + byte[] body = null; // byte[] | Arrow IPC stream containing the records to merge + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean whenMatchedUpdateAll = false; // Boolean | Update all columns when rows match + String whenMatchedUpdateAllFilt = "whenMatchedUpdateAllFilt_example"; // String | The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true + Boolean whenNotMatchedInsertAll = false; // Boolean | Insert all columns when rows don't match + Boolean whenNotMatchedBySourceDelete = false; // Boolean | Delete all rows from target table that don't match a row in the source table + String whenNotMatchedBySourceDeleteFilt = "whenNotMatchedBySourceDeleteFilt_example"; // String | Delete rows from the target table if there is no match AND the SQL expression evaluates to true + String timeout = "timeout_example"; // String | Timeout for the operation (e.g., \"30s\", \"5m\") + Boolean useIndex = false; // Boolean | Whether to use index for matching rows + try { + CompletableFuture> response = apiInstance.mergeInsertIntoTableWithHttpInfo(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#mergeInsertIntoTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#mergeInsertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **on** | **String**| Column name to use for matching rows (required) | | +| **body** | **byte[]**| Arrow IPC stream containing the records to merge | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **whenMatchedUpdateAll** | **Boolean**| Update all columns when rows match | [optional] [default to false] | +| **whenMatchedUpdateAllFilt** | **String**| The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true | [optional] | +| **whenNotMatchedInsertAll** | **Boolean**| Insert all columns when rows don't match | [optional] [default to false] | +| **whenNotMatchedBySourceDelete** | **Boolean**| Delete all rows from target table that don't match a row in the source table | [optional] [default to false] | +| **whenNotMatchedBySourceDeleteFilt** | **String**| Delete rows from the target table if there is no match AND the SQL expression evaluates to true | [optional] | +| **timeout** | **String**| Timeout for the operation (e.g., \"30s\", \"5m\") | [optional] | +| **useIndex** | **Boolean**| Whether to use index for matching rows | [optional] [default to false] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of merge insert operation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## queryTable + +> CompletableFuture queryTable(id, queryTableRequest, delimiter) + +Query a table + +Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + QueryTableRequest queryTableRequest = new QueryTableRequest(); // QueryTableRequest | Query request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.queryTable(id, queryTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#queryTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **queryTableRequest** | [**QueryTableRequest**](QueryTableRequest.md)| Query request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**byte[]**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/vnd.apache.arrow.file, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query results in Arrow IPC file format | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## queryTableWithHttpInfo + +> CompletableFuture> queryTable queryTableWithHttpInfo(id, queryTableRequest, delimiter) + +Query a table + +Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + QueryTableRequest queryTableRequest = new QueryTableRequest(); // QueryTableRequest | Query request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.queryTableWithHttpInfo(id, queryTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#queryTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#queryTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **queryTableRequest** | [**QueryTableRequest**](QueryTableRequest.md)| Query request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/vnd.apache.arrow.file, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query results in Arrow IPC file format | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTable + +> CompletableFuture updateTable(id, updateTableRequest, delimiter) + +Update rows in a table + +Update existing rows in table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableRequest updateTableRequest = new UpdateTableRequest(); // UpdateTableRequest | Update request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.updateTable(id, updateTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#updateTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableRequest** | [**UpdateTableRequest**](UpdateTableRequest.md)| Update request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**UpdateTableResponse**](UpdateTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableWithHttpInfo + +> CompletableFuture> updateTable updateTableWithHttpInfo(id, updateTableRequest, delimiter) + +Update rows in a table + +Update existing rows in table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.DataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + DataApi apiInstance = new DataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableRequest updateTableRequest = new UpdateTableRequest(); // UpdateTableRequest | Update request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.updateTableWithHttpInfo(id, updateTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling DataApi#updateTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling DataApi#updateTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableRequest** | [**UpdateTableRequest**](UpdateTableRequest.md)| Update request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/DeclareTableRequest.md b/java/lance-namespace-async-client/docs/DeclareTableRequest.md new file mode 100644 index 000000000..7a58a8315 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeclareTableRequest.md @@ -0,0 +1,19 @@ + + +# DeclareTableRequest + +Request for declaring a table. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | +|**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | +|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DeclareTableResponse.md b/java/lance-namespace-async-client/docs/DeclareTableResponse.md new file mode 100644 index 000000000..4d475011e --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeclareTableResponse.md @@ -0,0 +1,18 @@ + + +# DeclareTableResponse + +Response for declaring a table. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**location** | **String** | | [optional] | +|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | +|**managedVersioning** | **Boolean** | When true, the caller should use namespace table version operations (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) to manage table versions instead of relying on Lance's native version management. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DeleteFromTableRequest.md b/java/lance-namespace-async-client/docs/DeleteFromTableRequest.md new file mode 100644 index 000000000..0ef5b076b --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeleteFromTableRequest.md @@ -0,0 +1,17 @@ + + +# DeleteFromTableRequest + +Delete data from table based on a SQL predicate. Returns the number of rows that were deleted. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The namespace identifier | [optional] | +|**predicate** | **String** | SQL predicate to filter rows for deletion | | + + + diff --git a/java/lance-namespace-async-client/docs/DeleteFromTableResponse.md b/java/lance-namespace-async-client/docs/DeleteFromTableResponse.md new file mode 100644 index 000000000..60a98458c --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeleteFromTableResponse.md @@ -0,0 +1,14 @@ + + +# DeleteFromTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**version** | **Long** | The commit version associated with the operation | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DeleteTableTagRequest.md b/java/lance-namespace-async-client/docs/DeleteTableTagRequest.md new file mode 100644 index 000000000..6d80549cc --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeleteTableTagRequest.md @@ -0,0 +1,16 @@ + + +# DeleteTableTagRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**tag** | **String** | Name of the tag to delete | | + + + diff --git a/java/lance-namespace-async-client/docs/DeleteTableTagResponse.md b/java/lance-namespace-async-client/docs/DeleteTableTagResponse.md new file mode 100644 index 000000000..e4c018aa8 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeleteTableTagResponse.md @@ -0,0 +1,14 @@ + + +# DeleteTableTagResponse + +Response for delete tag operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DeregisterTableRequest.md b/java/lance-namespace-async-client/docs/DeregisterTableRequest.md new file mode 100644 index 000000000..273f3fc7b --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeregisterTableRequest.md @@ -0,0 +1,16 @@ + + +# DeregisterTableRequest + +The table content remains available in the storage. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DeregisterTableResponse.md b/java/lance-namespace-async-client/docs/DeregisterTableResponse.md new file mode 100644 index 000000000..cddb62408 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DeregisterTableResponse.md @@ -0,0 +1,16 @@ + + +# DeregisterTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**id** | **List<String>** | | [optional] | +|**location** | **String** | | [optional] | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeNamespaceRequest.md b/java/lance-namespace-async-client/docs/DescribeNamespaceRequest.md new file mode 100644 index 000000000..6a5a3491e --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeNamespaceRequest.md @@ -0,0 +1,15 @@ + + +# DescribeNamespaceRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeNamespaceResponse.md b/java/lance-namespace-async-client/docs/DescribeNamespaceResponse.md new file mode 100644 index 000000000..44b52ed56 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeNamespaceResponse.md @@ -0,0 +1,13 @@ + + +# DescribeNamespaceResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**properties** | **Map<String, String>** | Properties stored on the namespace, if supported by the server. If the server does not support namespace properties, it should return null for this field. If namespace properties are supported, but none are set, it should return an empty object. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTableIndexStatsRequest.md b/java/lance-namespace-async-client/docs/DescribeTableIndexStatsRequest.md new file mode 100644 index 000000000..30a40099c --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTableIndexStatsRequest.md @@ -0,0 +1,17 @@ + + +# DescribeTableIndexStatsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**version** | **Long** | Optional table version to get stats for | [optional] | +|**indexName** | **String** | Name of the index | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTableIndexStatsResponse.md b/java/lance-namespace-async-client/docs/DescribeTableIndexStatsResponse.md new file mode 100644 index 000000000..6d7260e7e --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTableIndexStatsResponse.md @@ -0,0 +1,17 @@ + + +# DescribeTableIndexStatsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**distanceType** | **String** | Distance type for vector indexes | [optional] | +|**indexType** | **String** | Type of the index | [optional] | +|**numIndexedRows** | **Long** | Number of indexed rows | [optional] | +|**numUnindexedRows** | **Long** | Number of unindexed rows | [optional] | +|**numIndices** | **Integer** | Number of indices | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTableRequest.md b/java/lance-namespace-async-client/docs/DescribeTableRequest.md new file mode 100644 index 000000000..b60c5d622 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTableRequest.md @@ -0,0 +1,19 @@ + + +# DescribeTableRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**version** | **Long** | Version of the table to describe. If not specified, server should resolve it to the latest version. | [optional] | +|**withTableUri** | **Boolean** | Whether to include the table URI in the response. Default is false. | [optional] | +|**loadDetailedMetadata** | **Boolean** | Whether to load detailed metadata that requires opening the dataset. When true, the response must include all detailed metadata such as `version`, `schema`, and `stats` which require reading the dataset. When not set, the implementation can decide whether to return detailed metadata and which parts of detailed metadata to return. | [optional] | +|**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTableResponse.md b/java/lance-namespace-async-client/docs/DescribeTableResponse.md new file mode 100644 index 000000000..233dfd6a9 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTableResponse.md @@ -0,0 +1,23 @@ + + +# DescribeTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**table** | **String** | Table name. Only populated when `load_detailed_metadata` is true. | [optional] | +|**namespace** | **List<String>** | The namespace identifier as a list of parts. Only populated when `load_detailed_metadata` is true. | [optional] | +|**version** | **Long** | Table version number. Only populated when `load_detailed_metadata` is true. | [optional] | +|**location** | **String** | Table storage location (e.g., S3/GCS path). | [optional] | +|**tableUri** | **String** | Table URI. Unlike location, this field must be a complete and valid URI. Only returned when `with_table_uri` is true. | [optional] | +|**schema** | [**JsonArrowSchema**](JsonArrowSchema.md) | Table schema in JSON Arrow format. Only populated when `load_detailed_metadata` is true. | [optional] | +|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. When `vend_credentials` is true, this field may include vended credentials. If the vended credentials are temporary, the `expires_at_millis` key should be included to indicate the millisecond timestamp when the credentials expire. | [optional] | +|**stats** | [**TableBasicStats**](TableBasicStats.md) | Table statistics. Only populated when `load_detailed_metadata` is true. | [optional] | +|**metadata** | **Map<String, String>** | Optional table metadata as key-value pairs. This records the information of the table and requires loading the table. It is only populated when `load_detailed_metadata` is true. | [optional] | +|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. This records the information managed by the namespace. If the server does not support table properties, it should return null for this field. If table properties are supported, but none are set, it should return an empty object. | [optional] | +|**managedVersioning** | **Boolean** | When true, the caller should use namespace table version operations (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) to manage table versions instead of relying on Lance's native version management. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTableVersionRequest.md b/java/lance-namespace-async-client/docs/DescribeTableVersionRequest.md new file mode 100644 index 000000000..5d10901f4 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTableVersionRequest.md @@ -0,0 +1,17 @@ + + +# DescribeTableVersionRequest + +Request to describe a specific table version + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The table identifier | [optional] | +|**version** | **Long** | Version number to describe | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTableVersionResponse.md b/java/lance-namespace-async-client/docs/DescribeTableVersionResponse.md new file mode 100644 index 000000000..86ea56899 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTableVersionResponse.md @@ -0,0 +1,14 @@ + + +# DescribeTableVersionResponse + +Response containing the table version information + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**version** | [**TableVersion**](TableVersion.md) | The table version information | | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTransactionRequest.md b/java/lance-namespace-async-client/docs/DescribeTransactionRequest.md new file mode 100644 index 000000000..f8c163e77 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTransactionRequest.md @@ -0,0 +1,15 @@ + + +# DescribeTransactionRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DescribeTransactionResponse.md b/java/lance-namespace-async-client/docs/DescribeTransactionResponse.md new file mode 100644 index 000000000..3c496cbc4 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DescribeTransactionResponse.md @@ -0,0 +1,14 @@ + + +# DescribeTransactionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **String** | The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Queued: the transaction is queued and not yet started - Running: the transaction is currently running - Succeeded: the transaction has completed successfully - Failed: the transaction has failed - Canceled: the transaction was canceled | | +|**properties** | **Map<String, String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DropNamespaceRequest.md b/java/lance-namespace-async-client/docs/DropNamespaceRequest.md new file mode 100644 index 000000000..e615e179d --- /dev/null +++ b/java/lance-namespace-async-client/docs/DropNamespaceRequest.md @@ -0,0 +1,17 @@ + + +# DropNamespaceRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**mode** | **String** | The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Fail (default): the server must return 400 indicating the namespace to drop does not exist. - Skip: the server must return 204 indicating the drop operation has succeeded. | [optional] | +|**behavior** | **String** | The behavior for dropping a namespace. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Restrict (default): the namespace should not contain any table or child namespace when drop is initiated. If tables are found, the server should return error and not drop the namespace. - Cascade: all tables and child namespaces in the namespace are dropped before the namespace is dropped. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DropNamespaceResponse.md b/java/lance-namespace-async-client/docs/DropNamespaceResponse.md new file mode 100644 index 000000000..6eacbdec9 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DropNamespaceResponse.md @@ -0,0 +1,14 @@ + + +# DropNamespaceResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**properties** | **Map<String, String>** | If the implementation does not support namespace properties, it should return null for this field. Otherwise it should return the properties. | [optional] | +|**transactionId** | **List<String>** | If present, indicating the operation is long running and should be tracked using DescribeTransaction | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DropTableIndexRequest.md b/java/lance-namespace-async-client/docs/DropTableIndexRequest.md new file mode 100644 index 000000000..36a69b6b7 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DropTableIndexRequest.md @@ -0,0 +1,16 @@ + + +# DropTableIndexRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**indexName** | **String** | Name of the index to drop | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DropTableIndexResponse.md b/java/lance-namespace-async-client/docs/DropTableIndexResponse.md new file mode 100644 index 000000000..bae62a1f6 --- /dev/null +++ b/java/lance-namespace-async-client/docs/DropTableIndexResponse.md @@ -0,0 +1,14 @@ + + +# DropTableIndexResponse + +Response for drop index operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DropTableRequest.md b/java/lance-namespace-async-client/docs/DropTableRequest.md new file mode 100644 index 000000000..39789434e --- /dev/null +++ b/java/lance-namespace-async-client/docs/DropTableRequest.md @@ -0,0 +1,16 @@ + + +# DropTableRequest + +If the table and its data can be immediately deleted, return information of the deleted table. Otherwise, return a transaction ID that client can use to track deletion progress. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/DropTableResponse.md b/java/lance-namespace-async-client/docs/DropTableResponse.md new file mode 100644 index 000000000..bbc9a98eb --- /dev/null +++ b/java/lance-namespace-async-client/docs/DropTableResponse.md @@ -0,0 +1,16 @@ + + +# DropTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**id** | **List<String>** | | [optional] | +|**location** | **String** | | [optional] | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ErrorResponse.md b/java/lance-namespace-async-client/docs/ErrorResponse.md new file mode 100644 index 000000000..dc84633d2 --- /dev/null +++ b/java/lance-namespace-async-client/docs/ErrorResponse.md @@ -0,0 +1,17 @@ + + +# ErrorResponse + +Common JSON error response model + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**error** | **String** | A brief, human-readable message about the error. | [optional] | +|**code** | **Integer** | Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The specified transaction does not exist 11 - TableVersionNotFound: The specified table version does not exist 12 - TableColumnNotFound: The specified table column does not exist 13 - InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - InvalidTableState: Table is in an invalid state for the operation 20 - TableSchemaValidationError: Table schema validation failed | | +|**detail** | **String** | An optional human-readable explanation of the error. This can be used to record additional information such as stack trace. | [optional] | +|**instance** | **String** | A string that identifies the specific occurrence of the error. This can be a URI, a request or response ID, or anything that the implementation can recognize to trace specific occurrence of the error. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ExplainTableQueryPlanRequest.md b/java/lance-namespace-async-client/docs/ExplainTableQueryPlanRequest.md new file mode 100644 index 000000000..a6c0cbf5b --- /dev/null +++ b/java/lance-namespace-async-client/docs/ExplainTableQueryPlanRequest.md @@ -0,0 +1,17 @@ + + +# ExplainTableQueryPlanRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**query** | [**QueryTableRequest**](QueryTableRequest.md) | | | +|**verbose** | **Boolean** | Whether to return verbose explanation | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ExplainTableQueryPlanResponse.md b/java/lance-namespace-async-client/docs/ExplainTableQueryPlanResponse.md new file mode 100644 index 000000000..0da336dfe --- /dev/null +++ b/java/lance-namespace-async-client/docs/ExplainTableQueryPlanResponse.md @@ -0,0 +1,13 @@ + + +# ExplainTableQueryPlanResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**plan** | **String** | Human-readable query execution plan | | + + + diff --git a/java/lance-namespace-async-client/docs/FragmentStats.md b/java/lance-namespace-async-client/docs/FragmentStats.md new file mode 100644 index 000000000..803b68456 --- /dev/null +++ b/java/lance-namespace-async-client/docs/FragmentStats.md @@ -0,0 +1,15 @@ + + +# FragmentStats + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**numFragments** | **Long** | The number of fragments in the table | | +|**numSmallFragments** | **Long** | The number of uncompacted fragments in the table | | +|**lengths** | [**FragmentSummary**](FragmentSummary.md) | Statistics on the number of rows in the table fragments | | + + + diff --git a/java/lance-namespace-async-client/docs/FragmentSummary.md b/java/lance-namespace-async-client/docs/FragmentSummary.md new file mode 100644 index 000000000..b86d69b70 --- /dev/null +++ b/java/lance-namespace-async-client/docs/FragmentSummary.md @@ -0,0 +1,19 @@ + + +# FragmentSummary + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**min** | **Long** | | | +|**max** | **Long** | | | +|**mean** | **Long** | | | +|**p25** | **Long** | | | +|**p50** | **Long** | | | +|**p75** | **Long** | | | +|**p99** | **Long** | | | + + + diff --git a/java/lance-namespace-async-client/docs/FtsQuery.md b/java/lance-namespace-async-client/docs/FtsQuery.md new file mode 100644 index 000000000..f080383b1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/FtsQuery.md @@ -0,0 +1,18 @@ + + +# FtsQuery + +Full-text search query. Exactly one query type field must be provided. This structure follows the same pattern as AlterTransactionAction to minimize differences and compatibility issues across codegen in different languages. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**match** | [**MatchQuery**](MatchQuery.md) | | [optional] | +|**phrase** | [**PhraseQuery**](PhraseQuery.md) | | [optional] | +|**boost** | [**BoostQuery**](BoostQuery.md) | | [optional] | +|**multiMatch** | [**MultiMatchQuery**](MultiMatchQuery.md) | | [optional] | +|**_boolean** | [**BooleanQuery**](BooleanQuery.md) | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/GetTableStatsRequest.md b/java/lance-namespace-async-client/docs/GetTableStatsRequest.md new file mode 100644 index 000000000..89057661f --- /dev/null +++ b/java/lance-namespace-async-client/docs/GetTableStatsRequest.md @@ -0,0 +1,15 @@ + + +# GetTableStatsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/GetTableStatsResponse.md b/java/lance-namespace-async-client/docs/GetTableStatsResponse.md new file mode 100644 index 000000000..b9efb81e3 --- /dev/null +++ b/java/lance-namespace-async-client/docs/GetTableStatsResponse.md @@ -0,0 +1,16 @@ + + +# GetTableStatsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totalBytes** | **Long** | The total number of bytes in the table | | +|**numRows** | **Long** | The number of rows in the table | | +|**numIndices** | **Long** | The number of indices in the table | | +|**fragmentStats** | [**FragmentStats**](FragmentStats.md) | Statistics on table fragments | | + + + diff --git a/java/lance-namespace-async-client/docs/GetTableTagVersionRequest.md b/java/lance-namespace-async-client/docs/GetTableTagVersionRequest.md new file mode 100644 index 000000000..db878da20 --- /dev/null +++ b/java/lance-namespace-async-client/docs/GetTableTagVersionRequest.md @@ -0,0 +1,16 @@ + + +# GetTableTagVersionRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**tag** | **String** | Name of the tag to get version for | | + + + diff --git a/java/lance-namespace-async-client/docs/GetTableTagVersionResponse.md b/java/lance-namespace-async-client/docs/GetTableTagVersionResponse.md new file mode 100644 index 000000000..90de59aa5 --- /dev/null +++ b/java/lance-namespace-async-client/docs/GetTableTagVersionResponse.md @@ -0,0 +1,13 @@ + + +# GetTableTagVersionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**version** | **Long** | version number that the tag points to | | + + + diff --git a/java/lance-namespace-async-client/docs/Identity.md b/java/lance-namespace-async-client/docs/Identity.md new file mode 100644 index 000000000..a543e8275 --- /dev/null +++ b/java/lance-namespace-async-client/docs/Identity.md @@ -0,0 +1,15 @@ + + +# Identity + +Identity information of a request. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**apiKey** | **String** | API key for authentication. REST NAMESPACE ONLY This is passed via the `x-api-key` header. | [optional] | +|**authToken** | **String** | Bearer token for authentication. REST NAMESPACE ONLY This is passed via the `Authorization` header with the Bearer scheme (e.g., `Bearer <token>`). | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/IndexApi.md b/java/lance-namespace-async-client/docs/IndexApi.md new file mode 100644 index 000000000..73bda3c23 --- /dev/null +++ b/java/lance-namespace-async-client/docs/IndexApi.md @@ -0,0 +1,987 @@ +# IndexApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createTableIndex**](IndexApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | +| [**createTableIndexWithHttpInfo**](IndexApi.md#createTableIndexWithHttpInfo) | **POST** /v1/table/{id}/create_index | Create an index on a table | +| [**createTableScalarIndex**](IndexApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | +| [**createTableScalarIndexWithHttpInfo**](IndexApi.md#createTableScalarIndexWithHttpInfo) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | +| [**describeTableIndexStats**](IndexApi.md#describeTableIndexStats) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics | +| [**describeTableIndexStatsWithHttpInfo**](IndexApi.md#describeTableIndexStatsWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics | +| [**dropTableIndex**](IndexApi.md#dropTableIndex) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index | +| [**dropTableIndexWithHttpInfo**](IndexApi.md#dropTableIndexWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index | +| [**listTableIndices**](IndexApi.md#listTableIndices) | **POST** /v1/table/{id}/index/list | List indexes on a table | +| [**listTableIndicesWithHttpInfo**](IndexApi.md#listTableIndicesWithHttpInfo) | **POST** /v1/table/{id}/index/list | List indexes on a table | + + + +## createTableIndex + +> CompletableFuture createTableIndex(id, createTableIndexRequest, delimiter) + +Create an index on a table + +Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableIndex(id, createTableIndexRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#createTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableIndexResponse**](CreateTableIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableIndexWithHttpInfo + +> CompletableFuture> createTableIndex createTableIndexWithHttpInfo(id, createTableIndexRequest, delimiter) + +Create an index on a table + +Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableIndexWithHttpInfo(id, createTableIndexRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling IndexApi#createTableIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#createTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableScalarIndex + +> CompletableFuture createTableScalarIndex(id, createTableIndexRequest, delimiter) + +Create a scalar index on a table + +Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Scalar index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableScalarIndex(id, createTableIndexRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#createTableScalarIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Scalar index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableScalarIndexResponse**](CreateTableScalarIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Scalar index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableScalarIndexWithHttpInfo + +> CompletableFuture> createTableScalarIndex createTableScalarIndexWithHttpInfo(id, createTableIndexRequest, delimiter) + +Create a scalar index on a table + +Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Scalar index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableScalarIndexWithHttpInfo(id, createTableIndexRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling IndexApi#createTableScalarIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#createTableScalarIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Scalar index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Scalar index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTableIndexStats + +> CompletableFuture describeTableIndexStats(id, indexName, describeTableIndexStatsRequest, delimiter) + +Get table index statistics + +Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to get stats for + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = new DescribeTableIndexStatsRequest(); // DescribeTableIndexStatsRequest | Index stats request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTableIndexStats(id, indexName, describeTableIndexStatsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#describeTableIndexStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to get stats for | | +| **describeTableIndexStatsRequest** | [**DescribeTableIndexStatsRequest**](DescribeTableIndexStatsRequest.md)| Index stats request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTableIndexStatsResponse**](DescribeTableIndexStatsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableIndexStatsWithHttpInfo + +> CompletableFuture> describeTableIndexStats describeTableIndexStatsWithHttpInfo(id, indexName, describeTableIndexStatsRequest, delimiter) + +Get table index statistics + +Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to get stats for + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = new DescribeTableIndexStatsRequest(); // DescribeTableIndexStatsRequest | Index stats request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTableIndexStatsWithHttpInfo(id, indexName, describeTableIndexStatsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling IndexApi#describeTableIndexStats"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#describeTableIndexStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to get stats for | | +| **describeTableIndexStatsRequest** | [**DescribeTableIndexStatsRequest**](DescribeTableIndexStatsRequest.md)| Index stats request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropTableIndex + +> CompletableFuture dropTableIndex(id, indexName, delimiter) + +Drop a specific index + +Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to drop + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropTableIndex(id, indexName, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#dropTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to drop | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropTableIndexResponse**](DropTableIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index drop operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropTableIndexWithHttpInfo + +> CompletableFuture> dropTableIndex dropTableIndexWithHttpInfo(id, indexName, delimiter) + +Drop a specific index + +Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to drop + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropTableIndexWithHttpInfo(id, indexName, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling IndexApi#dropTableIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#dropTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to drop | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index drop operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableIndices + +> CompletableFuture listTableIndices(id, listTableIndicesRequest, delimiter) + +List indexes on a table + +List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ListTableIndicesRequest listTableIndicesRequest = new ListTableIndicesRequest(); // ListTableIndicesRequest | Index list request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.listTableIndices(id, listTableIndicesRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#listTableIndices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **listTableIndicesRequest** | [**ListTableIndicesRequest**](ListTableIndicesRequest.md)| Index list request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**ListTableIndicesResponse**](ListTableIndicesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of indices on the table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableIndicesWithHttpInfo + +> CompletableFuture> listTableIndices listTableIndicesWithHttpInfo(id, listTableIndicesRequest, delimiter) + +List indexes on a table + +List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.IndexApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + IndexApi apiInstance = new IndexApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ListTableIndicesRequest listTableIndicesRequest = new ListTableIndicesRequest(); // ListTableIndicesRequest | Index list request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.listTableIndicesWithHttpInfo(id, listTableIndicesRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling IndexApi#listTableIndices"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling IndexApi#listTableIndices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **listTableIndicesRequest** | [**ListTableIndicesRequest**](ListTableIndicesRequest.md)| Index list request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of indices on the table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/IndexContent.md b/java/lance-namespace-async-client/docs/IndexContent.md new file mode 100644 index 000000000..131589588 --- /dev/null +++ b/java/lance-namespace-async-client/docs/IndexContent.md @@ -0,0 +1,16 @@ + + +# IndexContent + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**indexName** | **String** | Name of the index | | +|**indexUuid** | **String** | Unique identifier for the index | | +|**columns** | **List<String>** | Columns covered by this index | | +|**status** | **String** | Current status of the index | | + + + diff --git a/java/lance-namespace-async-client/docs/InsertIntoTableRequest.md b/java/lance-namespace-async-client/docs/InsertIntoTableRequest.md new file mode 100644 index 000000000..e1c1d1214 --- /dev/null +++ b/java/lance-namespace-async-client/docs/InsertIntoTableRequest.md @@ -0,0 +1,17 @@ + + +# InsertIntoTableRequest + +Request for inserting records into a table, excluding the Arrow IPC stream. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**mode** | **String** | How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/InsertIntoTableResponse.md b/java/lance-namespace-async-client/docs/InsertIntoTableResponse.md new file mode 100644 index 000000000..0b6f70c89 --- /dev/null +++ b/java/lance-namespace-async-client/docs/InsertIntoTableResponse.md @@ -0,0 +1,14 @@ + + +# InsertIntoTableResponse + +Response from inserting records into a table + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/JsonArrowDataType.md b/java/lance-namespace-async-client/docs/JsonArrowDataType.md new file mode 100644 index 000000000..29ba70d7d --- /dev/null +++ b/java/lance-namespace-async-client/docs/JsonArrowDataType.md @@ -0,0 +1,16 @@ + + +# JsonArrowDataType + +JSON representation of an Apache Arrow DataType + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | [**List<JsonArrowField>**](JsonArrowField.md) | Fields for complex types like Struct, Union, etc. | [optional] | +|**length** | **Long** | Length for fixed-size types | [optional] | +|**type** | **String** | The data type name | | + + + diff --git a/java/lance-namespace-async-client/docs/JsonArrowField.md b/java/lance-namespace-async-client/docs/JsonArrowField.md new file mode 100644 index 000000000..3917807a0 --- /dev/null +++ b/java/lance-namespace-async-client/docs/JsonArrowField.md @@ -0,0 +1,17 @@ + + +# JsonArrowField + +JSON representation of an Apache Arrow field. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**metadata** | **Map<String, String>** | | [optional] | +|**name** | **String** | | | +|**nullable** | **Boolean** | | | +|**type** | [**JsonArrowDataType**](JsonArrowDataType.md) | | | + + + diff --git a/java/lance-namespace-async-client/docs/JsonArrowSchema.md b/java/lance-namespace-async-client/docs/JsonArrowSchema.md new file mode 100644 index 000000000..cbff9b533 --- /dev/null +++ b/java/lance-namespace-async-client/docs/JsonArrowSchema.md @@ -0,0 +1,15 @@ + + +# JsonArrowSchema + +JSON representation of a Apache Arrow schema. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | [**List<JsonArrowField>**](JsonArrowField.md) | | | +|**metadata** | **Map<String, String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListNamespacesRequest.md b/java/lance-namespace-async-client/docs/ListNamespacesRequest.md new file mode 100644 index 000000000..dcc8ee6a8 --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListNamespacesRequest.md @@ -0,0 +1,17 @@ + + +# ListNamespacesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | +|**limit** | **Integer** | An inclusive upper bound of the number of results that a caller will receive. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListNamespacesResponse.md b/java/lance-namespace-async-client/docs/ListNamespacesResponse.md new file mode 100644 index 000000000..45da8ba3c --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListNamespacesResponse.md @@ -0,0 +1,14 @@ + + +# ListNamespacesResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**namespaces** | **Set<String>** | The list of names of the child namespaces relative to the parent namespace `id` in the request. | | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTableIndicesRequest.md b/java/lance-namespace-async-client/docs/ListTableIndicesRequest.md new file mode 100644 index 000000000..f5c614e15 --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTableIndicesRequest.md @@ -0,0 +1,18 @@ + + +# ListTableIndicesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The namespace identifier | [optional] | +|**version** | **Long** | Optional table version to list indexes from | [optional] | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | +|**limit** | **Integer** | An inclusive upper bound of the number of results that a caller will receive. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTableIndicesResponse.md b/java/lance-namespace-async-client/docs/ListTableIndicesResponse.md new file mode 100644 index 000000000..dc0a1465e --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTableIndicesResponse.md @@ -0,0 +1,14 @@ + + +# ListTableIndicesResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**indexes** | [**List<IndexContent>**](IndexContent.md) | List of indexes on the table | | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTableTagsRequest.md b/java/lance-namespace-async-client/docs/ListTableTagsRequest.md new file mode 100644 index 000000000..b40551985 --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTableTagsRequest.md @@ -0,0 +1,17 @@ + + +# ListTableTagsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The table identifier | [optional] | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | +|**limit** | **Integer** | An inclusive upper bound of the number of results that a caller will receive. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTableTagsResponse.md b/java/lance-namespace-async-client/docs/ListTableTagsResponse.md new file mode 100644 index 000000000..f0ab67ede --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTableTagsResponse.md @@ -0,0 +1,15 @@ + + +# ListTableTagsResponse + +Response containing table tags + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tags** | [**Map<String, TagContents>**](TagContents.md) | Map of tag names to their contents | | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTableVersionsRequest.md b/java/lance-namespace-async-client/docs/ListTableVersionsRequest.md new file mode 100644 index 000000000..a68855f77 --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTableVersionsRequest.md @@ -0,0 +1,18 @@ + + +# ListTableVersionsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | +|**limit** | **Integer** | An inclusive upper bound of the number of results that a caller will receive. | [optional] | +|**descending** | **Boolean** | When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTableVersionsResponse.md b/java/lance-namespace-async-client/docs/ListTableVersionsResponse.md new file mode 100644 index 000000000..91107ba7a --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTableVersionsResponse.md @@ -0,0 +1,14 @@ + + +# ListTableVersionsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**versions** | [**List<TableVersion>**](TableVersion.md) | List of table versions. When `descending=true`, guaranteed to be ordered from latest to oldest. Otherwise, ordering is implementation-defined. | | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTablesRequest.md b/java/lance-namespace-async-client/docs/ListTablesRequest.md new file mode 100644 index 000000000..e9da9f756 --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTablesRequest.md @@ -0,0 +1,17 @@ + + +# ListTablesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | +|**limit** | **Integer** | An inclusive upper bound of the number of results that a caller will receive. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/ListTablesResponse.md b/java/lance-namespace-async-client/docs/ListTablesResponse.md new file mode 100644 index 000000000..98897718e --- /dev/null +++ b/java/lance-namespace-async-client/docs/ListTablesResponse.md @@ -0,0 +1,14 @@ + + +# ListTablesResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tables** | **Set<String>** | The list of names of all the tables under the connected namespace implementation. This should recursively list all the tables in all child namespaces. Each string in the list is the full identifier in string form. | | +|**pageToken** | **String** | An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/MatchQuery.md b/java/lance-namespace-async-client/docs/MatchQuery.md new file mode 100644 index 000000000..db14a6a04 --- /dev/null +++ b/java/lance-namespace-async-client/docs/MatchQuery.md @@ -0,0 +1,19 @@ + + +# MatchQuery + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**boost** | **Float** | | [optional] | +|**column** | **String** | | [optional] | +|**fuzziness** | **Integer** | | [optional] | +|**maxExpansions** | **Integer** | The maximum number of terms to expand for fuzzy matching. Default to 50. | [optional] | +|**operator** | **String** | The operator to use for combining terms. Case insensitive, supports both PascalCase and snake_case. Valid values are: - And: All terms must match. - Or: At least one term must match. | [optional] | +|**prefixLength** | **Integer** | The number of beginning characters being unchanged for fuzzy matching. Default to 0. | [optional] | +|**terms** | **String** | | | + + + diff --git a/java/lance-namespace-async-client/docs/MergeInsertIntoTableRequest.md b/java/lance-namespace-async-client/docs/MergeInsertIntoTableRequest.md new file mode 100644 index 000000000..4cd78c210 --- /dev/null +++ b/java/lance-namespace-async-client/docs/MergeInsertIntoTableRequest.md @@ -0,0 +1,24 @@ + + +# MergeInsertIntoTableRequest + +Request for merging or inserting records into a table, excluding the Arrow IPC stream. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**on** | **String** | Column name to use for matching rows (required) | [optional] | +|**whenMatchedUpdateAll** | **Boolean** | Update all columns when rows match | [optional] | +|**whenMatchedUpdateAllFilt** | **String** | The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true | [optional] | +|**whenNotMatchedInsertAll** | **Boolean** | Insert all columns when rows don't match | [optional] | +|**whenNotMatchedBySourceDelete** | **Boolean** | Delete all rows from target table that don't match a row in the source table | [optional] | +|**whenNotMatchedBySourceDeleteFilt** | **String** | Delete rows from the target table if there is no match AND the SQL expression evaluates to true | [optional] | +|**timeout** | **String** | Timeout for the operation (e.g., \"30s\", \"5m\") | [optional] | +|**useIndex** | **Boolean** | Whether to use index for matching rows | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/MergeInsertIntoTableResponse.md b/java/lance-namespace-async-client/docs/MergeInsertIntoTableResponse.md new file mode 100644 index 000000000..0edcc90b4 --- /dev/null +++ b/java/lance-namespace-async-client/docs/MergeInsertIntoTableResponse.md @@ -0,0 +1,18 @@ + + +# MergeInsertIntoTableResponse + +Response from merge insert operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**numUpdatedRows** | **Long** | Number of rows updated | [optional] | +|**numInsertedRows** | **Long** | Number of rows inserted | [optional] | +|**numDeletedRows** | **Long** | Number of rows deleted (typically 0 for merge insert) | [optional] | +|**version** | **Long** | The commit version associated with the operation | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/MetadataApi.md b/java/lance-namespace-async-client/docs/MetadataApi.md new file mode 100644 index 000000000..ba70a9ca6 --- /dev/null +++ b/java/lance-namespace-async-client/docs/MetadataApi.md @@ -0,0 +1,7076 @@ +# MetadataApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**alterTableAlterColumns**](MetadataApi.md#alterTableAlterColumns) | **POST** /v1/table/{id}/alter_columns | Modify existing columns | +| [**alterTableAlterColumnsWithHttpInfo**](MetadataApi.md#alterTableAlterColumnsWithHttpInfo) | **POST** /v1/table/{id}/alter_columns | Modify existing columns | +| [**alterTableDropColumns**](MetadataApi.md#alterTableDropColumns) | **POST** /v1/table/{id}/drop_columns | Remove columns from table | +| [**alterTableDropColumnsWithHttpInfo**](MetadataApi.md#alterTableDropColumnsWithHttpInfo) | **POST** /v1/table/{id}/drop_columns | Remove columns from table | +| [**alterTransaction**](MetadataApi.md#alterTransaction) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. | +| [**alterTransactionWithHttpInfo**](MetadataApi.md#alterTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. | +| [**batchCreateTableVersions**](MetadataApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | +| [**batchCreateTableVersionsWithHttpInfo**](MetadataApi.md#batchCreateTableVersionsWithHttpInfo) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | +| [**batchDeleteTableVersions**](MetadataApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records | +| [**batchDeleteTableVersionsWithHttpInfo**](MetadataApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records | +| [**createEmptyTable**](MetadataApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table | +| [**createEmptyTableWithHttpInfo**](MetadataApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table | +| [**createNamespace**](MetadataApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace | +| [**createNamespaceWithHttpInfo**](MetadataApi.md#createNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/create | Create a new namespace | +| [**createTableIndex**](MetadataApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | +| [**createTableIndexWithHttpInfo**](MetadataApi.md#createTableIndexWithHttpInfo) | **POST** /v1/table/{id}/create_index | Create an index on a table | +| [**createTableScalarIndex**](MetadataApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | +| [**createTableScalarIndexWithHttpInfo**](MetadataApi.md#createTableScalarIndexWithHttpInfo) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | +| [**createTableTag**](MetadataApi.md#createTableTag) | **POST** /v1/table/{id}/tags/create | Create a new tag | +| [**createTableTagWithHttpInfo**](MetadataApi.md#createTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/create | Create a new tag | +| [**createTableVersion**](MetadataApi.md#createTableVersion) | **POST** /v1/table/{id}/version/create | Create a new table version | +| [**createTableVersionWithHttpInfo**](MetadataApi.md#createTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/create | Create a new table version | +| [**declareTable**](MetadataApi.md#declareTable) | **POST** /v1/table/{id}/declare | Declare a table | +| [**declareTableWithHttpInfo**](MetadataApi.md#declareTableWithHttpInfo) | **POST** /v1/table/{id}/declare | Declare a table | +| [**deleteTableTag**](MetadataApi.md#deleteTableTag) | **POST** /v1/table/{id}/tags/delete | Delete a tag | +| [**deleteTableTagWithHttpInfo**](MetadataApi.md#deleteTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/delete | Delete a tag | +| [**deregisterTable**](MetadataApi.md#deregisterTable) | **POST** /v1/table/{id}/deregister | Deregister a table | +| [**deregisterTableWithHttpInfo**](MetadataApi.md#deregisterTableWithHttpInfo) | **POST** /v1/table/{id}/deregister | Deregister a table | +| [**describeNamespace**](MetadataApi.md#describeNamespace) | **POST** /v1/namespace/{id}/describe | Describe a namespace | +| [**describeNamespaceWithHttpInfo**](MetadataApi.md#describeNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/describe | Describe a namespace | +| [**describeTable**](MetadataApi.md#describeTable) | **POST** /v1/table/{id}/describe | Describe information of a table | +| [**describeTableWithHttpInfo**](MetadataApi.md#describeTableWithHttpInfo) | **POST** /v1/table/{id}/describe | Describe information of a table | +| [**describeTableIndexStats**](MetadataApi.md#describeTableIndexStats) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics | +| [**describeTableIndexStatsWithHttpInfo**](MetadataApi.md#describeTableIndexStatsWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics | +| [**describeTableVersion**](MetadataApi.md#describeTableVersion) | **POST** /v1/table/{id}/version/describe | Describe a specific table version | +| [**describeTableVersionWithHttpInfo**](MetadataApi.md#describeTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/describe | Describe a specific table version | +| [**describeTransaction**](MetadataApi.md#describeTransaction) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction | +| [**describeTransactionWithHttpInfo**](MetadataApi.md#describeTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction | +| [**dropNamespace**](MetadataApi.md#dropNamespace) | **POST** /v1/namespace/{id}/drop | Drop a namespace | +| [**dropNamespaceWithHttpInfo**](MetadataApi.md#dropNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/drop | Drop a namespace | +| [**dropTable**](MetadataApi.md#dropTable) | **POST** /v1/table/{id}/drop | Drop a table | +| [**dropTableWithHttpInfo**](MetadataApi.md#dropTableWithHttpInfo) | **POST** /v1/table/{id}/drop | Drop a table | +| [**dropTableIndex**](MetadataApi.md#dropTableIndex) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index | +| [**dropTableIndexWithHttpInfo**](MetadataApi.md#dropTableIndexWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index | +| [**getTableStats**](MetadataApi.md#getTableStats) | **POST** /v1/table/{id}/stats | Get table statistics | +| [**getTableStatsWithHttpInfo**](MetadataApi.md#getTableStatsWithHttpInfo) | **POST** /v1/table/{id}/stats | Get table statistics | +| [**getTableTagVersion**](MetadataApi.md#getTableTagVersion) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag | +| [**getTableTagVersionWithHttpInfo**](MetadataApi.md#getTableTagVersionWithHttpInfo) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag | +| [**listNamespaces**](MetadataApi.md#listNamespaces) | **GET** /v1/namespace/{id}/list | List namespaces | +| [**listNamespacesWithHttpInfo**](MetadataApi.md#listNamespacesWithHttpInfo) | **GET** /v1/namespace/{id}/list | List namespaces | +| [**listTableIndices**](MetadataApi.md#listTableIndices) | **POST** /v1/table/{id}/index/list | List indexes on a table | +| [**listTableIndicesWithHttpInfo**](MetadataApi.md#listTableIndicesWithHttpInfo) | **POST** /v1/table/{id}/index/list | List indexes on a table | +| [**listTableTags**](MetadataApi.md#listTableTags) | **POST** /v1/table/{id}/tags/list | List all tags for a table | +| [**listTableTagsWithHttpInfo**](MetadataApi.md#listTableTagsWithHttpInfo) | **POST** /v1/table/{id}/tags/list | List all tags for a table | +| [**listTableVersions**](MetadataApi.md#listTableVersions) | **POST** /v1/table/{id}/version/list | List all versions of a table | +| [**listTableVersionsWithHttpInfo**](MetadataApi.md#listTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/list | List all versions of a table | +| [**listTables**](MetadataApi.md#listTables) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace | +| [**listTablesWithHttpInfo**](MetadataApi.md#listTablesWithHttpInfo) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace | +| [**namespaceExists**](MetadataApi.md#namespaceExists) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists | +| [**namespaceExistsWithHttpInfo**](MetadataApi.md#namespaceExistsWithHttpInfo) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists | +| [**registerTable**](MetadataApi.md#registerTable) | **POST** /v1/table/{id}/register | Register a table to a namespace | +| [**registerTableWithHttpInfo**](MetadataApi.md#registerTableWithHttpInfo) | **POST** /v1/table/{id}/register | Register a table to a namespace | +| [**renameTable**](MetadataApi.md#renameTable) | **POST** /v1/table/{id}/rename | Rename a table | +| [**renameTableWithHttpInfo**](MetadataApi.md#renameTableWithHttpInfo) | **POST** /v1/table/{id}/rename | Rename a table | +| [**restoreTable**](MetadataApi.md#restoreTable) | **POST** /v1/table/{id}/restore | Restore table to a specific version | +| [**restoreTableWithHttpInfo**](MetadataApi.md#restoreTableWithHttpInfo) | **POST** /v1/table/{id}/restore | Restore table to a specific version | +| [**tableExists**](MetadataApi.md#tableExists) | **POST** /v1/table/{id}/exists | Check if a table exists | +| [**tableExistsWithHttpInfo**](MetadataApi.md#tableExistsWithHttpInfo) | **POST** /v1/table/{id}/exists | Check if a table exists | +| [**updateTableSchemaMetadata**](MetadataApi.md#updateTableSchemaMetadata) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata | +| [**updateTableSchemaMetadataWithHttpInfo**](MetadataApi.md#updateTableSchemaMetadataWithHttpInfo) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata | +| [**updateTableTag**](MetadataApi.md#updateTableTag) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version | +| [**updateTableTagWithHttpInfo**](MetadataApi.md#updateTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version | + + + +## alterTableAlterColumns + +> CompletableFuture alterTableAlterColumns(id, alterTableAlterColumnsRequest, delimiter) + +Modify existing columns + +Modify existing columns in table `id`, such as renaming or changing data types. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAlterColumnsRequest alterTableAlterColumnsRequest = new AlterTableAlterColumnsRequest(); // AlterTableAlterColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableAlterColumns(id, alterTableAlterColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#alterTableAlterColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAlterColumnsRequest** | [**AlterTableAlterColumnsRequest**](AlterTableAlterColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTableAlterColumnsResponse**](AlterTableAlterColumnsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Alter columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTableAlterColumnsWithHttpInfo + +> CompletableFuture> alterTableAlterColumns alterTableAlterColumnsWithHttpInfo(id, alterTableAlterColumnsRequest, delimiter) + +Modify existing columns + +Modify existing columns in table `id`, such as renaming or changing data types. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAlterColumnsRequest alterTableAlterColumnsRequest = new AlterTableAlterColumnsRequest(); // AlterTableAlterColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTableAlterColumnsWithHttpInfo(id, alterTableAlterColumnsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#alterTableAlterColumns"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#alterTableAlterColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAlterColumnsRequest** | [**AlterTableAlterColumnsRequest**](AlterTableAlterColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Alter columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## alterTableDropColumns + +> CompletableFuture alterTableDropColumns(id, alterTableDropColumnsRequest, delimiter) + +Remove columns from table + +Remove specified columns from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableDropColumnsRequest alterTableDropColumnsRequest = new AlterTableDropColumnsRequest(); // AlterTableDropColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableDropColumns(id, alterTableDropColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#alterTableDropColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableDropColumnsRequest** | [**AlterTableDropColumnsRequest**](AlterTableDropColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTableDropColumnsResponse**](AlterTableDropColumnsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Drop columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTableDropColumnsWithHttpInfo + +> CompletableFuture> alterTableDropColumns alterTableDropColumnsWithHttpInfo(id, alterTableDropColumnsRequest, delimiter) + +Remove columns from table + +Remove specified columns from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableDropColumnsRequest alterTableDropColumnsRequest = new AlterTableDropColumnsRequest(); // AlterTableDropColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTableDropColumnsWithHttpInfo(id, alterTableDropColumnsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#alterTableDropColumns"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#alterTableDropColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableDropColumnsRequest** | [**AlterTableDropColumnsRequest**](AlterTableDropColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Drop columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## alterTransaction + +> CompletableFuture alterTransaction(id, alterTransactionRequest, delimiter) + +Alter information of a transaction. + +Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTransactionRequest alterTransactionRequest = new AlterTransactionRequest(); // AlterTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTransaction(id, alterTransactionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#alterTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTransactionRequest** | [**AlterTransactionRequest**](AlterTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTransactionResponse**](AlterTransactionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of AlterTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTransactionWithHttpInfo + +> CompletableFuture> alterTransaction alterTransactionWithHttpInfo(id, alterTransactionRequest, delimiter) + +Alter information of a transaction. + +Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTransactionRequest alterTransactionRequest = new AlterTransactionRequest(); // AlterTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTransactionWithHttpInfo(id, alterTransactionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#alterTransaction"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#alterTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTransactionRequest** | [**AlterTransactionRequest**](AlterTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of AlterTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## batchCreateTableVersions + +> CompletableFuture batchCreateTableVersions(batchCreateTableVersionsRequest, delimiter) + +Atomically create versions for multiple tables + +Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest = new BatchCreateTableVersionsRequest(); // BatchCreateTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.batchCreateTableVersions(batchCreateTableVersionsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#batchCreateTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **batchCreateTableVersionsRequest** | [**BatchCreateTableVersionsRequest**](BatchCreateTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**BatchCreateTableVersionsResponse**](BatchCreateTableVersionsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of atomically creating table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## batchCreateTableVersionsWithHttpInfo + +> CompletableFuture> batchCreateTableVersions batchCreateTableVersionsWithHttpInfo(batchCreateTableVersionsRequest, delimiter) + +Atomically create versions for multiple tables + +Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest = new BatchCreateTableVersionsRequest(); // BatchCreateTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.batchCreateTableVersionsWithHttpInfo(batchCreateTableVersionsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#batchCreateTableVersions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#batchCreateTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **batchCreateTableVersionsRequest** | [**BatchCreateTableVersionsRequest**](BatchCreateTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of atomically creating table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## batchDeleteTableVersions + +> CompletableFuture batchDeleteTableVersions(id, batchDeleteTableVersionsRequest, delimiter) + +Delete table version records + +Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest = new BatchDeleteTableVersionsRequest(); // BatchDeleteTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.batchDeleteTableVersions(id, batchDeleteTableVersionsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#batchDeleteTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **batchDeleteTableVersionsRequest** | [**BatchDeleteTableVersionsRequest**](BatchDeleteTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**BatchDeleteTableVersionsResponse**](BatchDeleteTableVersionsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of deleting table version records | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## batchDeleteTableVersionsWithHttpInfo + +> CompletableFuture> batchDeleteTableVersions batchDeleteTableVersionsWithHttpInfo(id, batchDeleteTableVersionsRequest, delimiter) + +Delete table version records + +Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest = new BatchDeleteTableVersionsRequest(); // BatchDeleteTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.batchDeleteTableVersionsWithHttpInfo(id, batchDeleteTableVersionsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#batchDeleteTableVersions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#batchDeleteTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **batchDeleteTableVersionsRequest** | [**BatchDeleteTableVersionsRequest**](BatchDeleteTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of deleting table version records | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createEmptyTable + +> CompletableFuture createEmptyTable(id, createEmptyTableRequest, delimiter) + +Create an empty table + +Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createEmptyTable(id, createEmptyTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createEmptyTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating an empty table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createEmptyTableWithHttpInfo + +> CompletableFuture> createEmptyTable createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter) + +Create an empty table + +Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#createEmptyTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createEmptyTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating an empty table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createNamespace + +> CompletableFuture createNamespace(id, createNamespaceRequest, delimiter) + +Create a new namespace + +Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateNamespaceRequest createNamespaceRequest = new CreateNamespaceRequest(); // CreateNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createNamespace(id, createNamespaceRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createNamespaceRequest** | [**CreateNamespaceRequest**](CreateNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateNamespaceResponse**](CreateNamespaceResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createNamespaceWithHttpInfo + +> CompletableFuture> createNamespace createNamespaceWithHttpInfo(id, createNamespaceRequest, delimiter) + +Create a new namespace + +Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateNamespaceRequest createNamespaceRequest = new CreateNamespaceRequest(); // CreateNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createNamespaceWithHttpInfo(id, createNamespaceRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#createNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createNamespaceRequest** | [**CreateNamespaceRequest**](CreateNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableIndex + +> CompletableFuture createTableIndex(id, createTableIndexRequest, delimiter) + +Create an index on a table + +Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableIndex(id, createTableIndexRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableIndexResponse**](CreateTableIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableIndexWithHttpInfo + +> CompletableFuture> createTableIndex createTableIndexWithHttpInfo(id, createTableIndexRequest, delimiter) + +Create an index on a table + +Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableIndexWithHttpInfo(id, createTableIndexRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#createTableIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableScalarIndex + +> CompletableFuture createTableScalarIndex(id, createTableIndexRequest, delimiter) + +Create a scalar index on a table + +Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Scalar index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableScalarIndex(id, createTableIndexRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableScalarIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Scalar index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableScalarIndexResponse**](CreateTableScalarIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Scalar index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableScalarIndexWithHttpInfo + +> CompletableFuture> createTableScalarIndex createTableScalarIndexWithHttpInfo(id, createTableIndexRequest, delimiter) + +Create a scalar index on a table + +Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Scalar index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableScalarIndexWithHttpInfo(id, createTableIndexRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#createTableScalarIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableScalarIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Scalar index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Scalar index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableTag + +> CompletableFuture createTableTag(id, createTableTagRequest, delimiter) + +Create a new tag + +Create a new tag for table `id` that points to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableTagRequest createTableTagRequest = new CreateTableTagRequest(); // CreateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableTag(id, createTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableTagRequest** | [**CreateTableTagRequest**](CreateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableTagResponse**](CreateTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Create tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableTagWithHttpInfo + +> CompletableFuture> createTableTag createTableTagWithHttpInfo(id, createTableTagRequest, delimiter) + +Create a new tag + +Create a new tag for table `id` that points to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableTagRequest createTableTagRequest = new CreateTableTagRequest(); // CreateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableTagWithHttpInfo(id, createTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#createTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableTagRequest** | [**CreateTableTagRequest**](CreateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Create tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableVersion + +> CompletableFuture createTableVersion(id, createTableVersionRequest, delimiter) + +Create a new table version + +Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableVersionRequest createTableVersionRequest = new CreateTableVersionRequest(); // CreateTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableVersion(id, createTableVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableVersionRequest** | [**CreateTableVersionRequest**](CreateTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableVersionResponse**](CreateTableVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a table version | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableVersionWithHttpInfo + +> CompletableFuture> createTableVersion createTableVersionWithHttpInfo(id, createTableVersionRequest, delimiter) + +Create a new table version + +Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableVersionRequest createTableVersionRequest = new CreateTableVersionRequest(); // CreateTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableVersionWithHttpInfo(id, createTableVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#createTableVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#createTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableVersionRequest** | [**CreateTableVersionRequest**](CreateTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a table version | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## declareTable + +> CompletableFuture declareTable(id, declareTableRequest, delimiter) + +Declare a table + +Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeclareTableRequest declareTableRequest = new DeclareTableRequest(); // DeclareTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.declareTable(id, declareTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#declareTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **declareTableRequest** | [**DeclareTableRequest**](DeclareTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeclareTableResponse**](DeclareTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when declaring a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## declareTableWithHttpInfo + +> CompletableFuture> declareTable declareTableWithHttpInfo(id, declareTableRequest, delimiter) + +Declare a table + +Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeclareTableRequest declareTableRequest = new DeclareTableRequest(); // DeclareTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.declareTableWithHttpInfo(id, declareTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#declareTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#declareTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **declareTableRequest** | [**DeclareTableRequest**](DeclareTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when declaring a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deleteTableTag + +> CompletableFuture deleteTableTag(id, deleteTableTagRequest, delimiter) + +Delete a tag + +Delete an existing tag from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteTableTagRequest deleteTableTagRequest = new DeleteTableTagRequest(); // DeleteTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deleteTableTag(id, deleteTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#deleteTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteTableTagRequest** | [**DeleteTableTagRequest**](DeleteTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeleteTableTagResponse**](DeleteTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deleteTableTagWithHttpInfo + +> CompletableFuture> deleteTableTag deleteTableTagWithHttpInfo(id, deleteTableTagRequest, delimiter) + +Delete a tag + +Delete an existing tag from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteTableTagRequest deleteTableTagRequest = new DeleteTableTagRequest(); // DeleteTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deleteTableTagWithHttpInfo(id, deleteTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#deleteTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#deleteTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteTableTagRequest** | [**DeleteTableTagRequest**](DeleteTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deregisterTable + +> CompletableFuture deregisterTable(id, deregisterTableRequest, delimiter) + +Deregister a table + +Deregister table `id` from its namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeregisterTableRequest deregisterTableRequest = new DeregisterTableRequest(); // DeregisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deregisterTable(id, deregisterTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#deregisterTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deregisterTableRequest** | [**DeregisterTableRequest**](DeregisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeregisterTableResponse**](DeregisterTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DeregisterTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deregisterTableWithHttpInfo + +> CompletableFuture> deregisterTable deregisterTableWithHttpInfo(id, deregisterTableRequest, delimiter) + +Deregister a table + +Deregister table `id` from its namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeregisterTableRequest deregisterTableRequest = new DeregisterTableRequest(); // DeregisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deregisterTableWithHttpInfo(id, deregisterTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#deregisterTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#deregisterTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deregisterTableRequest** | [**DeregisterTableRequest**](DeregisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DeregisterTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeNamespace + +> CompletableFuture describeNamespace(id, describeNamespaceRequest, delimiter) + +Describe a namespace + +Describe the detailed information for namespace `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeNamespaceRequest describeNamespaceRequest = new DescribeNamespaceRequest(); // DescribeNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeNamespace(id, describeNamespaceRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeNamespaceRequest** | [**DescribeNamespaceRequest**](DescribeNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeNamespaceResponse**](DescribeNamespaceResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeNamespaceWithHttpInfo + +> CompletableFuture> describeNamespace describeNamespaceWithHttpInfo(id, describeNamespaceRequest, delimiter) + +Describe a namespace + +Describe the detailed information for namespace `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeNamespaceRequest describeNamespaceRequest = new DescribeNamespaceRequest(); // DescribeNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeNamespaceWithHttpInfo(id, describeNamespaceRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#describeNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeNamespaceRequest** | [**DescribeNamespaceRequest**](DescribeNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTable + +> CompletableFuture describeTable(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata) + +Describe information of a table + +Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableRequest describeTableRequest = new DescribeTableRequest(); // DescribeTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean withTableUri = false; // Boolean | Whether to include the table URI in the response + Boolean loadDetailedMetadata = false; // Boolean | Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. + try { + CompletableFuture result = apiInstance.describeTable(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableRequest** | [**DescribeTableRequest**](DescribeTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **withTableUri** | **Boolean**| Whether to include the table URI in the response | [optional] [default to false] | +| **loadDetailedMetadata** | **Boolean**| Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. | [optional] [default to false] | + +### Return type + +CompletableFuture<[**DescribeTableResponse**](DescribeTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when loading a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableWithHttpInfo + +> CompletableFuture> describeTable describeTableWithHttpInfo(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata) + +Describe information of a table + +Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableRequest describeTableRequest = new DescribeTableRequest(); // DescribeTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean withTableUri = false; // Boolean | Whether to include the table URI in the response + Boolean loadDetailedMetadata = false; // Boolean | Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. + try { + CompletableFuture> response = apiInstance.describeTableWithHttpInfo(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#describeTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableRequest** | [**DescribeTableRequest**](DescribeTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **withTableUri** | **Boolean**| Whether to include the table URI in the response | [optional] [default to false] | +| **loadDetailedMetadata** | **Boolean**| Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. | [optional] [default to false] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when loading a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTableIndexStats + +> CompletableFuture describeTableIndexStats(id, indexName, describeTableIndexStatsRequest, delimiter) + +Get table index statistics + +Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to get stats for + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = new DescribeTableIndexStatsRequest(); // DescribeTableIndexStatsRequest | Index stats request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTableIndexStats(id, indexName, describeTableIndexStatsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTableIndexStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to get stats for | | +| **describeTableIndexStatsRequest** | [**DescribeTableIndexStatsRequest**](DescribeTableIndexStatsRequest.md)| Index stats request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTableIndexStatsResponse**](DescribeTableIndexStatsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableIndexStatsWithHttpInfo + +> CompletableFuture> describeTableIndexStats describeTableIndexStatsWithHttpInfo(id, indexName, describeTableIndexStatsRequest, delimiter) + +Get table index statistics + +Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to get stats for + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = new DescribeTableIndexStatsRequest(); // DescribeTableIndexStatsRequest | Index stats request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTableIndexStatsWithHttpInfo(id, indexName, describeTableIndexStatsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#describeTableIndexStats"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTableIndexStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to get stats for | | +| **describeTableIndexStatsRequest** | [**DescribeTableIndexStatsRequest**](DescribeTableIndexStatsRequest.md)| Index stats request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTableVersion + +> CompletableFuture describeTableVersion(id, describeTableVersionRequest, delimiter) + +Describe a specific table version + +Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableVersionRequest describeTableVersionRequest = new DescribeTableVersionRequest(); // DescribeTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTableVersion(id, describeTableVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableVersionRequest** | [**DescribeTableVersionRequest**](DescribeTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTableVersionResponse**](DescribeTableVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableVersionWithHttpInfo + +> CompletableFuture> describeTableVersion describeTableVersionWithHttpInfo(id, describeTableVersionRequest, delimiter) + +Describe a specific table version + +Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableVersionRequest describeTableVersionRequest = new DescribeTableVersionRequest(); // DescribeTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTableVersionWithHttpInfo(id, describeTableVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#describeTableVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableVersionRequest** | [**DescribeTableVersionRequest**](DescribeTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTransaction + +> CompletableFuture describeTransaction(id, describeTransactionRequest, delimiter) + +Describe information about a transaction + +Return a detailed information for a given transaction + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTransactionRequest describeTransactionRequest = new DescribeTransactionRequest(); // DescribeTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTransaction(id, describeTransactionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTransactionRequest** | [**DescribeTransactionRequest**](DescribeTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTransactionResponse**](DescribeTransactionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DescribeTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTransactionWithHttpInfo + +> CompletableFuture> describeTransaction describeTransactionWithHttpInfo(id, describeTransactionRequest, delimiter) + +Describe information about a transaction + +Return a detailed information for a given transaction + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTransactionRequest describeTransactionRequest = new DescribeTransactionRequest(); // DescribeTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTransactionWithHttpInfo(id, describeTransactionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#describeTransaction"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#describeTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTransactionRequest** | [**DescribeTransactionRequest**](DescribeTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DescribeTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropNamespace + +> CompletableFuture dropNamespace(id, dropNamespaceRequest, delimiter) + +Drop a namespace + +Drop namespace `id` from its parent namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DropNamespaceRequest dropNamespaceRequest = new DropNamespaceRequest(); // DropNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropNamespace(id, dropNamespaceRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#dropNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **dropNamespaceRequest** | [**DropNamespaceRequest**](DropNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropNamespaceResponse**](DropNamespaceResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of dropping a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropNamespaceWithHttpInfo + +> CompletableFuture> dropNamespace dropNamespaceWithHttpInfo(id, dropNamespaceRequest, delimiter) + +Drop a namespace + +Drop namespace `id` from its parent namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DropNamespaceRequest dropNamespaceRequest = new DropNamespaceRequest(); // DropNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropNamespaceWithHttpInfo(id, dropNamespaceRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#dropNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#dropNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **dropNamespaceRequest** | [**DropNamespaceRequest**](DropNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of dropping a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropTable + +> CompletableFuture dropTable(id, delimiter) + +Drop a table + +Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropTable(id, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#dropTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropTableResponse**](DropTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DropTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropTableWithHttpInfo + +> CompletableFuture> dropTable dropTableWithHttpInfo(id, delimiter) + +Drop a table + +Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropTableWithHttpInfo(id, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#dropTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#dropTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DropTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropTableIndex + +> CompletableFuture dropTableIndex(id, indexName, delimiter) + +Drop a specific index + +Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to drop + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropTableIndex(id, indexName, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#dropTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to drop | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropTableIndexResponse**](DropTableIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index drop operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropTableIndexWithHttpInfo + +> CompletableFuture> dropTableIndex dropTableIndexWithHttpInfo(id, indexName, delimiter) + +Drop a specific index + +Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to drop + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropTableIndexWithHttpInfo(id, indexName, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#dropTableIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#dropTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to drop | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index drop operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## getTableStats + +> CompletableFuture getTableStats(id, getTableStatsRequest, delimiter) + +Get table statistics + +Get statistics for table `id`, including row counts, data sizes, and column statistics. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableStatsRequest getTableStatsRequest = new GetTableStatsRequest(); // GetTableStatsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.getTableStats(id, getTableStatsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#getTableStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableStatsRequest** | [**GetTableStatsRequest**](GetTableStatsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**GetTableStatsResponse**](GetTableStatsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## getTableStatsWithHttpInfo + +> CompletableFuture> getTableStats getTableStatsWithHttpInfo(id, getTableStatsRequest, delimiter) + +Get table statistics + +Get statistics for table `id`, including row counts, data sizes, and column statistics. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableStatsRequest getTableStatsRequest = new GetTableStatsRequest(); // GetTableStatsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.getTableStatsWithHttpInfo(id, getTableStatsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#getTableStats"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#getTableStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableStatsRequest** | [**GetTableStatsRequest**](GetTableStatsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## getTableTagVersion + +> CompletableFuture getTableTagVersion(id, getTableTagVersionRequest, delimiter) + +Get version for a specific tag + +Get the version number that a specific tag points to for table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableTagVersionRequest getTableTagVersionRequest = new GetTableTagVersionRequest(); // GetTableTagVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.getTableTagVersion(id, getTableTagVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#getTableTagVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableTagVersionRequest** | [**GetTableTagVersionRequest**](GetTableTagVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**GetTableTagVersionResponse**](GetTableTagVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tag version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## getTableTagVersionWithHttpInfo + +> CompletableFuture> getTableTagVersion getTableTagVersionWithHttpInfo(id, getTableTagVersionRequest, delimiter) + +Get version for a specific tag + +Get the version number that a specific tag points to for table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableTagVersionRequest getTableTagVersionRequest = new GetTableTagVersionRequest(); // GetTableTagVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.getTableTagVersionWithHttpInfo(id, getTableTagVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#getTableTagVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#getTableTagVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableTagVersionRequest** | [**GetTableTagVersionRequest**](GetTableTagVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tag version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listNamespaces + +> CompletableFuture listNamespaces(id, delimiter, pageToken, limit) + +List namespaces + +List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listNamespaces(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listNamespaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListNamespacesResponse**](ListNamespacesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of namespaces | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listNamespacesWithHttpInfo + +> CompletableFuture> listNamespaces listNamespacesWithHttpInfo(id, delimiter, pageToken, limit) + +List namespaces + +List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listNamespacesWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#listNamespaces"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listNamespaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of namespaces | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableIndices + +> CompletableFuture listTableIndices(id, listTableIndicesRequest, delimiter) + +List indexes on a table + +List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ListTableIndicesRequest listTableIndicesRequest = new ListTableIndicesRequest(); // ListTableIndicesRequest | Index list request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.listTableIndices(id, listTableIndicesRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTableIndices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **listTableIndicesRequest** | [**ListTableIndicesRequest**](ListTableIndicesRequest.md)| Index list request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**ListTableIndicesResponse**](ListTableIndicesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of indices on the table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableIndicesWithHttpInfo + +> CompletableFuture> listTableIndices listTableIndicesWithHttpInfo(id, listTableIndicesRequest, delimiter) + +List indexes on a table + +List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ListTableIndicesRequest listTableIndicesRequest = new ListTableIndicesRequest(); // ListTableIndicesRequest | Index list request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.listTableIndicesWithHttpInfo(id, listTableIndicesRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#listTableIndices"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTableIndices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **listTableIndicesRequest** | [**ListTableIndicesRequest**](ListTableIndicesRequest.md)| Index list request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of indices on the table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableTags + +> CompletableFuture listTableTags(id, delimiter, pageToken, limit) + +List all tags for a table + +List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listTableTags(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTableTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTableTagsResponse**](ListTableTagsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table tags | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableTagsWithHttpInfo + +> CompletableFuture> listTableTags listTableTagsWithHttpInfo(id, delimiter, pageToken, limit) + +List all tags for a table + +List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listTableTagsWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#listTableTags"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTableTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table tags | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableVersions + +> CompletableFuture listTableVersions(id, delimiter, pageToken, limit, descending) + +List all versions of a table + +List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + Boolean descending = true; // Boolean | When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. + try { + CompletableFuture result = apiInstance.listTableVersions(id, delimiter, pageToken, limit, descending); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | +| **descending** | **Boolean**| When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. | [optional] | + +### Return type + +CompletableFuture<[**ListTableVersionsResponse**](ListTableVersionsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableVersionsWithHttpInfo + +> CompletableFuture> listTableVersions listTableVersionsWithHttpInfo(id, delimiter, pageToken, limit, descending) + +List all versions of a table + +List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + Boolean descending = true; // Boolean | When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. + try { + CompletableFuture> response = apiInstance.listTableVersionsWithHttpInfo(id, delimiter, pageToken, limit, descending); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#listTableVersions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | +| **descending** | **Boolean**| When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTables + +> CompletableFuture listTables(id, delimiter, pageToken, limit) + +List tables in a namespace + +List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listTables(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTablesResponse**](ListTablesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTablesWithHttpInfo + +> CompletableFuture> listTables listTablesWithHttpInfo(id, delimiter, pageToken, limit) + +List tables in a namespace + +List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listTablesWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#listTables"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## namespaceExists + +> CompletableFuture namespaceExists(id, namespaceExistsRequest, delimiter) + +Check if a namespace exists + +Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + NamespaceExistsRequest namespaceExistsRequest = new NamespaceExistsRequest(); // NamespaceExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.namespaceExists(id, namespaceExistsRequest, delimiter); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#namespaceExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **namespaceExistsRequest** | [**NamespaceExistsRequest**](NamespaceExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## namespaceExistsWithHttpInfo + +> CompletableFuture> namespaceExists namespaceExistsWithHttpInfo(id, namespaceExistsRequest, delimiter) + +Check if a namespace exists + +Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + NamespaceExistsRequest namespaceExistsRequest = new NamespaceExistsRequest(); // NamespaceExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.namespaceExistsWithHttpInfo(id, namespaceExistsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#namespaceExists"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#namespaceExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **namespaceExistsRequest** | [**NamespaceExistsRequest**](NamespaceExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture> + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## registerTable + +> CompletableFuture registerTable(id, registerTableRequest, delimiter) + +Register a table to a namespace + +Register an existing table at a given storage location as `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RegisterTableRequest registerTableRequest = new RegisterTableRequest(); // RegisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.registerTable(id, registerTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#registerTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **registerTableRequest** | [**RegisterTableRequest**](RegisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**RegisterTableResponse**](RegisterTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when registering a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## registerTableWithHttpInfo + +> CompletableFuture> registerTable registerTableWithHttpInfo(id, registerTableRequest, delimiter) + +Register a table to a namespace + +Register an existing table at a given storage location as `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RegisterTableRequest registerTableRequest = new RegisterTableRequest(); // RegisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.registerTableWithHttpInfo(id, registerTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#registerTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#registerTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **registerTableRequest** | [**RegisterTableRequest**](RegisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when registering a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## renameTable + +> CompletableFuture renameTable(id, renameTableRequest, delimiter) + +Rename a table + +Rename table `id` to a new name. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RenameTableRequest renameTableRequest = new RenameTableRequest(); // RenameTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.renameTable(id, renameTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#renameTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **renameTableRequest** | [**RenameTableRequest**](RenameTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**RenameTableResponse**](RenameTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table rename operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## renameTableWithHttpInfo + +> CompletableFuture> renameTable renameTableWithHttpInfo(id, renameTableRequest, delimiter) + +Rename a table + +Rename table `id` to a new name. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RenameTableRequest renameTableRequest = new RenameTableRequest(); // RenameTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.renameTableWithHttpInfo(id, renameTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#renameTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#renameTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **renameTableRequest** | [**RenameTableRequest**](RenameTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table rename operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## restoreTable + +> CompletableFuture restoreTable(id, restoreTableRequest, delimiter) + +Restore table to a specific version + +Restore table `id` to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RestoreTableRequest restoreTableRequest = new RestoreTableRequest(); // RestoreTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.restoreTable(id, restoreTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#restoreTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **restoreTableRequest** | [**RestoreTableRequest**](RestoreTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**RestoreTableResponse**](RestoreTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table restore operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## restoreTableWithHttpInfo + +> CompletableFuture> restoreTable restoreTableWithHttpInfo(id, restoreTableRequest, delimiter) + +Restore table to a specific version + +Restore table `id` to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RestoreTableRequest restoreTableRequest = new RestoreTableRequest(); // RestoreTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.restoreTableWithHttpInfo(id, restoreTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#restoreTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#restoreTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **restoreTableRequest** | [**RestoreTableRequest**](RestoreTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table restore operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## tableExists + +> CompletableFuture tableExists(id, tableExistsRequest, delimiter) + +Check if a table exists + +Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + TableExistsRequest tableExistsRequest = new TableExistsRequest(); // TableExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.tableExists(id, tableExistsRequest, delimiter); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#tableExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **tableExistsRequest** | [**TableExistsRequest**](TableExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## tableExistsWithHttpInfo + +> CompletableFuture> tableExists tableExistsWithHttpInfo(id, tableExistsRequest, delimiter) + +Check if a table exists + +Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + TableExistsRequest tableExistsRequest = new TableExistsRequest(); // TableExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.tableExistsWithHttpInfo(id, tableExistsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#tableExists"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#tableExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **tableExistsRequest** | [**TableExistsRequest**](TableExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture> + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTableSchemaMetadata + +> CompletableFuture> updateTableSchemaMetadata(id, requestBody, delimiter) + +Update table schema metadata + +Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + Map requestBody = new HashMap(); // Map | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> result = apiInstance.updateTableSchemaMetadata(id, requestBody, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#updateTableSchemaMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **requestBody** | [**Map<String, String>**](String.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**Map<String, String>**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Schema metadata update result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableSchemaMetadataWithHttpInfo + +> CompletableFuture>> updateTableSchemaMetadata updateTableSchemaMetadataWithHttpInfo(id, requestBody, delimiter) + +Update table schema metadata + +Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + Map requestBody = new HashMap(); // Map | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture>> response = apiInstance.updateTableSchemaMetadataWithHttpInfo(id, requestBody, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#updateTableSchemaMetadata"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#updateTableSchemaMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **requestBody** | [**Map<String, String>**](String.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Schema metadata update result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTableTag + +> CompletableFuture updateTableTag(id, updateTableTagRequest, delimiter) + +Update a tag to point to a different version + +Update an existing tag for table `id` to point to a different version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableTagRequest updateTableTagRequest = new UpdateTableTagRequest(); // UpdateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.updateTableTag(id, updateTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#updateTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableTagRequest** | [**UpdateTableTagRequest**](UpdateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**UpdateTableTagResponse**](UpdateTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableTagWithHttpInfo + +> CompletableFuture> updateTableTag updateTableTagWithHttpInfo(id, updateTableTagRequest, delimiter) + +Update a tag to point to a different version + +Update an existing tag for table `id` to point to a different version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.MetadataApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + MetadataApi apiInstance = new MetadataApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableTagRequest updateTableTagRequest = new UpdateTableTagRequest(); // UpdateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.updateTableTagWithHttpInfo(id, updateTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling MetadataApi#updateTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling MetadataApi#updateTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableTagRequest** | [**UpdateTableTagRequest**](UpdateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/MultiMatchQuery.md b/java/lance-namespace-async-client/docs/MultiMatchQuery.md new file mode 100644 index 000000000..c404523a9 --- /dev/null +++ b/java/lance-namespace-async-client/docs/MultiMatchQuery.md @@ -0,0 +1,13 @@ + + +# MultiMatchQuery + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**matchQueries** | [**List<MatchQuery>**](MatchQuery.md) | | | + + + diff --git a/java/lance-namespace-async-client/docs/NamespaceApi.md b/java/lance-namespace-async-client/docs/NamespaceApi.md new file mode 100644 index 000000000..6c090784d --- /dev/null +++ b/java/lance-namespace-async-client/docs/NamespaceApi.md @@ -0,0 +1,1194 @@ +# NamespaceApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createNamespace**](NamespaceApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace | +| [**createNamespaceWithHttpInfo**](NamespaceApi.md#createNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/create | Create a new namespace | +| [**describeNamespace**](NamespaceApi.md#describeNamespace) | **POST** /v1/namespace/{id}/describe | Describe a namespace | +| [**describeNamespaceWithHttpInfo**](NamespaceApi.md#describeNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/describe | Describe a namespace | +| [**dropNamespace**](NamespaceApi.md#dropNamespace) | **POST** /v1/namespace/{id}/drop | Drop a namespace | +| [**dropNamespaceWithHttpInfo**](NamespaceApi.md#dropNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/drop | Drop a namespace | +| [**listNamespaces**](NamespaceApi.md#listNamespaces) | **GET** /v1/namespace/{id}/list | List namespaces | +| [**listNamespacesWithHttpInfo**](NamespaceApi.md#listNamespacesWithHttpInfo) | **GET** /v1/namespace/{id}/list | List namespaces | +| [**listTables**](NamespaceApi.md#listTables) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace | +| [**listTablesWithHttpInfo**](NamespaceApi.md#listTablesWithHttpInfo) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace | +| [**namespaceExists**](NamespaceApi.md#namespaceExists) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists | +| [**namespaceExistsWithHttpInfo**](NamespaceApi.md#namespaceExistsWithHttpInfo) | **POST** /v1/namespace/{id}/exists | Check if a namespace exists | + + + +## createNamespace + +> CompletableFuture createNamespace(id, createNamespaceRequest, delimiter) + +Create a new namespace + +Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateNamespaceRequest createNamespaceRequest = new CreateNamespaceRequest(); // CreateNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createNamespace(id, createNamespaceRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#createNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createNamespaceRequest** | [**CreateNamespaceRequest**](CreateNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateNamespaceResponse**](CreateNamespaceResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createNamespaceWithHttpInfo + +> CompletableFuture> createNamespace createNamespaceWithHttpInfo(id, createNamespaceRequest, delimiter) + +Create a new namespace + +Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateNamespaceRequest createNamespaceRequest = new CreateNamespaceRequest(); // CreateNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createNamespaceWithHttpInfo(id, createNamespaceRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling NamespaceApi#createNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#createNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createNamespaceRequest** | [**CreateNamespaceRequest**](CreateNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeNamespace + +> CompletableFuture describeNamespace(id, describeNamespaceRequest, delimiter) + +Describe a namespace + +Describe the detailed information for namespace `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeNamespaceRequest describeNamespaceRequest = new DescribeNamespaceRequest(); // DescribeNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeNamespace(id, describeNamespaceRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#describeNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeNamespaceRequest** | [**DescribeNamespaceRequest**](DescribeNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeNamespaceResponse**](DescribeNamespaceResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeNamespaceWithHttpInfo + +> CompletableFuture> describeNamespace describeNamespaceWithHttpInfo(id, describeNamespaceRequest, delimiter) + +Describe a namespace + +Describe the detailed information for namespace `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeNamespaceRequest describeNamespaceRequest = new DescribeNamespaceRequest(); // DescribeNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeNamespaceWithHttpInfo(id, describeNamespaceRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling NamespaceApi#describeNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#describeNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeNamespaceRequest** | [**DescribeNamespaceRequest**](DescribeNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropNamespace + +> CompletableFuture dropNamespace(id, dropNamespaceRequest, delimiter) + +Drop a namespace + +Drop namespace `id` from its parent namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DropNamespaceRequest dropNamespaceRequest = new DropNamespaceRequest(); // DropNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropNamespace(id, dropNamespaceRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#dropNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **dropNamespaceRequest** | [**DropNamespaceRequest**](DropNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropNamespaceResponse**](DropNamespaceResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of dropping a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropNamespaceWithHttpInfo + +> CompletableFuture> dropNamespace dropNamespaceWithHttpInfo(id, dropNamespaceRequest, delimiter) + +Drop a namespace + +Drop namespace `id` from its parent namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DropNamespaceRequest dropNamespaceRequest = new DropNamespaceRequest(); // DropNamespaceRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropNamespaceWithHttpInfo(id, dropNamespaceRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling NamespaceApi#dropNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#dropNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **dropNamespaceRequest** | [**DropNamespaceRequest**](DropNamespaceRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of dropping a namespace | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listNamespaces + +> CompletableFuture listNamespaces(id, delimiter, pageToken, limit) + +List namespaces + +List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listNamespaces(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#listNamespaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListNamespacesResponse**](ListNamespacesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of namespaces | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listNamespacesWithHttpInfo + +> CompletableFuture> listNamespaces listNamespacesWithHttpInfo(id, delimiter, pageToken, limit) + +List namespaces + +List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listNamespacesWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling NamespaceApi#listNamespaces"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#listNamespaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of namespaces | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTables + +> CompletableFuture listTables(id, delimiter, pageToken, limit) + +List tables in a namespace + +List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listTables(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTablesResponse**](ListTablesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTablesWithHttpInfo + +> CompletableFuture> listTables listTablesWithHttpInfo(id, delimiter, pageToken, limit) + +List tables in a namespace + +List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listTablesWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling NamespaceApi#listTables"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## namespaceExists + +> CompletableFuture namespaceExists(id, namespaceExistsRequest, delimiter) + +Check if a namespace exists + +Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + NamespaceExistsRequest namespaceExistsRequest = new NamespaceExistsRequest(); // NamespaceExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.namespaceExists(id, namespaceExistsRequest, delimiter); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#namespaceExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **namespaceExistsRequest** | [**NamespaceExistsRequest**](NamespaceExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## namespaceExistsWithHttpInfo + +> CompletableFuture> namespaceExists namespaceExistsWithHttpInfo(id, namespaceExistsRequest, delimiter) + +Check if a namespace exists + +Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.NamespaceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + NamespaceApi apiInstance = new NamespaceApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + NamespaceExistsRequest namespaceExistsRequest = new NamespaceExistsRequest(); // NamespaceExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.namespaceExistsWithHttpInfo(id, namespaceExistsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling NamespaceApi#namespaceExists"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling NamespaceApi#namespaceExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **namespaceExistsRequest** | [**NamespaceExistsRequest**](NamespaceExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture> + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/NamespaceExistsRequest.md b/java/lance-namespace-async-client/docs/NamespaceExistsRequest.md new file mode 100644 index 000000000..c8add1d85 --- /dev/null +++ b/java/lance-namespace-async-client/docs/NamespaceExistsRequest.md @@ -0,0 +1,15 @@ + + +# NamespaceExistsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/NewColumnTransform.md b/java/lance-namespace-async-client/docs/NewColumnTransform.md new file mode 100644 index 000000000..a8a989908 --- /dev/null +++ b/java/lance-namespace-async-client/docs/NewColumnTransform.md @@ -0,0 +1,15 @@ + + +# NewColumnTransform + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the new column | | +|**expression** | **String** | SQL expression to compute the column value (optional if virtual_column is specified) | [optional] | +|**virtualColumn** | [**AddVirtualColumnEntry**](AddVirtualColumnEntry.md) | Virtual column definition (optional if expression is specified) | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/PartitionField.md b/java/lance-namespace-async-client/docs/PartitionField.md new file mode 100644 index 000000000..253ec1a89 --- /dev/null +++ b/java/lance-namespace-async-client/docs/PartitionField.md @@ -0,0 +1,18 @@ + + +# PartitionField + +Partition field definition + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fieldId** | **String** | Unique identifier for this partition field (must not be renamed) | | +|**sourceIds** | **List<Integer>** | Field IDs of the source columns in the schema | | +|**transform** | [**PartitionTransform**](PartitionTransform.md) | Well-known partition transform. Exactly one of transform or expression must be specified. | [optional] | +|**expression** | **String** | DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified. | [optional] | +|**resultType** | [**JsonArrowDataType**](JsonArrowDataType.md) | The output type of the partition value (JsonArrowDataType format) | | + + + diff --git a/java/lance-namespace-async-client/docs/PartitionSpec.md b/java/lance-namespace-async-client/docs/PartitionSpec.md new file mode 100644 index 000000000..f15edea48 --- /dev/null +++ b/java/lance-namespace-async-client/docs/PartitionSpec.md @@ -0,0 +1,15 @@ + + +# PartitionSpec + +Partition spec definition + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Integer** | The spec version ID | | +|**fields** | [**List<PartitionField>**](PartitionField.md) | Array of partition field definitions | | + + + diff --git a/java/lance-namespace-async-client/docs/PartitionTransform.md b/java/lance-namespace-async-client/docs/PartitionTransform.md new file mode 100644 index 000000000..eed545929 --- /dev/null +++ b/java/lance-namespace-async-client/docs/PartitionTransform.md @@ -0,0 +1,16 @@ + + +# PartitionTransform + +Well-known partition transform + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate) | | +|**numBuckets** | **Integer** | Number of buckets for bucket transforms | [optional] | +|**width** | **Integer** | Truncation width for truncate transforms | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/PhraseQuery.md b/java/lance-namespace-async-client/docs/PhraseQuery.md new file mode 100644 index 000000000..9276c38ea --- /dev/null +++ b/java/lance-namespace-async-client/docs/PhraseQuery.md @@ -0,0 +1,15 @@ + + +# PhraseQuery + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**column** | **String** | | [optional] | +|**slop** | **Integer** | | [optional] | +|**terms** | **String** | | | + + + diff --git a/java/lance-namespace-async-client/docs/QueryTableRequest.md b/java/lance-namespace-async-client/docs/QueryTableRequest.md new file mode 100644 index 000000000..6839c87e1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/QueryTableRequest.md @@ -0,0 +1,33 @@ + + +# QueryTableRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**bypassVectorIndex** | **Boolean** | Whether to bypass vector index | [optional] | +|**columns** | [**QueryTableRequestColumns**](QueryTableRequestColumns.md) | | [optional] | +|**distanceType** | **String** | Distance metric to use | [optional] | +|**ef** | **Integer** | Search effort parameter for HNSW index | [optional] | +|**fastSearch** | **Boolean** | Whether to use fast search | [optional] | +|**filter** | **String** | Optional SQL filter expression | [optional] | +|**fullTextQuery** | [**QueryTableRequestFullTextQuery**](QueryTableRequestFullTextQuery.md) | | [optional] | +|**k** | **Integer** | Number of results to return | | +|**lowerBound** | **Float** | Lower bound for search | [optional] | +|**nprobes** | **Integer** | Number of probes for IVF index | [optional] | +|**offset** | **Integer** | Number of results to skip | [optional] | +|**prefilter** | **Boolean** | Whether to apply filtering before vector search | [optional] | +|**refineFactor** | **Integer** | Refine factor for search | [optional] | +|**upperBound** | **Float** | Upper bound for search | [optional] | +|**vector** | [**QueryTableRequestVector**](QueryTableRequestVector.md) | | | +|**vectorColumn** | **String** | Name of the vector column to search | [optional] | +|**version** | **Long** | Table version to query | [optional] | +|**withRowId** | **Boolean** | If true, return the row id as a column called `_rowid` | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/QueryTableRequestColumns.md b/java/lance-namespace-async-client/docs/QueryTableRequestColumns.md new file mode 100644 index 000000000..29a8d51e6 --- /dev/null +++ b/java/lance-namespace-async-client/docs/QueryTableRequestColumns.md @@ -0,0 +1,15 @@ + + +# QueryTableRequestColumns + +Optional columns to return. Provide either column_names or column_aliases, not both. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**columnNames** | **List<String>** | List of column names to return | [optional] | +|**columnAliases** | **Map<String, String>** | Object mapping output aliases to source column names | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/QueryTableRequestFullTextQuery.md b/java/lance-namespace-async-client/docs/QueryTableRequestFullTextQuery.md new file mode 100644 index 000000000..535e92559 --- /dev/null +++ b/java/lance-namespace-async-client/docs/QueryTableRequestFullTextQuery.md @@ -0,0 +1,15 @@ + + +# QueryTableRequestFullTextQuery + +Optional full-text search query. Provide either string_query or structured_query, not both. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stringQuery** | [**StringFtsQuery**](StringFtsQuery.md) | | [optional] | +|**structuredQuery** | [**StructuredFtsQuery**](StructuredFtsQuery.md) | | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/QueryTableRequestVector.md b/java/lance-namespace-async-client/docs/QueryTableRequestVector.md new file mode 100644 index 000000000..04d36e235 --- /dev/null +++ b/java/lance-namespace-async-client/docs/QueryTableRequestVector.md @@ -0,0 +1,15 @@ + + +# QueryTableRequestVector + +Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**singleVector** | **List<Float>** | Single query vector | [optional] | +|**multiVector** | **List<List<Float>>** | Multiple query vectors for batch search | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/RegisterTableRequest.md b/java/lance-namespace-async-client/docs/RegisterTableRequest.md new file mode 100644 index 000000000..06fb64e21 --- /dev/null +++ b/java/lance-namespace-async-client/docs/RegisterTableRequest.md @@ -0,0 +1,18 @@ + + +# RegisterTableRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**location** | **String** | | | +|**mode** | **String** | There are two modes when trying to register a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create (default): the operation fails with 409. * Overwrite: the existing table registration is replaced with the new registration. | [optional] | +|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the implementation. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/RegisterTableResponse.md b/java/lance-namespace-async-client/docs/RegisterTableResponse.md new file mode 100644 index 000000000..8bdf21fb7 --- /dev/null +++ b/java/lance-namespace-async-client/docs/RegisterTableResponse.md @@ -0,0 +1,15 @@ + + +# RegisterTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**location** | **String** | | [optional] | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/RenameTableRequest.md b/java/lance-namespace-async-client/docs/RenameTableRequest.md new file mode 100644 index 000000000..4f1758309 --- /dev/null +++ b/java/lance-namespace-async-client/docs/RenameTableRequest.md @@ -0,0 +1,17 @@ + + +# RenameTableRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The table identifier | [optional] | +|**newTableName** | **String** | New name for the table | | +|**newNamespaceId** | **List<String>** | New namespace identifier to move the table to (optional, if not specified the table stays in the same namespace) | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/RenameTableResponse.md b/java/lance-namespace-async-client/docs/RenameTableResponse.md new file mode 100644 index 000000000..85c3697d9 --- /dev/null +++ b/java/lance-namespace-async-client/docs/RenameTableResponse.md @@ -0,0 +1,13 @@ + + +# RenameTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/RestoreTableRequest.md b/java/lance-namespace-async-client/docs/RestoreTableRequest.md new file mode 100644 index 000000000..7c10e3e47 --- /dev/null +++ b/java/lance-namespace-async-client/docs/RestoreTableRequest.md @@ -0,0 +1,16 @@ + + +# RestoreTableRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**version** | **Long** | Version to restore to | | + + + diff --git a/java/lance-namespace-async-client/docs/RestoreTableResponse.md b/java/lance-namespace-async-client/docs/RestoreTableResponse.md new file mode 100644 index 000000000..707d3c9dc --- /dev/null +++ b/java/lance-namespace-async-client/docs/RestoreTableResponse.md @@ -0,0 +1,14 @@ + + +# RestoreTableResponse + +Response for restore table operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/StringFtsQuery.md b/java/lance-namespace-async-client/docs/StringFtsQuery.md new file mode 100644 index 000000000..f24a224bd --- /dev/null +++ b/java/lance-namespace-async-client/docs/StringFtsQuery.md @@ -0,0 +1,14 @@ + + +# StringFtsQuery + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**columns** | **List<String>** | | [optional] | +|**query** | **String** | | | + + + diff --git a/java/lance-namespace-async-client/docs/StructuredFtsQuery.md b/java/lance-namespace-async-client/docs/StructuredFtsQuery.md new file mode 100644 index 000000000..d3e1fb5a1 --- /dev/null +++ b/java/lance-namespace-async-client/docs/StructuredFtsQuery.md @@ -0,0 +1,13 @@ + + +# StructuredFtsQuery + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**query** | [**FtsQuery**](FtsQuery.md) | | | + + + diff --git a/java/lance-namespace-async-client/docs/TableApi.md b/java/lance-namespace-async-client/docs/TableApi.md new file mode 100644 index 000000000..52bfcf864 --- /dev/null +++ b/java/lance-namespace-async-client/docs/TableApi.md @@ -0,0 +1,7882 @@ +# TableApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**alterTableAddColumns**](TableApi.md#alterTableAddColumns) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema | +| [**alterTableAddColumnsWithHttpInfo**](TableApi.md#alterTableAddColumnsWithHttpInfo) | **POST** /v1/table/{id}/add_columns | Add new columns to table schema | +| [**alterTableAlterColumns**](TableApi.md#alterTableAlterColumns) | **POST** /v1/table/{id}/alter_columns | Modify existing columns | +| [**alterTableAlterColumnsWithHttpInfo**](TableApi.md#alterTableAlterColumnsWithHttpInfo) | **POST** /v1/table/{id}/alter_columns | Modify existing columns | +| [**alterTableDropColumns**](TableApi.md#alterTableDropColumns) | **POST** /v1/table/{id}/drop_columns | Remove columns from table | +| [**alterTableDropColumnsWithHttpInfo**](TableApi.md#alterTableDropColumnsWithHttpInfo) | **POST** /v1/table/{id}/drop_columns | Remove columns from table | +| [**analyzeTableQueryPlan**](TableApi.md#analyzeTableQueryPlan) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan | +| [**analyzeTableQueryPlanWithHttpInfo**](TableApi.md#analyzeTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/analyze_plan | Analyze query execution plan | +| [**batchCreateTableVersions**](TableApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | +| [**batchCreateTableVersionsWithHttpInfo**](TableApi.md#batchCreateTableVersionsWithHttpInfo) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | +| [**batchDeleteTableVersions**](TableApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records | +| [**batchDeleteTableVersionsWithHttpInfo**](TableApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records | +| [**countTableRows**](TableApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table | +| [**countTableRowsWithHttpInfo**](TableApi.md#countTableRowsWithHttpInfo) | **POST** /v1/table/{id}/count_rows | Count rows in a table | +| [**createEmptyTable**](TableApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table | +| [**createEmptyTableWithHttpInfo**](TableApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table | +| [**createTable**](TableApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name | +| [**createTableWithHttpInfo**](TableApi.md#createTableWithHttpInfo) | **POST** /v1/table/{id}/create | Create a table with the given name | +| [**createTableIndex**](TableApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | +| [**createTableIndexWithHttpInfo**](TableApi.md#createTableIndexWithHttpInfo) | **POST** /v1/table/{id}/create_index | Create an index on a table | +| [**createTableScalarIndex**](TableApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | +| [**createTableScalarIndexWithHttpInfo**](TableApi.md#createTableScalarIndexWithHttpInfo) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | +| [**createTableTag**](TableApi.md#createTableTag) | **POST** /v1/table/{id}/tags/create | Create a new tag | +| [**createTableTagWithHttpInfo**](TableApi.md#createTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/create | Create a new tag | +| [**createTableVersion**](TableApi.md#createTableVersion) | **POST** /v1/table/{id}/version/create | Create a new table version | +| [**createTableVersionWithHttpInfo**](TableApi.md#createTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/create | Create a new table version | +| [**declareTable**](TableApi.md#declareTable) | **POST** /v1/table/{id}/declare | Declare a table | +| [**declareTableWithHttpInfo**](TableApi.md#declareTableWithHttpInfo) | **POST** /v1/table/{id}/declare | Declare a table | +| [**deleteFromTable**](TableApi.md#deleteFromTable) | **POST** /v1/table/{id}/delete | Delete rows from a table | +| [**deleteFromTableWithHttpInfo**](TableApi.md#deleteFromTableWithHttpInfo) | **POST** /v1/table/{id}/delete | Delete rows from a table | +| [**deleteTableTag**](TableApi.md#deleteTableTag) | **POST** /v1/table/{id}/tags/delete | Delete a tag | +| [**deleteTableTagWithHttpInfo**](TableApi.md#deleteTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/delete | Delete a tag | +| [**deregisterTable**](TableApi.md#deregisterTable) | **POST** /v1/table/{id}/deregister | Deregister a table | +| [**deregisterTableWithHttpInfo**](TableApi.md#deregisterTableWithHttpInfo) | **POST** /v1/table/{id}/deregister | Deregister a table | +| [**describeTable**](TableApi.md#describeTable) | **POST** /v1/table/{id}/describe | Describe information of a table | +| [**describeTableWithHttpInfo**](TableApi.md#describeTableWithHttpInfo) | **POST** /v1/table/{id}/describe | Describe information of a table | +| [**describeTableIndexStats**](TableApi.md#describeTableIndexStats) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics | +| [**describeTableIndexStatsWithHttpInfo**](TableApi.md#describeTableIndexStatsWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/stats | Get table index statistics | +| [**describeTableVersion**](TableApi.md#describeTableVersion) | **POST** /v1/table/{id}/version/describe | Describe a specific table version | +| [**describeTableVersionWithHttpInfo**](TableApi.md#describeTableVersionWithHttpInfo) | **POST** /v1/table/{id}/version/describe | Describe a specific table version | +| [**dropTable**](TableApi.md#dropTable) | **POST** /v1/table/{id}/drop | Drop a table | +| [**dropTableWithHttpInfo**](TableApi.md#dropTableWithHttpInfo) | **POST** /v1/table/{id}/drop | Drop a table | +| [**dropTableIndex**](TableApi.md#dropTableIndex) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index | +| [**dropTableIndexWithHttpInfo**](TableApi.md#dropTableIndexWithHttpInfo) | **POST** /v1/table/{id}/index/{index_name}/drop | Drop a specific index | +| [**explainTableQueryPlan**](TableApi.md#explainTableQueryPlan) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation | +| [**explainTableQueryPlanWithHttpInfo**](TableApi.md#explainTableQueryPlanWithHttpInfo) | **POST** /v1/table/{id}/explain_plan | Get query execution plan explanation | +| [**getTableStats**](TableApi.md#getTableStats) | **POST** /v1/table/{id}/stats | Get table statistics | +| [**getTableStatsWithHttpInfo**](TableApi.md#getTableStatsWithHttpInfo) | **POST** /v1/table/{id}/stats | Get table statistics | +| [**getTableTagVersion**](TableApi.md#getTableTagVersion) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag | +| [**getTableTagVersionWithHttpInfo**](TableApi.md#getTableTagVersionWithHttpInfo) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag | +| [**insertIntoTable**](TableApi.md#insertIntoTable) | **POST** /v1/table/{id}/insert | Insert records into a table | +| [**insertIntoTableWithHttpInfo**](TableApi.md#insertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/insert | Insert records into a table | +| [**listAllTables**](TableApi.md#listAllTables) | **GET** /v1/table | List all tables | +| [**listAllTablesWithHttpInfo**](TableApi.md#listAllTablesWithHttpInfo) | **GET** /v1/table | List all tables | +| [**listTableIndices**](TableApi.md#listTableIndices) | **POST** /v1/table/{id}/index/list | List indexes on a table | +| [**listTableIndicesWithHttpInfo**](TableApi.md#listTableIndicesWithHttpInfo) | **POST** /v1/table/{id}/index/list | List indexes on a table | +| [**listTableTags**](TableApi.md#listTableTags) | **POST** /v1/table/{id}/tags/list | List all tags for a table | +| [**listTableTagsWithHttpInfo**](TableApi.md#listTableTagsWithHttpInfo) | **POST** /v1/table/{id}/tags/list | List all tags for a table | +| [**listTableVersions**](TableApi.md#listTableVersions) | **POST** /v1/table/{id}/version/list | List all versions of a table | +| [**listTableVersionsWithHttpInfo**](TableApi.md#listTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/list | List all versions of a table | +| [**listTables**](TableApi.md#listTables) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace | +| [**listTablesWithHttpInfo**](TableApi.md#listTablesWithHttpInfo) | **GET** /v1/namespace/{id}/table/list | List tables in a namespace | +| [**mergeInsertIntoTable**](TableApi.md#mergeInsertIntoTable) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table | +| [**mergeInsertIntoTableWithHttpInfo**](TableApi.md#mergeInsertIntoTableWithHttpInfo) | **POST** /v1/table/{id}/merge_insert | Merge insert (upsert) records into a table | +| [**queryTable**](TableApi.md#queryTable) | **POST** /v1/table/{id}/query | Query a table | +| [**queryTableWithHttpInfo**](TableApi.md#queryTableWithHttpInfo) | **POST** /v1/table/{id}/query | Query a table | +| [**registerTable**](TableApi.md#registerTable) | **POST** /v1/table/{id}/register | Register a table to a namespace | +| [**registerTableWithHttpInfo**](TableApi.md#registerTableWithHttpInfo) | **POST** /v1/table/{id}/register | Register a table to a namespace | +| [**renameTable**](TableApi.md#renameTable) | **POST** /v1/table/{id}/rename | Rename a table | +| [**renameTableWithHttpInfo**](TableApi.md#renameTableWithHttpInfo) | **POST** /v1/table/{id}/rename | Rename a table | +| [**restoreTable**](TableApi.md#restoreTable) | **POST** /v1/table/{id}/restore | Restore table to a specific version | +| [**restoreTableWithHttpInfo**](TableApi.md#restoreTableWithHttpInfo) | **POST** /v1/table/{id}/restore | Restore table to a specific version | +| [**tableExists**](TableApi.md#tableExists) | **POST** /v1/table/{id}/exists | Check if a table exists | +| [**tableExistsWithHttpInfo**](TableApi.md#tableExistsWithHttpInfo) | **POST** /v1/table/{id}/exists | Check if a table exists | +| [**updateTable**](TableApi.md#updateTable) | **POST** /v1/table/{id}/update | Update rows in a table | +| [**updateTableWithHttpInfo**](TableApi.md#updateTableWithHttpInfo) | **POST** /v1/table/{id}/update | Update rows in a table | +| [**updateTableSchemaMetadata**](TableApi.md#updateTableSchemaMetadata) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata | +| [**updateTableSchemaMetadataWithHttpInfo**](TableApi.md#updateTableSchemaMetadataWithHttpInfo) | **POST** /v1/table/{id}/schema_metadata/update | Update table schema metadata | +| [**updateTableTag**](TableApi.md#updateTableTag) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version | +| [**updateTableTagWithHttpInfo**](TableApi.md#updateTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version | + + + +## alterTableAddColumns + +> CompletableFuture alterTableAddColumns(id, alterTableAddColumnsRequest, delimiter) + +Add new columns to table schema + +Add new columns to table `id` using SQL expressions or default values. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAddColumnsRequest alterTableAddColumnsRequest = new AlterTableAddColumnsRequest(); // AlterTableAddColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableAddColumns(id, alterTableAddColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#alterTableAddColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAddColumnsRequest** | [**AlterTableAddColumnsRequest**](AlterTableAddColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTableAddColumnsResponse**](AlterTableAddColumnsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Add columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTableAddColumnsWithHttpInfo + +> CompletableFuture> alterTableAddColumns alterTableAddColumnsWithHttpInfo(id, alterTableAddColumnsRequest, delimiter) + +Add new columns to table schema + +Add new columns to table `id` using SQL expressions or default values. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAddColumnsRequest alterTableAddColumnsRequest = new AlterTableAddColumnsRequest(); // AlterTableAddColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTableAddColumnsWithHttpInfo(id, alterTableAddColumnsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#alterTableAddColumns"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#alterTableAddColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAddColumnsRequest** | [**AlterTableAddColumnsRequest**](AlterTableAddColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Add columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## alterTableAlterColumns + +> CompletableFuture alterTableAlterColumns(id, alterTableAlterColumnsRequest, delimiter) + +Modify existing columns + +Modify existing columns in table `id`, such as renaming or changing data types. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAlterColumnsRequest alterTableAlterColumnsRequest = new AlterTableAlterColumnsRequest(); // AlterTableAlterColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableAlterColumns(id, alterTableAlterColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#alterTableAlterColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAlterColumnsRequest** | [**AlterTableAlterColumnsRequest**](AlterTableAlterColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTableAlterColumnsResponse**](AlterTableAlterColumnsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Alter columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTableAlterColumnsWithHttpInfo + +> CompletableFuture> alterTableAlterColumns alterTableAlterColumnsWithHttpInfo(id, alterTableAlterColumnsRequest, delimiter) + +Modify existing columns + +Modify existing columns in table `id`, such as renaming or changing data types. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableAlterColumnsRequest alterTableAlterColumnsRequest = new AlterTableAlterColumnsRequest(); // AlterTableAlterColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTableAlterColumnsWithHttpInfo(id, alterTableAlterColumnsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#alterTableAlterColumns"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#alterTableAlterColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableAlterColumnsRequest** | [**AlterTableAlterColumnsRequest**](AlterTableAlterColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Alter columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## alterTableDropColumns + +> CompletableFuture alterTableDropColumns(id, alterTableDropColumnsRequest, delimiter) + +Remove columns from table + +Remove specified columns from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableDropColumnsRequest alterTableDropColumnsRequest = new AlterTableDropColumnsRequest(); // AlterTableDropColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTableDropColumns(id, alterTableDropColumnsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#alterTableDropColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableDropColumnsRequest** | [**AlterTableDropColumnsRequest**](AlterTableDropColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTableDropColumnsResponse**](AlterTableDropColumnsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Drop columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTableDropColumnsWithHttpInfo + +> CompletableFuture> alterTableDropColumns alterTableDropColumnsWithHttpInfo(id, alterTableDropColumnsRequest, delimiter) + +Remove columns from table + +Remove specified columns from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTableDropColumnsRequest alterTableDropColumnsRequest = new AlterTableDropColumnsRequest(); // AlterTableDropColumnsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTableDropColumnsWithHttpInfo(id, alterTableDropColumnsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#alterTableDropColumns"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#alterTableDropColumns"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTableDropColumnsRequest** | [**AlterTableDropColumnsRequest**](AlterTableDropColumnsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Drop columns operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## analyzeTableQueryPlan + +> CompletableFuture analyzeTableQueryPlan(id, analyzeTableQueryPlanRequest, delimiter) + +Analyze query execution plan + +Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest = new AnalyzeTableQueryPlanRequest(); // AnalyzeTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.analyzeTableQueryPlan(id, analyzeTableQueryPlanRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#analyzeTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **analyzeTableQueryPlanRequest** | [**AnalyzeTableQueryPlanRequest**](AnalyzeTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**String**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan analysis | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## analyzeTableQueryPlanWithHttpInfo + +> CompletableFuture> analyzeTableQueryPlan analyzeTableQueryPlanWithHttpInfo(id, analyzeTableQueryPlanRequest, delimiter) + +Analyze query execution plan + +Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest = new AnalyzeTableQueryPlanRequest(); // AnalyzeTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.analyzeTableQueryPlanWithHttpInfo(id, analyzeTableQueryPlanRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#analyzeTableQueryPlan"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#analyzeTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **analyzeTableQueryPlanRequest** | [**AnalyzeTableQueryPlanRequest**](AnalyzeTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan analysis | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## batchCreateTableVersions + +> CompletableFuture batchCreateTableVersions(batchCreateTableVersionsRequest, delimiter) + +Atomically create versions for multiple tables + +Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest = new BatchCreateTableVersionsRequest(); // BatchCreateTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.batchCreateTableVersions(batchCreateTableVersionsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#batchCreateTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **batchCreateTableVersionsRequest** | [**BatchCreateTableVersionsRequest**](BatchCreateTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**BatchCreateTableVersionsResponse**](BatchCreateTableVersionsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of atomically creating table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## batchCreateTableVersionsWithHttpInfo + +> CompletableFuture> batchCreateTableVersions batchCreateTableVersionsWithHttpInfo(batchCreateTableVersionsRequest, delimiter) + +Atomically create versions for multiple tables + +Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest = new BatchCreateTableVersionsRequest(); // BatchCreateTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.batchCreateTableVersionsWithHttpInfo(batchCreateTableVersionsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#batchCreateTableVersions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#batchCreateTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **batchCreateTableVersionsRequest** | [**BatchCreateTableVersionsRequest**](BatchCreateTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of atomically creating table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## batchDeleteTableVersions + +> CompletableFuture batchDeleteTableVersions(id, batchDeleteTableVersionsRequest, delimiter) + +Delete table version records + +Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest = new BatchDeleteTableVersionsRequest(); // BatchDeleteTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.batchDeleteTableVersions(id, batchDeleteTableVersionsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#batchDeleteTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **batchDeleteTableVersionsRequest** | [**BatchDeleteTableVersionsRequest**](BatchDeleteTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**BatchDeleteTableVersionsResponse**](BatchDeleteTableVersionsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of deleting table version records | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## batchDeleteTableVersionsWithHttpInfo + +> CompletableFuture> batchDeleteTableVersions batchDeleteTableVersionsWithHttpInfo(id, batchDeleteTableVersionsRequest, delimiter) + +Delete table version records + +Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest = new BatchDeleteTableVersionsRequest(); // BatchDeleteTableVersionsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.batchDeleteTableVersionsWithHttpInfo(id, batchDeleteTableVersionsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#batchDeleteTableVersions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#batchDeleteTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **batchDeleteTableVersionsRequest** | [**BatchDeleteTableVersionsRequest**](BatchDeleteTableVersionsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of deleting table version records | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## countTableRows + +> CompletableFuture countTableRows(id, countTableRowsRequest, delimiter) + +Count rows in a table + +Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CountTableRowsRequest countTableRowsRequest = new CountTableRowsRequest(); // CountTableRowsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.countTableRows(id, countTableRowsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#countTableRows"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **countTableRowsRequest** | [**CountTableRowsRequest**](CountTableRowsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**Long**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of counting rows in a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## countTableRowsWithHttpInfo + +> CompletableFuture> countTableRows countTableRowsWithHttpInfo(id, countTableRowsRequest, delimiter) + +Count rows in a table + +Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CountTableRowsRequest countTableRowsRequest = new CountTableRowsRequest(); // CountTableRowsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.countTableRowsWithHttpInfo(id, countTableRowsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#countTableRows"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#countTableRows"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **countTableRowsRequest** | [**CountTableRowsRequest**](CountTableRowsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of counting rows in a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createEmptyTable + +> CompletableFuture createEmptyTable(id, createEmptyTableRequest, delimiter) + +Create an empty table + +Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createEmptyTable(id, createEmptyTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createEmptyTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating an empty table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createEmptyTableWithHttpInfo + +> CompletableFuture> createEmptyTable createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter) + +Create an empty table + +Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#createEmptyTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createEmptyTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating an empty table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTable + +> CompletableFuture createTable(id, body, delimiter, mode) + +Create a table with the given name + +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC data + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "mode_example"; // String | + try { + CompletableFuture result = apiInstance.createTable(id, body, delimiter, mode); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC data | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| | [optional] | + +### Return type + +CompletableFuture<[**CreateTableResponse**](CreateTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableWithHttpInfo + +> CompletableFuture> createTable createTableWithHttpInfo(id, body, delimiter, mode) + +Create a table with the given name + +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC data + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "mode_example"; // String | + try { + CompletableFuture> response = apiInstance.createTableWithHttpInfo(id, body, delimiter, mode); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#createTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC data | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when creating a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableIndex + +> CompletableFuture createTableIndex(id, createTableIndexRequest, delimiter) + +Create an index on a table + +Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableIndex(id, createTableIndexRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableIndexResponse**](CreateTableIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableIndexWithHttpInfo + +> CompletableFuture> createTableIndex createTableIndexWithHttpInfo(id, createTableIndexRequest, delimiter) + +Create an index on a table + +Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableIndexWithHttpInfo(id, createTableIndexRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#createTableIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableScalarIndex + +> CompletableFuture createTableScalarIndex(id, createTableIndexRequest, delimiter) + +Create a scalar index on a table + +Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Scalar index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableScalarIndex(id, createTableIndexRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableScalarIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Scalar index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableScalarIndexResponse**](CreateTableScalarIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Scalar index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableScalarIndexWithHttpInfo + +> CompletableFuture> createTableScalarIndex createTableScalarIndexWithHttpInfo(id, createTableIndexRequest, delimiter) + +Create a scalar index on a table + +Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableIndexRequest createTableIndexRequest = new CreateTableIndexRequest(); // CreateTableIndexRequest | Scalar index creation request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableScalarIndexWithHttpInfo(id, createTableIndexRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#createTableScalarIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableScalarIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableIndexRequest** | [**CreateTableIndexRequest**](CreateTableIndexRequest.md)| Scalar index creation request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Scalar index created successfully | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableTag + +> CompletableFuture createTableTag(id, createTableTagRequest, delimiter) + +Create a new tag + +Create a new tag for table `id` that points to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableTagRequest createTableTagRequest = new CreateTableTagRequest(); // CreateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableTag(id, createTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableTagRequest** | [**CreateTableTagRequest**](CreateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableTagResponse**](CreateTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Create tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableTagWithHttpInfo + +> CompletableFuture> createTableTag createTableTagWithHttpInfo(id, createTableTagRequest, delimiter) + +Create a new tag + +Create a new tag for table `id` that points to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableTagRequest createTableTagRequest = new CreateTableTagRequest(); // CreateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableTagWithHttpInfo(id, createTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#createTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableTagRequest** | [**CreateTableTagRequest**](CreateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Create tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## createTableVersion + +> CompletableFuture createTableVersion(id, createTableVersionRequest, delimiter) + +Create a new table version + +Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableVersionRequest createTableVersionRequest = new CreateTableVersionRequest(); // CreateTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableVersion(id, createTableVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableVersionRequest** | [**CreateTableVersionRequest**](CreateTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableVersionResponse**](CreateTableVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a table version | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableVersionWithHttpInfo + +> CompletableFuture> createTableVersion createTableVersionWithHttpInfo(id, createTableVersionRequest, delimiter) + +Create a new table version + +Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableVersionRequest createTableVersionRequest = new CreateTableVersionRequest(); // CreateTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableVersionWithHttpInfo(id, createTableVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#createTableVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#createTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableVersionRequest** | [**CreateTableVersionRequest**](CreateTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of creating a table version | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## declareTable + +> CompletableFuture declareTable(id, declareTableRequest, delimiter) + +Declare a table + +Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeclareTableRequest declareTableRequest = new DeclareTableRequest(); // DeclareTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.declareTable(id, declareTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#declareTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **declareTableRequest** | [**DeclareTableRequest**](DeclareTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeclareTableResponse**](DeclareTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when declaring a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## declareTableWithHttpInfo + +> CompletableFuture> declareTable declareTableWithHttpInfo(id, declareTableRequest, delimiter) + +Declare a table + +Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeclareTableRequest declareTableRequest = new DeclareTableRequest(); // DeclareTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.declareTableWithHttpInfo(id, declareTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#declareTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#declareTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **declareTableRequest** | [**DeclareTableRequest**](DeclareTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when declaring a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deleteFromTable + +> CompletableFuture deleteFromTable(id, deleteFromTableRequest, delimiter) + +Delete rows from a table + +Delete rows from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteFromTableRequest deleteFromTableRequest = new DeleteFromTableRequest(); // DeleteFromTableRequest | Delete request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deleteFromTable(id, deleteFromTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#deleteFromTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteFromTableRequest** | [**DeleteFromTableRequest**](DeleteFromTableRequest.md)| Delete request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeleteFromTableResponse**](DeleteFromTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deleteFromTableWithHttpInfo + +> CompletableFuture> deleteFromTable deleteFromTableWithHttpInfo(id, deleteFromTableRequest, delimiter) + +Delete rows from a table + +Delete rows from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteFromTableRequest deleteFromTableRequest = new DeleteFromTableRequest(); // DeleteFromTableRequest | Delete request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deleteFromTableWithHttpInfo(id, deleteFromTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#deleteFromTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#deleteFromTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteFromTableRequest** | [**DeleteFromTableRequest**](DeleteFromTableRequest.md)| Delete request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deleteTableTag + +> CompletableFuture deleteTableTag(id, deleteTableTagRequest, delimiter) + +Delete a tag + +Delete an existing tag from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteTableTagRequest deleteTableTagRequest = new DeleteTableTagRequest(); // DeleteTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deleteTableTag(id, deleteTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#deleteTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteTableTagRequest** | [**DeleteTableTagRequest**](DeleteTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeleteTableTagResponse**](DeleteTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deleteTableTagWithHttpInfo + +> CompletableFuture> deleteTableTag deleteTableTagWithHttpInfo(id, deleteTableTagRequest, delimiter) + +Delete a tag + +Delete an existing tag from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteTableTagRequest deleteTableTagRequest = new DeleteTableTagRequest(); // DeleteTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deleteTableTagWithHttpInfo(id, deleteTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#deleteTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#deleteTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteTableTagRequest** | [**DeleteTableTagRequest**](DeleteTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deregisterTable + +> CompletableFuture deregisterTable(id, deregisterTableRequest, delimiter) + +Deregister a table + +Deregister table `id` from its namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeregisterTableRequest deregisterTableRequest = new DeregisterTableRequest(); // DeregisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deregisterTable(id, deregisterTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#deregisterTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deregisterTableRequest** | [**DeregisterTableRequest**](DeregisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeregisterTableResponse**](DeregisterTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DeregisterTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deregisterTableWithHttpInfo + +> CompletableFuture> deregisterTable deregisterTableWithHttpInfo(id, deregisterTableRequest, delimiter) + +Deregister a table + +Deregister table `id` from its namespace. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeregisterTableRequest deregisterTableRequest = new DeregisterTableRequest(); // DeregisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deregisterTableWithHttpInfo(id, deregisterTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#deregisterTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#deregisterTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deregisterTableRequest** | [**DeregisterTableRequest**](DeregisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DeregisterTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTable + +> CompletableFuture describeTable(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata) + +Describe information of a table + +Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableRequest describeTableRequest = new DescribeTableRequest(); // DescribeTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean withTableUri = false; // Boolean | Whether to include the table URI in the response + Boolean loadDetailedMetadata = false; // Boolean | Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. + try { + CompletableFuture result = apiInstance.describeTable(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#describeTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableRequest** | [**DescribeTableRequest**](DescribeTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **withTableUri** | **Boolean**| Whether to include the table URI in the response | [optional] [default to false] | +| **loadDetailedMetadata** | **Boolean**| Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. | [optional] [default to false] | + +### Return type + +CompletableFuture<[**DescribeTableResponse**](DescribeTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when loading a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableWithHttpInfo + +> CompletableFuture> describeTable describeTableWithHttpInfo(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata) + +Describe information of a table + +Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableRequest describeTableRequest = new DescribeTableRequest(); // DescribeTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean withTableUri = false; // Boolean | Whether to include the table URI in the response + Boolean loadDetailedMetadata = false; // Boolean | Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. + try { + CompletableFuture> response = apiInstance.describeTableWithHttpInfo(id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#describeTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#describeTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableRequest** | [**DescribeTableRequest**](DescribeTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **withTableUri** | **Boolean**| Whether to include the table URI in the response | [optional] [default to false] | +| **loadDetailedMetadata** | **Boolean**| Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. | [optional] [default to false] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when loading a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTableIndexStats + +> CompletableFuture describeTableIndexStats(id, indexName, describeTableIndexStatsRequest, delimiter) + +Get table index statistics + +Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to get stats for + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = new DescribeTableIndexStatsRequest(); // DescribeTableIndexStatsRequest | Index stats request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTableIndexStats(id, indexName, describeTableIndexStatsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#describeTableIndexStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to get stats for | | +| **describeTableIndexStatsRequest** | [**DescribeTableIndexStatsRequest**](DescribeTableIndexStatsRequest.md)| Index stats request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTableIndexStatsResponse**](DescribeTableIndexStatsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableIndexStatsWithHttpInfo + +> CompletableFuture> describeTableIndexStats describeTableIndexStatsWithHttpInfo(id, indexName, describeTableIndexStatsRequest, delimiter) + +Get table index statistics + +Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to get stats for + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = new DescribeTableIndexStatsRequest(); // DescribeTableIndexStatsRequest | Index stats request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTableIndexStatsWithHttpInfo(id, indexName, describeTableIndexStatsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#describeTableIndexStats"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#describeTableIndexStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to get stats for | | +| **describeTableIndexStatsRequest** | [**DescribeTableIndexStatsRequest**](DescribeTableIndexStatsRequest.md)| Index stats request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTableVersion + +> CompletableFuture describeTableVersion(id, describeTableVersionRequest, delimiter) + +Describe a specific table version + +Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableVersionRequest describeTableVersionRequest = new DescribeTableVersionRequest(); // DescribeTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTableVersion(id, describeTableVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#describeTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableVersionRequest** | [**DescribeTableVersionRequest**](DescribeTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTableVersionResponse**](DescribeTableVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTableVersionWithHttpInfo + +> CompletableFuture> describeTableVersion describeTableVersionWithHttpInfo(id, describeTableVersionRequest, delimiter) + +Describe a specific table version + +Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTableVersionRequest describeTableVersionRequest = new DescribeTableVersionRequest(); // DescribeTableVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTableVersionWithHttpInfo(id, describeTableVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#describeTableVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#describeTableVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTableVersionRequest** | [**DescribeTableVersionRequest**](DescribeTableVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropTable + +> CompletableFuture dropTable(id, delimiter) + +Drop a table + +Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropTable(id, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#dropTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropTableResponse**](DropTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DropTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropTableWithHttpInfo + +> CompletableFuture> dropTable dropTableWithHttpInfo(id, delimiter) + +Drop a table + +Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropTableWithHttpInfo(id, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#dropTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#dropTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DropTable | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## dropTableIndex + +> CompletableFuture dropTableIndex(id, indexName, delimiter) + +Drop a specific index + +Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to drop + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.dropTableIndex(id, indexName, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#dropTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to drop | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DropTableIndexResponse**](DropTableIndexResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index drop operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## dropTableIndexWithHttpInfo + +> CompletableFuture> dropTableIndex dropTableIndexWithHttpInfo(id, indexName, delimiter) + +Drop a specific index + +Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String indexName = "indexName_example"; // String | Name of the index to drop + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.dropTableIndexWithHttpInfo(id, indexName, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#dropTableIndex"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#dropTableIndex"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **indexName** | **String**| Name of the index to drop | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index drop operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## explainTableQueryPlan + +> CompletableFuture explainTableQueryPlan(id, explainTableQueryPlanRequest, delimiter) + +Get query execution plan explanation + +Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ExplainTableQueryPlanRequest explainTableQueryPlanRequest = new ExplainTableQueryPlanRequest(); // ExplainTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.explainTableQueryPlan(id, explainTableQueryPlanRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#explainTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **explainTableQueryPlanRequest** | [**ExplainTableQueryPlanRequest**](ExplainTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**String**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan explanation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## explainTableQueryPlanWithHttpInfo + +> CompletableFuture> explainTableQueryPlan explainTableQueryPlanWithHttpInfo(id, explainTableQueryPlanRequest, delimiter) + +Get query execution plan explanation + +Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ExplainTableQueryPlanRequest explainTableQueryPlanRequest = new ExplainTableQueryPlanRequest(); // ExplainTableQueryPlanRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.explainTableQueryPlanWithHttpInfo(id, explainTableQueryPlanRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#explainTableQueryPlan"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#explainTableQueryPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **explainTableQueryPlanRequest** | [**ExplainTableQueryPlanRequest**](ExplainTableQueryPlanRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query execution plan explanation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## getTableStats + +> CompletableFuture getTableStats(id, getTableStatsRequest, delimiter) + +Get table statistics + +Get statistics for table `id`, including row counts, data sizes, and column statistics. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableStatsRequest getTableStatsRequest = new GetTableStatsRequest(); // GetTableStatsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.getTableStats(id, getTableStatsRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#getTableStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableStatsRequest** | [**GetTableStatsRequest**](GetTableStatsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**GetTableStatsResponse**](GetTableStatsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## getTableStatsWithHttpInfo + +> CompletableFuture> getTableStats getTableStatsWithHttpInfo(id, getTableStatsRequest, delimiter) + +Get table statistics + +Get statistics for table `id`, including row counts, data sizes, and column statistics. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableStatsRequest getTableStatsRequest = new GetTableStatsRequest(); // GetTableStatsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.getTableStatsWithHttpInfo(id, getTableStatsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#getTableStats"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#getTableStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableStatsRequest** | [**GetTableStatsRequest**](GetTableStatsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table statistics | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## getTableTagVersion + +> CompletableFuture getTableTagVersion(id, getTableTagVersionRequest, delimiter) + +Get version for a specific tag + +Get the version number that a specific tag points to for table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableTagVersionRequest getTableTagVersionRequest = new GetTableTagVersionRequest(); // GetTableTagVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.getTableTagVersion(id, getTableTagVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#getTableTagVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableTagVersionRequest** | [**GetTableTagVersionRequest**](GetTableTagVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**GetTableTagVersionResponse**](GetTableTagVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tag version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## getTableTagVersionWithHttpInfo + +> CompletableFuture> getTableTagVersion getTableTagVersionWithHttpInfo(id, getTableTagVersionRequest, delimiter) + +Get version for a specific tag + +Get the version number that a specific tag points to for table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableTagVersionRequest getTableTagVersionRequest = new GetTableTagVersionRequest(); // GetTableTagVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.getTableTagVersionWithHttpInfo(id, getTableTagVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#getTableTagVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#getTableTagVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableTagVersionRequest** | [**GetTableTagVersionRequest**](GetTableTagVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tag version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## insertIntoTable + +> CompletableFuture insertIntoTable(id, body, delimiter, mode) + +Insert records into a table + +Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC stream containing the records to insert + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "append"; // String | How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it + try { + CompletableFuture result = apiInstance.insertIntoTable(id, body, delimiter, mode); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#insertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC stream containing the records to insert | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it | [optional] [default to append] | + +### Return type + +CompletableFuture<[**InsertIntoTableResponse**](InsertIntoTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of inserting records into a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## insertIntoTableWithHttpInfo + +> CompletableFuture> insertIntoTable insertIntoTableWithHttpInfo(id, body, delimiter, mode) + +Insert records into a table + +Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + byte[] body = null; // byte[] | Arrow IPC stream containing the records to insert + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String mode = "append"; // String | How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it + try { + CompletableFuture> response = apiInstance.insertIntoTableWithHttpInfo(id, body, delimiter, mode); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#insertIntoTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#insertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **body** | **byte[]**| Arrow IPC stream containing the records to insert | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **mode** | **String**| How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it | [optional] [default to append] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of inserting records into a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listAllTables + +> CompletableFuture listAllTables(delimiter, pageToken, limit) + +List all tables + +List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListAllTablesRequest` information in the following way: - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `delimiter`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listAllTables(delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listAllTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTablesResponse**](ListTablesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listAllTablesWithHttpInfo + +> CompletableFuture> listAllTables listAllTablesWithHttpInfo(delimiter, pageToken, limit) + +List all tables + +List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListAllTablesRequest` information in the following way: - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `delimiter`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listAllTablesWithHttpInfo(delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#listAllTables"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listAllTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableIndices + +> CompletableFuture listTableIndices(id, listTableIndicesRequest, delimiter) + +List indexes on a table + +List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ListTableIndicesRequest listTableIndicesRequest = new ListTableIndicesRequest(); // ListTableIndicesRequest | Index list request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.listTableIndices(id, listTableIndicesRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTableIndices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **listTableIndicesRequest** | [**ListTableIndicesRequest**](ListTableIndicesRequest.md)| Index list request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**ListTableIndicesResponse**](ListTableIndicesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of indices on the table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableIndicesWithHttpInfo + +> CompletableFuture> listTableIndices listTableIndicesWithHttpInfo(id, listTableIndicesRequest, delimiter) + +List indexes on a table + +List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + ListTableIndicesRequest listTableIndicesRequest = new ListTableIndicesRequest(); // ListTableIndicesRequest | Index list request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.listTableIndicesWithHttpInfo(id, listTableIndicesRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#listTableIndices"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTableIndices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **listTableIndicesRequest** | [**ListTableIndicesRequest**](ListTableIndicesRequest.md)| Index list request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of indices on the table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableTags + +> CompletableFuture listTableTags(id, delimiter, pageToken, limit) + +List all tags for a table + +List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listTableTags(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTableTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTableTagsResponse**](ListTableTagsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table tags | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableTagsWithHttpInfo + +> CompletableFuture> listTableTags listTableTagsWithHttpInfo(id, delimiter, pageToken, limit) + +List all tags for a table + +List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listTableTagsWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#listTableTags"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTableTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table tags | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableVersions + +> CompletableFuture listTableVersions(id, delimiter, pageToken, limit, descending) + +List all versions of a table + +List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + Boolean descending = true; // Boolean | When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. + try { + CompletableFuture result = apiInstance.listTableVersions(id, delimiter, pageToken, limit, descending); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | +| **descending** | **Boolean**| When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. | [optional] | + +### Return type + +CompletableFuture<[**ListTableVersionsResponse**](ListTableVersionsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableVersionsWithHttpInfo + +> CompletableFuture> listTableVersions listTableVersionsWithHttpInfo(id, delimiter, pageToken, limit, descending) + +List all versions of a table + +List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + Boolean descending = true; // Boolean | When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. + try { + CompletableFuture> response = apiInstance.listTableVersionsWithHttpInfo(id, delimiter, pageToken, limit, descending); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#listTableVersions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTableVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | +| **descending** | **Boolean**| When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table versions | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTables + +> CompletableFuture listTables(id, delimiter, pageToken, limit) + +List tables in a namespace + +List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listTables(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTablesResponse**](ListTablesResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTablesWithHttpInfo + +> CompletableFuture> listTables listTablesWithHttpInfo(id, delimiter, pageToken, limit) + +List tables in a namespace + +List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listTablesWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#listTables"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#listTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of tables | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## mergeInsertIntoTable + +> CompletableFuture mergeInsertIntoTable(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex) + +Merge insert (upsert) records into a table + +Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String on = "on_example"; // String | Column name to use for matching rows (required) + byte[] body = null; // byte[] | Arrow IPC stream containing the records to merge + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean whenMatchedUpdateAll = false; // Boolean | Update all columns when rows match + String whenMatchedUpdateAllFilt = "whenMatchedUpdateAllFilt_example"; // String | The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true + Boolean whenNotMatchedInsertAll = false; // Boolean | Insert all columns when rows don't match + Boolean whenNotMatchedBySourceDelete = false; // Boolean | Delete all rows from target table that don't match a row in the source table + String whenNotMatchedBySourceDeleteFilt = "whenNotMatchedBySourceDeleteFilt_example"; // String | Delete rows from the target table if there is no match AND the SQL expression evaluates to true + String timeout = "timeout_example"; // String | Timeout for the operation (e.g., \"30s\", \"5m\") + Boolean useIndex = false; // Boolean | Whether to use index for matching rows + try { + CompletableFuture result = apiInstance.mergeInsertIntoTable(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#mergeInsertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **on** | **String**| Column name to use for matching rows (required) | | +| **body** | **byte[]**| Arrow IPC stream containing the records to merge | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **whenMatchedUpdateAll** | **Boolean**| Update all columns when rows match | [optional] [default to false] | +| **whenMatchedUpdateAllFilt** | **String**| The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true | [optional] | +| **whenNotMatchedInsertAll** | **Boolean**| Insert all columns when rows don't match | [optional] [default to false] | +| **whenNotMatchedBySourceDelete** | **Boolean**| Delete all rows from target table that don't match a row in the source table | [optional] [default to false] | +| **whenNotMatchedBySourceDeleteFilt** | **String**| Delete rows from the target table if there is no match AND the SQL expression evaluates to true | [optional] | +| **timeout** | **String**| Timeout for the operation (e.g., \"30s\", \"5m\") | [optional] | +| **useIndex** | **Boolean**| Whether to use index for matching rows | [optional] [default to false] | + +### Return type + +CompletableFuture<[**MergeInsertIntoTableResponse**](MergeInsertIntoTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of merge insert operation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## mergeInsertIntoTableWithHttpInfo + +> CompletableFuture> mergeInsertIntoTable mergeInsertIntoTableWithHttpInfo(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex) + +Merge insert (upsert) records into a table + +Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String on = "on_example"; // String | Column name to use for matching rows (required) + byte[] body = null; // byte[] | Arrow IPC stream containing the records to merge + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + Boolean whenMatchedUpdateAll = false; // Boolean | Update all columns when rows match + String whenMatchedUpdateAllFilt = "whenMatchedUpdateAllFilt_example"; // String | The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true + Boolean whenNotMatchedInsertAll = false; // Boolean | Insert all columns when rows don't match + Boolean whenNotMatchedBySourceDelete = false; // Boolean | Delete all rows from target table that don't match a row in the source table + String whenNotMatchedBySourceDeleteFilt = "whenNotMatchedBySourceDeleteFilt_example"; // String | Delete rows from the target table if there is no match AND the SQL expression evaluates to true + String timeout = "timeout_example"; // String | Timeout for the operation (e.g., \"30s\", \"5m\") + Boolean useIndex = false; // Boolean | Whether to use index for matching rows + try { + CompletableFuture> response = apiInstance.mergeInsertIntoTableWithHttpInfo(id, on, body, delimiter, whenMatchedUpdateAll, whenMatchedUpdateAllFilt, whenNotMatchedInsertAll, whenNotMatchedBySourceDelete, whenNotMatchedBySourceDeleteFilt, timeout, useIndex); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#mergeInsertIntoTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#mergeInsertIntoTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **on** | **String**| Column name to use for matching rows (required) | | +| **body** | **byte[]**| Arrow IPC stream containing the records to merge | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **whenMatchedUpdateAll** | **Boolean**| Update all columns when rows match | [optional] [default to false] | +| **whenMatchedUpdateAllFilt** | **String**| The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true | [optional] | +| **whenNotMatchedInsertAll** | **Boolean**| Insert all columns when rows don't match | [optional] [default to false] | +| **whenNotMatchedBySourceDelete** | **Boolean**| Delete all rows from target table that don't match a row in the source table | [optional] [default to false] | +| **whenNotMatchedBySourceDeleteFilt** | **String**| Delete rows from the target table if there is no match AND the SQL expression evaluates to true | [optional] | +| **timeout** | **String**| Timeout for the operation (e.g., \"30s\", \"5m\") | [optional] | +| **useIndex** | **Boolean**| Whether to use index for matching rows | [optional] [default to false] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/vnd.apache.arrow.stream +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Result of merge insert operation | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## queryTable + +> CompletableFuture queryTable(id, queryTableRequest, delimiter) + +Query a table + +Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + QueryTableRequest queryTableRequest = new QueryTableRequest(); // QueryTableRequest | Query request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.queryTable(id, queryTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#queryTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **queryTableRequest** | [**QueryTableRequest**](QueryTableRequest.md)| Query request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**byte[]**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/vnd.apache.arrow.file, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query results in Arrow IPC file format | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## queryTableWithHttpInfo + +> CompletableFuture> queryTable queryTableWithHttpInfo(id, queryTableRequest, delimiter) + +Query a table + +Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + QueryTableRequest queryTableRequest = new QueryTableRequest(); // QueryTableRequest | Query request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.queryTableWithHttpInfo(id, queryTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#queryTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#queryTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **queryTableRequest** | [**QueryTableRequest**](QueryTableRequest.md)| Query request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/vnd.apache.arrow.file, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query results in Arrow IPC file format | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## registerTable + +> CompletableFuture registerTable(id, registerTableRequest, delimiter) + +Register a table to a namespace + +Register an existing table at a given storage location as `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RegisterTableRequest registerTableRequest = new RegisterTableRequest(); // RegisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.registerTable(id, registerTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#registerTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **registerTableRequest** | [**RegisterTableRequest**](RegisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**RegisterTableResponse**](RegisterTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when registering a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## registerTableWithHttpInfo + +> CompletableFuture> registerTable registerTableWithHttpInfo(id, registerTableRequest, delimiter) + +Register a table to a namespace + +Register an existing table at a given storage location as `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RegisterTableRequest registerTableRequest = new RegisterTableRequest(); // RegisterTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.registerTableWithHttpInfo(id, registerTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#registerTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#registerTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **registerTableRequest** | [**RegisterTableRequest**](RegisterTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table properties result when registering a table | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## renameTable + +> CompletableFuture renameTable(id, renameTableRequest, delimiter) + +Rename a table + +Rename table `id` to a new name. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RenameTableRequest renameTableRequest = new RenameTableRequest(); // RenameTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.renameTable(id, renameTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#renameTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **renameTableRequest** | [**RenameTableRequest**](RenameTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**RenameTableResponse**](RenameTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table rename operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## renameTableWithHttpInfo + +> CompletableFuture> renameTable renameTableWithHttpInfo(id, renameTableRequest, delimiter) + +Rename a table + +Rename table `id` to a new name. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RenameTableRequest renameTableRequest = new RenameTableRequest(); // RenameTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.renameTableWithHttpInfo(id, renameTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#renameTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#renameTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **renameTableRequest** | [**RenameTableRequest**](RenameTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table rename operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## restoreTable + +> CompletableFuture restoreTable(id, restoreTableRequest, delimiter) + +Restore table to a specific version + +Restore table `id` to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RestoreTableRequest restoreTableRequest = new RestoreTableRequest(); // RestoreTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.restoreTable(id, restoreTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#restoreTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **restoreTableRequest** | [**RestoreTableRequest**](RestoreTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**RestoreTableResponse**](RestoreTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table restore operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## restoreTableWithHttpInfo + +> CompletableFuture> restoreTable restoreTableWithHttpInfo(id, restoreTableRequest, delimiter) + +Restore table to a specific version + +Restore table `id` to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + RestoreTableRequest restoreTableRequest = new RestoreTableRequest(); // RestoreTableRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.restoreTableWithHttpInfo(id, restoreTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#restoreTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#restoreTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **restoreTableRequest** | [**RestoreTableRequest**](RestoreTableRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Table restore operation result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## tableExists + +> CompletableFuture tableExists(id, tableExistsRequest, delimiter) + +Check if a table exists + +Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + TableExistsRequest tableExistsRequest = new TableExistsRequest(); // TableExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.tableExists(id, tableExistsRequest, delimiter); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#tableExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **tableExistsRequest** | [**TableExistsRequest**](TableExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## tableExistsWithHttpInfo + +> CompletableFuture> tableExists tableExistsWithHttpInfo(id, tableExistsRequest, delimiter) + +Check if a table exists + +Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + TableExistsRequest tableExistsRequest = new TableExistsRequest(); // TableExistsRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.tableExistsWithHttpInfo(id, tableExistsRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#tableExists"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#tableExists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **tableExistsRequest** | [**TableExistsRequest**](TableExistsRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + + +CompletableFuture> + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success, no content | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTable + +> CompletableFuture updateTable(id, updateTableRequest, delimiter) + +Update rows in a table + +Update existing rows in table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableRequest updateTableRequest = new UpdateTableRequest(); // UpdateTableRequest | Update request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.updateTable(id, updateTableRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#updateTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableRequest** | [**UpdateTableRequest**](UpdateTableRequest.md)| Update request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**UpdateTableResponse**](UpdateTableResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableWithHttpInfo + +> CompletableFuture> updateTable updateTableWithHttpInfo(id, updateTableRequest, delimiter) + +Update rows in a table + +Update existing rows in table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableRequest updateTableRequest = new UpdateTableRequest(); // UpdateTableRequest | Update request + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.updateTableWithHttpInfo(id, updateTableRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#updateTable"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#updateTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableRequest** | [**UpdateTableRequest**](UpdateTableRequest.md)| Update request | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update successful | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTableSchemaMetadata + +> CompletableFuture> updateTableSchemaMetadata(id, requestBody, delimiter) + +Update table schema metadata + +Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + Map requestBody = new HashMap(); // Map | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> result = apiInstance.updateTableSchemaMetadata(id, requestBody, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#updateTableSchemaMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **requestBody** | [**Map<String, String>**](String.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<**Map<String, String>**> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Schema metadata update result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableSchemaMetadataWithHttpInfo + +> CompletableFuture>> updateTableSchemaMetadata updateTableSchemaMetadataWithHttpInfo(id, requestBody, delimiter) + +Update table schema metadata + +Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + Map requestBody = new HashMap(); // Map | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture>> response = apiInstance.updateTableSchemaMetadataWithHttpInfo(id, requestBody, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#updateTableSchemaMetadata"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#updateTableSchemaMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **requestBody** | [**Map<String, String>**](String.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Schema metadata update result | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTableTag + +> CompletableFuture updateTableTag(id, updateTableTagRequest, delimiter) + +Update a tag to point to a different version + +Update an existing tag for table `id` to point to a different version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableTagRequest updateTableTagRequest = new UpdateTableTagRequest(); // UpdateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.updateTableTag(id, updateTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#updateTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableTagRequest** | [**UpdateTableTagRequest**](UpdateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**UpdateTableTagResponse**](UpdateTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableTagWithHttpInfo + +> CompletableFuture> updateTableTag updateTableTagWithHttpInfo(id, updateTableTagRequest, delimiter) + +Update a tag to point to a different version + +Update an existing tag for table `id` to point to a different version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TableApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TableApi apiInstance = new TableApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableTagRequest updateTableTagRequest = new UpdateTableTagRequest(); // UpdateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.updateTableTagWithHttpInfo(id, updateTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TableApi#updateTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TableApi#updateTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableTagRequest** | [**UpdateTableTagRequest**](UpdateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/TableBasicStats.md b/java/lance-namespace-async-client/docs/TableBasicStats.md new file mode 100644 index 000000000..48265e1e2 --- /dev/null +++ b/java/lance-namespace-async-client/docs/TableBasicStats.md @@ -0,0 +1,14 @@ + + +# TableBasicStats + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**numDeletedRows** | **Integer** | Number of deleted rows in the table | | +|**numFragments** | **Integer** | Number of fragments in the table | | + + + diff --git a/java/lance-namespace-async-client/docs/TableExistsRequest.md b/java/lance-namespace-async-client/docs/TableExistsRequest.md new file mode 100644 index 000000000..97f855193 --- /dev/null +++ b/java/lance-namespace-async-client/docs/TableExistsRequest.md @@ -0,0 +1,16 @@ + + +# TableExistsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**version** | **Long** | Version of the table to check existence. If not specified, server should resolve it to the latest version. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/TableVersion.md b/java/lance-namespace-async-client/docs/TableVersion.md new file mode 100644 index 000000000..886473a33 --- /dev/null +++ b/java/lance-namespace-async-client/docs/TableVersion.md @@ -0,0 +1,18 @@ + + +# TableVersion + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**version** | **Long** | Version number | | +|**manifestPath** | **String** | Path to the manifest file for this version. | | +|**manifestSize** | **Long** | Size of the manifest file in bytes | [optional] | +|**eTag** | **String** | Optional ETag for optimistic concurrency control. Useful for S3 and similar object stores. | [optional] | +|**timestampMillis** | **Long** | Timestamp when the version was created, in milliseconds since epoch (Unix time) | [optional] | +|**metadata** | **Map<String, String>** | Optional key-value pairs of metadata | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/TagApi.md b/java/lance-namespace-async-client/docs/TagApi.md new file mode 100644 index 000000000..93b52ef9d --- /dev/null +++ b/java/lance-namespace-async-client/docs/TagApi.md @@ -0,0 +1,989 @@ +# TagApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createTableTag**](TagApi.md#createTableTag) | **POST** /v1/table/{id}/tags/create | Create a new tag | +| [**createTableTagWithHttpInfo**](TagApi.md#createTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/create | Create a new tag | +| [**deleteTableTag**](TagApi.md#deleteTableTag) | **POST** /v1/table/{id}/tags/delete | Delete a tag | +| [**deleteTableTagWithHttpInfo**](TagApi.md#deleteTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/delete | Delete a tag | +| [**getTableTagVersion**](TagApi.md#getTableTagVersion) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag | +| [**getTableTagVersionWithHttpInfo**](TagApi.md#getTableTagVersionWithHttpInfo) | **POST** /v1/table/{id}/tags/version | Get version for a specific tag | +| [**listTableTags**](TagApi.md#listTableTags) | **POST** /v1/table/{id}/tags/list | List all tags for a table | +| [**listTableTagsWithHttpInfo**](TagApi.md#listTableTagsWithHttpInfo) | **POST** /v1/table/{id}/tags/list | List all tags for a table | +| [**updateTableTag**](TagApi.md#updateTableTag) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version | +| [**updateTableTagWithHttpInfo**](TagApi.md#updateTableTagWithHttpInfo) | **POST** /v1/table/{id}/tags/update | Update a tag to point to a different version | + + + +## createTableTag + +> CompletableFuture createTableTag(id, createTableTagRequest, delimiter) + +Create a new tag + +Create a new tag for table `id` that points to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableTagRequest createTableTagRequest = new CreateTableTagRequest(); // CreateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.createTableTag(id, createTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#createTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableTagRequest** | [**CreateTableTagRequest**](CreateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**CreateTableTagResponse**](CreateTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Create tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## createTableTagWithHttpInfo + +> CompletableFuture> createTableTag createTableTagWithHttpInfo(id, createTableTagRequest, delimiter) + +Create a new tag + +Create a new tag for table `id` that points to a specific version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + CreateTableTagRequest createTableTagRequest = new CreateTableTagRequest(); // CreateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.createTableTagWithHttpInfo(id, createTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TagApi#createTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#createTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **createTableTagRequest** | [**CreateTableTagRequest**](CreateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Create tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## deleteTableTag + +> CompletableFuture deleteTableTag(id, deleteTableTagRequest, delimiter) + +Delete a tag + +Delete an existing tag from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteTableTagRequest deleteTableTagRequest = new DeleteTableTagRequest(); // DeleteTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.deleteTableTag(id, deleteTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#deleteTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteTableTagRequest** | [**DeleteTableTagRequest**](DeleteTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DeleteTableTagResponse**](DeleteTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## deleteTableTagWithHttpInfo + +> CompletableFuture> deleteTableTag deleteTableTagWithHttpInfo(id, deleteTableTagRequest, delimiter) + +Delete a tag + +Delete an existing tag from table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DeleteTableTagRequest deleteTableTagRequest = new DeleteTableTagRequest(); // DeleteTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.deleteTableTagWithHttpInfo(id, deleteTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TagApi#deleteTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#deleteTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **deleteTableTagRequest** | [**DeleteTableTagRequest**](DeleteTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Delete tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## getTableTagVersion + +> CompletableFuture getTableTagVersion(id, getTableTagVersionRequest, delimiter) + +Get version for a specific tag + +Get the version number that a specific tag points to for table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableTagVersionRequest getTableTagVersionRequest = new GetTableTagVersionRequest(); // GetTableTagVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.getTableTagVersion(id, getTableTagVersionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#getTableTagVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableTagVersionRequest** | [**GetTableTagVersionRequest**](GetTableTagVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**GetTableTagVersionResponse**](GetTableTagVersionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tag version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## getTableTagVersionWithHttpInfo + +> CompletableFuture> getTableTagVersion getTableTagVersionWithHttpInfo(id, getTableTagVersionRequest, delimiter) + +Get version for a specific tag + +Get the version number that a specific tag points to for table `id`. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + GetTableTagVersionRequest getTableTagVersionRequest = new GetTableTagVersionRequest(); // GetTableTagVersionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.getTableTagVersionWithHttpInfo(id, getTableTagVersionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TagApi#getTableTagVersion"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#getTableTagVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **getTableTagVersionRequest** | [**GetTableTagVersionRequest**](GetTableTagVersionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tag version information | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## listTableTags + +> CompletableFuture listTableTags(id, delimiter, pageToken, limit) + +List all tags for a table + +List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture result = apiInstance.listTableTags(id, delimiter, pageToken, limit); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#listTableTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture<[**ListTableTagsResponse**](ListTableTagsResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table tags | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## listTableTagsWithHttpInfo + +> CompletableFuture> listTableTags listTableTagsWithHttpInfo(id, delimiter, pageToken, limit) + +List all tags for a table + +List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + String pageToken = "pageToken_example"; // String | Pagination token from a previous request + Integer limit = 56; // Integer | Maximum number of items to return + try { + CompletableFuture> response = apiInstance.listTableTagsWithHttpInfo(id, delimiter, pageToken, limit); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TagApi#listTableTags"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#listTableTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | +| **pageToken** | **String**| Pagination token from a previous request | [optional] | +| **limit** | **Integer**| Maximum number of items to return | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of table tags | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## updateTableTag + +> CompletableFuture updateTableTag(id, updateTableTagRequest, delimiter) + +Update a tag to point to a different version + +Update an existing tag for table `id` to point to a different version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableTagRequest updateTableTagRequest = new UpdateTableTagRequest(); // UpdateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.updateTableTag(id, updateTableTagRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#updateTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableTagRequest** | [**UpdateTableTagRequest**](UpdateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**UpdateTableTagResponse**](UpdateTableTagResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## updateTableTagWithHttpInfo + +> CompletableFuture> updateTableTag updateTableTagWithHttpInfo(id, updateTableTagRequest, delimiter) + +Update a tag to point to a different version + +Update an existing tag for table `id` to point to a different version. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TagApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TagApi apiInstance = new TagApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + UpdateTableTagRequest updateTableTagRequest = new UpdateTableTagRequest(); // UpdateTableTagRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.updateTableTagWithHttpInfo(id, updateTableTagRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TagApi#updateTableTag"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TagApi#updateTableTag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **updateTableTagRequest** | [**UpdateTableTagRequest**](UpdateTableTagRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Update tag response | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/TagContents.md b/java/lance-namespace-async-client/docs/TagContents.md new file mode 100644 index 000000000..1607e61c5 --- /dev/null +++ b/java/lance-namespace-async-client/docs/TagContents.md @@ -0,0 +1,15 @@ + + +# TagContents + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**branch** | **String** | Branch name that the tag was created on (if any) | [optional] | +|**version** | **Long** | Version number that the tag points to | | +|**manifestSize** | **Long** | Size of the manifest file in bytes | | + + + diff --git a/java/lance-namespace-async-client/docs/TransactionApi.md b/java/lance-namespace-async-client/docs/TransactionApi.md new file mode 100644 index 000000000..8d3e14a78 --- /dev/null +++ b/java/lance-namespace-async-client/docs/TransactionApi.md @@ -0,0 +1,400 @@ +# TransactionApi + +All URIs are relative to *http://localhost:2333* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**alterTransaction**](TransactionApi.md#alterTransaction) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. | +| [**alterTransactionWithHttpInfo**](TransactionApi.md#alterTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/alter | Alter information of a transaction. | +| [**describeTransaction**](TransactionApi.md#describeTransaction) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction | +| [**describeTransactionWithHttpInfo**](TransactionApi.md#describeTransactionWithHttpInfo) | **POST** /v1/transaction/{id}/describe | Describe information about a transaction | + + + +## alterTransaction + +> CompletableFuture alterTransaction(id, alterTransactionRequest, delimiter) + +Alter information of a transaction. + +Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TransactionApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TransactionApi apiInstance = new TransactionApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTransactionRequest alterTransactionRequest = new AlterTransactionRequest(); // AlterTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.alterTransaction(id, alterTransactionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TransactionApi#alterTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTransactionRequest** | [**AlterTransactionRequest**](AlterTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**AlterTransactionResponse**](AlterTransactionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of AlterTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## alterTransactionWithHttpInfo + +> CompletableFuture> alterTransaction alterTransactionWithHttpInfo(id, alterTransactionRequest, delimiter) + +Alter information of a transaction. + +Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TransactionApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TransactionApi apiInstance = new TransactionApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + AlterTransactionRequest alterTransactionRequest = new AlterTransactionRequest(); // AlterTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.alterTransactionWithHttpInfo(id, alterTransactionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TransactionApi#alterTransaction"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TransactionApi#alterTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **alterTransactionRequest** | [**AlterTransactionRequest**](AlterTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of AlterTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + + +## describeTransaction + +> CompletableFuture describeTransaction(id, describeTransactionRequest, delimiter) + +Describe information about a transaction + +Return a detailed information for a given transaction + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TransactionApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TransactionApi apiInstance = new TransactionApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTransactionRequest describeTransactionRequest = new DescribeTransactionRequest(); // DescribeTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture result = apiInstance.describeTransaction(id, describeTransactionRequest, delimiter); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling TransactionApi#describeTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTransactionRequest** | [**DescribeTransactionRequest**](DescribeTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture<[**DescribeTransactionResponse**](DescribeTransactionResponse.md)> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DescribeTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + +## describeTransactionWithHttpInfo + +> CompletableFuture> describeTransaction describeTransactionWithHttpInfo(id, describeTransactionRequest, delimiter) + +Describe information about a transaction + +Return a detailed information for a given transaction + +### Example + +```java +// Import classes: +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.auth.*; +import org.lance.namespace.client.async.models.*; +import org.lance.namespace.client.async.api.TransactionApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:2333"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("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 bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + TransactionApi apiInstance = new TransactionApi(defaultClient); + String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + DescribeTransactionRequest describeTransactionRequest = new DescribeTransactionRequest(); // DescribeTransactionRequest | + String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. + try { + CompletableFuture> response = apiInstance.describeTransactionWithHttpInfo(id, describeTransactionRequest, delimiter); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling TransactionApi#describeTransaction"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling TransactionApi#describeTransaction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | +| **describeTransactionRequest** | [**DescribeTransactionRequest**](DescribeTransactionRequest.md)| | | +| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response of DescribeTransaction | - | +| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | +| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | +| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | +| **404** | A server-side problem that means can not find the specified resource. | - | +| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | +| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | + diff --git a/java/lance-namespace-async-client/docs/UpdateTableRequest.md b/java/lance-namespace-async-client/docs/UpdateTableRequest.md new file mode 100644 index 000000000..121456edd --- /dev/null +++ b/java/lance-namespace-async-client/docs/UpdateTableRequest.md @@ -0,0 +1,19 @@ + + +# UpdateTableRequest + +Each update consists of a column name and an SQL expression that will be evaluated against the current row's value. Optionally, a predicate can be provided to filter which rows to update. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**predicate** | **String** | Optional SQL predicate to filter rows for update | [optional] | +|**updates** | **List<List<String>>** | List of column updates as [column_name, expression] pairs | | +|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the implementation. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/UpdateTableResponse.md b/java/lance-namespace-async-client/docs/UpdateTableResponse.md new file mode 100644 index 000000000..bb5daf627 --- /dev/null +++ b/java/lance-namespace-async-client/docs/UpdateTableResponse.md @@ -0,0 +1,16 @@ + + +# UpdateTableResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | +|**updatedRows** | **Long** | Number of rows updated | | +|**version** | **Long** | The commit version associated with the operation | | +|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/UpdateTableSchemaMetadataRequest.md b/java/lance-namespace-async-client/docs/UpdateTableSchemaMetadataRequest.md new file mode 100644 index 000000000..9f715b3bd --- /dev/null +++ b/java/lance-namespace-async-client/docs/UpdateTableSchemaMetadataRequest.md @@ -0,0 +1,16 @@ + + +# UpdateTableSchemaMetadataRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | The table identifier | [optional] | +|**metadata** | **Map<String, String>** | Schema metadata key-value pairs to set | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/UpdateTableSchemaMetadataResponse.md b/java/lance-namespace-async-client/docs/UpdateTableSchemaMetadataResponse.md new file mode 100644 index 000000000..40d52bd30 --- /dev/null +++ b/java/lance-namespace-async-client/docs/UpdateTableSchemaMetadataResponse.md @@ -0,0 +1,14 @@ + + +# UpdateTableSchemaMetadataResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**metadata** | **Map<String, String>** | The updated schema metadata | [optional] | +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/UpdateTableTagRequest.md b/java/lance-namespace-async-client/docs/UpdateTableTagRequest.md new file mode 100644 index 000000000..94d1ec9e6 --- /dev/null +++ b/java/lance-namespace-async-client/docs/UpdateTableTagRequest.md @@ -0,0 +1,17 @@ + + +# UpdateTableTagRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**identity** | [**Identity**](Identity.md) | | [optional] | +|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | +|**id** | **List<String>** | | [optional] | +|**tag** | **String** | Name of the tag to update | | +|**version** | **Long** | New version number for the tag to point to | | + + + diff --git a/java/lance-namespace-async-client/docs/UpdateTableTagResponse.md b/java/lance-namespace-async-client/docs/UpdateTableTagResponse.md new file mode 100644 index 000000000..8f499ef62 --- /dev/null +++ b/java/lance-namespace-async-client/docs/UpdateTableTagResponse.md @@ -0,0 +1,14 @@ + + +# UpdateTableTagResponse + +Response for update tag operation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transactionId** | **String** | Optional transaction identifier | [optional] | + + + diff --git a/java/lance-namespace-async-client/docs/VersionRange.md b/java/lance-namespace-async-client/docs/VersionRange.md new file mode 100644 index 000000000..a034cbee3 --- /dev/null +++ b/java/lance-namespace-async-client/docs/VersionRange.md @@ -0,0 +1,15 @@ + + +# VersionRange + +A range of versions to delete (start inclusive, end exclusive). Special values: - `start_version: 0` with `end_version: -1` means ALL versions + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**startVersion** | **Long** | Start version of the range (inclusive). Use 0 to start from the first version. | | +|**endVersion** | **Long** | End version of the range (exclusive). Use -1 to indicate all versions up to and including the latest. | | + + + diff --git a/java/lance-namespace-async-client/pom.xml b/java/lance-namespace-async-client/pom.xml new file mode 100644 index 000000000..ff5b60596 --- /dev/null +++ b/java/lance-namespace-async-client/pom.xml @@ -0,0 +1,116 @@ + + + 4.0.0 + + + org.lance + lance-namespace-root + 0.5.2 + + + lance-namespace-async-client + jar + + lance-namespace-async-client + Lance Namespace async HTTP client using Java 11+ native HttpClient + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 3 + + + 11 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 11 + 11 + 11 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + + + + 2.17.1 + 0.2.6 + 1.3.5 + + diff --git a/java/lance-namespace-async-client/src/main/AndroidManifest.xml b/java/lance-namespace-async-client/src/main/AndroidManifest.xml new file mode 100644 index 000000000..fa6f45577 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiClient.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiClient.java new file mode 100644 index 000000000..611bae3b0 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiClient.java @@ -0,0 +1,445 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; + +import java.io.InputStream; +import java.net.URI; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the various API classes. + * The API classes use the settings in this class to configure themselves, but otherwise do not + * store a link to this class. + * + *

This class is mutable and not synchronized, so it is not thread-safe. The API classes + * generated from this are immutable and thread-safe. + * + *

The setter methods of this class return the current object to facilitate a fluent style of + * configuration. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ApiClient { + + private HttpClient.Builder builder; + private ObjectMapper mapper; + private String scheme; + private String host; + private int port; + private String basePath; + private Consumer interceptor; + private Consumer> responseInterceptor; + private Consumer> asyncResponseInterceptor; + private Duration readTimeout; + private Duration connectTimeout; + + public static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} objects. + * + *

The value can be null, in which case an empty list is returned. + * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be null. + * @return A singleton list of the {@link Pair} objects representing the input parameters, which + * is encoded for use in a URL. If the value is null, an empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be null. + * @return A list of {@link Pair} objects representing the input parameters, which is encoded for + * use in a URL. If the values collection is null, an empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = + collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch (format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + /** Create an instance of ApiClient. */ + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + public static ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); + return mapper; + } + + private String getDefaultBaseUri() { + return "http://localhost:2333"; + } + + public static HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public final void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); + } + + /** + * Set a custom {@link HttpClient.Builder} object to use when creating the {@link HttpClient} that + * is used by the API client. + * + * @param builder Custom client builder. + * @return This object. + */ + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; + return this; + } + + /** + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe. + * + * @return The HTTP client. + */ + public HttpClient getHttpClient() { + return builder.build(); + } + + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; + return this; + } + + /** + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. + */ + public ObjectMapper getObjectMapper() { + return mapper.copy(); + } + + /** + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. + */ + public ApiClient setHost(String host) { + this.host = host; + return this; + } + + /** + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the value to the default + * for the scheme. + * @return This object. + */ + public ApiClient setPort(int port) { + this.port = port; + return this; + } + + /** + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is resolved. + * @return This object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are resolved against. + */ + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; + } + + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme) { + this.scheme = scheme; + return this; + } + + /** + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it is sent. After the + * request has been fully configured but not yet built, the request builder is passed into this + * function for further modification, after which it is sent out. + * + *

This is useful for altering the requests in a custom manner, such as adding headers. It + * could also be used for logging and monitoring. + * + * @param interceptor A function invoked before creating each request. A value of null resets the + * interceptor to a no-op. + * @return This object. + */ + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; + } + + /** + * Get the custom interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer getRequestInterceptor() { + return interceptor; + } + + /** + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables + * + * @param interceptor A function invoked before creating each request. A value of null resets the + * interceptor to a no-op. + * @return This object. + */ + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; + } + + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getResponseInterceptor() { + return responseInterceptor; + } + + /** + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to + * 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables + * + * @param interceptor A function invoked before creating each request. A value of null resets the + * interceptor to a no-op. + * @return This object. + */ + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; + } + + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to + * 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; + } + + /** + * Set the read timeout for the http client. + * + *

This is the value used by default for each request, though it can be overridden on a + * per-request basis with a request interceptor. + * + * @param readTimeout The read timeout used by default by the http client. Setting this value to + * null resets the timeout to an effectively infinite value. + * @return This object. + */ + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents an infinite wait time. + */ + public Duration getReadTimeout() { + return readTimeout; + } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if the connection cannot be + * established within the given {@code duration}, then {@link + * HttpClient#send(HttpRequest,BodyHandler) HttpClient::send} throws an {@link + * HttpConnectTimeoutException}, or {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an {@code HttpConnectTimeoutException}. If + * a new connection does not need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiException.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiException.java new file mode 100644 index 000000000..c3dd5a4f4 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiException.java @@ -0,0 +1,99 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import java.net.http.HttpHeaders; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private HttpHeaders responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException( + String message, + Throwable throwable, + int code, + HttpHeaders responseHeaders, + String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, HttpHeaders 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 Headers as an HttpHeaders object + */ + public HttpHeaders getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiResponse.java new file mode 100644 index 000000000..17cece85c --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ApiResponse.java @@ -0,0 +1,62 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * @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); + } + + /** + * @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; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/Configuration.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/Configuration.java new file mode 100644 index 000000000..c65cc401c --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/Configuration.java @@ -0,0 +1,43 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Configuration { + public static final String VERSION = "0.5.2"; + + private static volatile 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/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/JSON.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/JSON.java new file mode 100644 index 000000000..0f49d13be --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/JSON.java @@ -0,0 +1,266 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import org.lance.namespace.model.*; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class JSON { + private ObjectMapper mapper; + + public JSON() { + mapper = + JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * Returns the target model class that should be used to deserialize the input data. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + * @return the target model class. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** Helper class to register the discriminator mappings. */ + @javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. This + * function can be invoked for anyOf/oneOf composed models with discriminator mappings. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + * @return the target model class. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + *

The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, so + * it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. + */ + public static boolean isInstanceOf( + Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** A map of discriminators for all model classes. */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** A map of oneOf/anyOf descendants for each model class. */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator( + Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = + new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/Pair.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/Pair.java new file mode 100644 index 000000000..ab88b382a --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/Pair.java @@ -0,0 +1,59 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +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/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/RFC3339DateFormat.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/RFC3339DateFormat.java new file mode 100644 index 000000000..c5300d92a --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/RFC3339DateFormat.java @@ -0,0 +1,60 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = + new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ServerConfiguration.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ServerConfiguration.java new file mode 100644 index 000000000..532c2f1bc --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ServerConfiguration.java @@ -0,0 +1,75 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import java.util.Map; + +/** Representing a Server configuration. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for + * substitution in the server's URL template. + */ + public ServerConfiguration( + String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable : this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ServerVariable.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ServerVariable.java new file mode 100644 index 000000000..3063d1e01 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/ServerVariable.java @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async; + +import java.util.HashSet; + +/** Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are + * from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java new file mode 100644 index 000000000..a89551385 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java @@ -0,0 +1,1766 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.AlterTableAddColumnsRequest; +import org.lance.namespace.model.AlterTableAddColumnsResponse; +import org.lance.namespace.model.AnalyzeTableQueryPlanRequest; +import org.lance.namespace.model.CountTableRowsRequest; +import org.lance.namespace.model.CreateTableResponse; +import org.lance.namespace.model.DeleteFromTableRequest; +import org.lance.namespace.model.DeleteFromTableResponse; +import org.lance.namespace.model.ExplainTableQueryPlanRequest; +import org.lance.namespace.model.InsertIntoTableResponse; +import org.lance.namespace.model.MergeInsertIntoTableResponse; +import org.lance.namespace.model.QueryTableRequest; +import org.lance.namespace.model.UpdateTableRequest; +import org.lance.namespace.model.UpdateTableResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DataApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DataApi() { + this(Configuration.getDefaultApiClient()); + } + + public DataApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Add new columns to table schema Add new columns to table `id` using SQL expressions + * or default values. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAddColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTableAddColumnsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTableAddColumns( + String id, AlterTableAddColumnsRequest alterTableAddColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAddColumnsRequestBuilder(id, alterTableAddColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAddColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Add new columns to table schema Add new columns to table `id` using SQL expressions + * or default values. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAddColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTableAddColumnsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + alterTableAddColumnsWithHttpInfo( + String id, AlterTableAddColumnsRequest alterTableAddColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAddColumnsRequestBuilder(id, alterTableAddColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAddColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTableAddColumnsRequestBuilder( + String id, AlterTableAddColumnsRequest alterTableAddColumnsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTableAddColumns"); + } + // verify the required parameter 'alterTableAddColumnsRequest' is set + if (alterTableAddColumnsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTableAddColumnsRequest' when calling alterTableAddColumns"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/add_columns".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(alterTableAddColumnsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Analyze query execution plan Analyze the query execution plan for a query against table + * `id`. Returns detailed statistics and analysis of the query execution plan. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `AnalyzeTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param analyzeTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<String> + * @throws ApiException if fails to make API call + */ + public CompletableFuture analyzeTableQueryPlan( + String id, AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + analyzeTableQueryPlanRequestBuilder(id, analyzeTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("analyzeTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Analyze query execution plan Analyze the query execution plan for a query against table + * `id`. Returns detailed statistics and analysis of the query execution plan. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `AnalyzeTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param analyzeTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> analyzeTableQueryPlanWithHttpInfo( + String id, AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + analyzeTableQueryPlanRequestBuilder(id, analyzeTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("analyzeTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder analyzeTableQueryPlanRequestBuilder( + String id, AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling analyzeTableQueryPlan"); + } + // verify the required parameter 'analyzeTableQueryPlanRequest' is set + if (analyzeTableQueryPlanRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'analyzeTableQueryPlanRequest' when calling analyzeTableQueryPlan"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/analyze_plan".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(analyzeTableQueryPlanRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Count rows in a table Count the number of rows in table `id` REST NAMESPACE ONLY REST + * namespace returns the response as a plain integer instead of the + * `CountTableRowsResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param countTableRowsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Long> + * @throws ApiException if fails to make API call + */ + public CompletableFuture countTableRows( + String id, CountTableRowsRequest countTableRowsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + countTableRowsRequestBuilder(id, countTableRowsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("countTableRows", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Count rows in a table Count the number of rows in table `id` REST NAMESPACE ONLY REST + * namespace returns the response as a plain integer instead of the + * `CountTableRowsResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param countTableRowsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Long>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> countTableRowsWithHttpInfo( + String id, CountTableRowsRequest countTableRowsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + countTableRowsRequestBuilder(id, countTableRowsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("countTableRows", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder countTableRowsRequestBuilder( + String id, CountTableRowsRequest countTableRowsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling countTableRows"); + } + // verify the required parameter 'countTableRowsRequest' is set + if (countTableRowsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'countTableRowsRequest' when calling countTableRows"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/count_rows".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(countTableRowsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a table with the given name Create table `id` in the namespace with the given + * data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If + * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses + * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` + * information in the following way: - `id`: pass through path parameter of the same + * name - `mode`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC data (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode (optional) + * @return CompletableFuture<CreateTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTable( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a table with the given name Create table `id` in the namespace with the given + * data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If + * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses + * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` + * information in the following way: - `id`: pass through path parameter of the same + * name - `mode`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC data (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode (optional) + * @return CompletableFuture<ApiResponse<CreateTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableWithHttpInfo( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableRequestBuilder( + String id, byte[] body, String delimiter, String mode) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling createTable"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "mode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mode", mode)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/vnd.apache.arrow.stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete rows from a table Delete rows from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteFromTableRequest Delete request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeleteFromTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteFromTable( + String id, DeleteFromTableRequest deleteFromTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteFromTableRequestBuilder(id, deleteFromTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteFromTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete rows from a table Delete rows from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteFromTableRequest Delete request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeleteFromTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteFromTableWithHttpInfo( + String id, DeleteFromTableRequest deleteFromTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteFromTableRequestBuilder(id, deleteFromTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteFromTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteFromTableRequestBuilder( + String id, DeleteFromTableRequest deleteFromTableRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteFromTable"); + } + // verify the required parameter 'deleteFromTableRequest' is set + if (deleteFromTableRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deleteFromTableRequest' when calling deleteFromTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteFromTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get query execution plan explanation Get the query execution plan for a query against table + * `id`. Returns a human-readable explanation of how the query will be executed. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `ExplainTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param explainTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<String> + * @throws ApiException if fails to make API call + */ + public CompletableFuture explainTableQueryPlan( + String id, ExplainTableQueryPlanRequest explainTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + explainTableQueryPlanRequestBuilder(id, explainTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("explainTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get query execution plan explanation Get the query execution plan for a query against table + * `id`. Returns a human-readable explanation of how the query will be executed. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `ExplainTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param explainTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> explainTableQueryPlanWithHttpInfo( + String id, ExplainTableQueryPlanRequest explainTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + explainTableQueryPlanRequestBuilder(id, explainTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("explainTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder explainTableQueryPlanRequestBuilder( + String id, ExplainTableQueryPlanRequest explainTableQueryPlanRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling explainTableQueryPlan"); + } + // verify the required parameter 'explainTableQueryPlanRequest' is set + if (explainTableQueryPlanRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'explainTableQueryPlanRequest' when calling explainTableQueryPlan"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/explain_plan".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(explainTableQueryPlanRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Insert records into a table Insert new records into table `id`. REST NAMESPACE ONLY + * REST namespace uses Arrow IPC stream as the request body. It passes in the + * `InsertIntoTableRequest` information in the following way: - `id`: pass + * through path parameter of the same name - `mode`: pass through query parameter of the + * same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC stream containing the records to insert (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode How the insert should behave. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - Append (default): insert data to the existing table - + * Overwrite: remove all data in the table and then insert data to it (optional, default to + * append) + * @return CompletableFuture<InsertIntoTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture insertIntoTable( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + insertIntoTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("insertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Insert records into a table Insert new records into table `id`. REST NAMESPACE ONLY + * REST namespace uses Arrow IPC stream as the request body. It passes in the + * `InsertIntoTableRequest` information in the following way: - `id`: pass + * through path parameter of the same name - `mode`: pass through query parameter of the + * same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC stream containing the records to insert (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode How the insert should behave. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - Append (default): insert data to the existing table - + * Overwrite: remove all data in the table and then insert data to it (optional, default to + * append) + * @return CompletableFuture<ApiResponse<InsertIntoTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> insertIntoTableWithHttpInfo( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + insertIntoTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("insertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder insertIntoTableRequestBuilder( + String id, byte[] body, String delimiter, String mode) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling insertIntoTable"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling insertIntoTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/insert".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "mode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mode", mode)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/vnd.apache.arrow.stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Merge insert (upsert) records into a table Performs a merge insert (upsert) operation on table + * `id`. This operation updates existing rows based on a matching column and inserts new + * rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE + * ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the + * `MergeInsertIntoTableRequest` information in the following way: - `id`: + * pass through path parameter of the same name - `on`: pass through query parameter of + * the same name - `when_matched_update_all`: pass through query parameter of the same + * name - `when_matched_update_all_filt`: pass through query parameter of the same name + * - `when_not_matched_insert_all`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete_filt`: pass through query parameter of the same + * name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param on Column name to use for matching rows (required) (required) + * @param body Arrow IPC stream containing the records to merge (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param whenMatchedUpdateAll Update all columns when rows match (optional, default to false) + * @param whenMatchedUpdateAllFilt The row is updated (similar to UpdateAll) only for rows where + * the SQL expression evaluates to true (optional) + * @param whenNotMatchedInsertAll Insert all columns when rows don't match (optional, default + * to false) + * @param whenNotMatchedBySourceDelete Delete all rows from target table that don't match a + * row in the source table (optional, default to false) + * @param whenNotMatchedBySourceDeleteFilt Delete rows from the target table if there is no match + * AND the SQL expression evaluates to true (optional) + * @param timeout Timeout for the operation (e.g., \"30s\", \"5m\") (optional) + * @param useIndex Whether to use index for matching rows (optional, default to false) + * @return CompletableFuture<MergeInsertIntoTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture mergeInsertIntoTable( + String id, + String on, + byte[] body, + String delimiter, + Boolean whenMatchedUpdateAll, + String whenMatchedUpdateAllFilt, + Boolean whenNotMatchedInsertAll, + Boolean whenNotMatchedBySourceDelete, + String whenNotMatchedBySourceDeleteFilt, + String timeout, + Boolean useIndex) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + mergeInsertIntoTableRequestBuilder( + id, + on, + body, + delimiter, + whenMatchedUpdateAll, + whenMatchedUpdateAllFilt, + whenNotMatchedInsertAll, + whenNotMatchedBySourceDelete, + whenNotMatchedBySourceDeleteFilt, + timeout, + useIndex); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("mergeInsertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Merge insert (upsert) records into a table Performs a merge insert (upsert) operation on table + * `id`. This operation updates existing rows based on a matching column and inserts new + * rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE + * ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the + * `MergeInsertIntoTableRequest` information in the following way: - `id`: + * pass through path parameter of the same name - `on`: pass through query parameter of + * the same name - `when_matched_update_all`: pass through query parameter of the same + * name - `when_matched_update_all_filt`: pass through query parameter of the same name + * - `when_not_matched_insert_all`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete_filt`: pass through query parameter of the same + * name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param on Column name to use for matching rows (required) (required) + * @param body Arrow IPC stream containing the records to merge (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param whenMatchedUpdateAll Update all columns when rows match (optional, default to false) + * @param whenMatchedUpdateAllFilt The row is updated (similar to UpdateAll) only for rows where + * the SQL expression evaluates to true (optional) + * @param whenNotMatchedInsertAll Insert all columns when rows don't match (optional, default + * to false) + * @param whenNotMatchedBySourceDelete Delete all rows from target table that don't match a + * row in the source table (optional, default to false) + * @param whenNotMatchedBySourceDeleteFilt Delete rows from the target table if there is no match + * AND the SQL expression evaluates to true (optional) + * @param timeout Timeout for the operation (e.g., \"30s\", \"5m\") (optional) + * @param useIndex Whether to use index for matching rows (optional, default to false) + * @return CompletableFuture<ApiResponse<MergeInsertIntoTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + mergeInsertIntoTableWithHttpInfo( + String id, + String on, + byte[] body, + String delimiter, + Boolean whenMatchedUpdateAll, + String whenMatchedUpdateAllFilt, + Boolean whenNotMatchedInsertAll, + Boolean whenNotMatchedBySourceDelete, + String whenNotMatchedBySourceDeleteFilt, + String timeout, + Boolean useIndex) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + mergeInsertIntoTableRequestBuilder( + id, + on, + body, + delimiter, + whenMatchedUpdateAll, + whenMatchedUpdateAllFilt, + whenNotMatchedInsertAll, + whenNotMatchedBySourceDelete, + whenNotMatchedBySourceDeleteFilt, + timeout, + useIndex); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("mergeInsertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder mergeInsertIntoTableRequestBuilder( + String id, + String on, + byte[] body, + String delimiter, + Boolean whenMatchedUpdateAll, + String whenMatchedUpdateAllFilt, + Boolean whenNotMatchedInsertAll, + Boolean whenNotMatchedBySourceDelete, + String whenNotMatchedBySourceDeleteFilt, + String timeout, + Boolean useIndex) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling mergeInsertIntoTable"); + } + // verify the required parameter 'on' is set + if (on == null) { + throw new ApiException( + 400, "Missing the required parameter 'on' when calling mergeInsertIntoTable"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling mergeInsertIntoTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/merge_insert".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "on"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("on", on)); + localVarQueryParameterBaseName = "when_matched_update_all"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("when_matched_update_all", whenMatchedUpdateAll)); + localVarQueryParameterBaseName = "when_matched_update_all_filt"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("when_matched_update_all_filt", whenMatchedUpdateAllFilt)); + localVarQueryParameterBaseName = "when_not_matched_insert_all"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("when_not_matched_insert_all", whenNotMatchedInsertAll)); + localVarQueryParameterBaseName = "when_not_matched_by_source_delete"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs( + "when_not_matched_by_source_delete", whenNotMatchedBySourceDelete)); + localVarQueryParameterBaseName = "when_not_matched_by_source_delete_filt"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs( + "when_not_matched_by_source_delete_filt", whenNotMatchedBySourceDeleteFilt)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + localVarQueryParameterBaseName = "use_index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("use_index", useIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/vnd.apache.arrow.stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Query a table Query table `id` with vector search, full text search and optional SQL + * filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST + * namespace returns the response as Arrow IPC file binary data instead of the + * `QueryTableResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param queryTableRequest Query request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<byte[]> + * @throws ApiException if fails to make API call + */ + public CompletableFuture queryTable( + String id, QueryTableRequest queryTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + queryTableRequestBuilder(id, queryTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("queryTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Query a table Query table `id` with vector search, full text search and optional SQL + * filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST + * namespace returns the response as Arrow IPC file binary data instead of the + * `QueryTableResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param queryTableRequest Query request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<byte[]>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> queryTableWithHttpInfo( + String id, QueryTableRequest queryTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + queryTableRequestBuilder(id, queryTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("queryTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder queryTableRequestBuilder( + String id, QueryTableRequest queryTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling queryTable"); + } + // verify the required parameter 'queryTableRequest' is set + if (queryTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'queryTableRequest' when calling queryTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/query".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/vnd.apache.arrow.file, application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(queryTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update rows in a table Update existing rows in table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableRequest Update request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<UpdateTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture updateTable( + String id, UpdateTableRequest updateTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableRequestBuilder(id, updateTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update rows in a table Update existing rows in table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableRequest Update request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<UpdateTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableWithHttpInfo( + String id, UpdateTableRequest updateTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableRequestBuilder(id, updateTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableRequestBuilder( + String id, UpdateTableRequest updateTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling updateTable"); + } + // verify the required parameter 'updateTableRequest' is set + if (updateTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'updateTableRequest' when calling updateTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/IndexApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/IndexApi.java new file mode 100644 index 000000000..c9f5d9860 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/IndexApi.java @@ -0,0 +1,884 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.CreateTableIndexRequest; +import org.lance.namespace.model.CreateTableIndexResponse; +import org.lance.namespace.model.CreateTableScalarIndexResponse; +import org.lance.namespace.model.DescribeTableIndexStatsRequest; +import org.lance.namespace.model.DescribeTableIndexStatsResponse; +import org.lance.namespace.model.DropTableIndexResponse; +import org.lance.namespace.model.ListTableIndicesRequest; +import org.lance.namespace.model.ListTableIndicesResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IndexApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public IndexApi() { + this(Configuration.getDefaultApiClient()); + } + + public IndexApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create an index on a table Create an index on a table column for faster search operations. + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, + * BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the + * `ListTableIndices` and `DescribeTableIndexStats` operations to monitor + * index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableIndex( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create an index on a table Create an index on a table column for faster search operations. + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, + * BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the + * `ListTableIndices` and `DescribeTableIndexStats` operations to monitor + * index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableIndexWithHttpInfo( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableIndexRequestBuilder( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableIndex"); + } + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableIndexRequest' when calling createTableIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create_index".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableIndexRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a scalar index on a table Create a scalar index on a table column for faster filtering + * operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias + * for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. + * Use the `ListTableIndices` and `DescribeTableIndexStats` operations to + * monitor index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Scalar index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableScalarIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableScalarIndex( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableScalarIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableScalarIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a scalar index on a table Create a scalar index on a table column for faster filtering + * operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias + * for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. + * Use the `ListTableIndices` and `DescribeTableIndexStats` operations to + * monitor index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Scalar index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableScalarIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + createTableScalarIndexWithHttpInfo( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableScalarIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableScalarIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableScalarIndexRequestBuilder( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableScalarIndex"); + } + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableIndexRequest' when calling createTableScalarIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create_scalar_index".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableIndexRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get table index statistics Get statistics for a specific index on a table. Returns information + * about the index type, distance type (for vector indices), and row counts. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to get stats for (required) + * @param describeTableIndexStatsRequest Index stats request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTableIndexStatsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTableIndexStats( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableIndexStatsRequestBuilder( + id, indexName, describeTableIndexStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableIndexStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get table index statistics Get statistics for a specific index on a table. Returns information + * about the index type, distance type (for vector indices), and row counts. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to get stats for (required) + * @param describeTableIndexStatsRequest Index stats request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTableIndexStatsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTableIndexStatsWithHttpInfo( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableIndexStatsRequestBuilder( + id, indexName, describeTableIndexStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableIndexStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableIndexStatsRequestBuilder( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTableIndexStats"); + } + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + 400, "Missing the required parameter 'indexName' when calling describeTableIndexStats"); + } + // verify the required parameter 'describeTableIndexStatsRequest' is set + if (describeTableIndexStatsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTableIndexStatsRequest' when calling describeTableIndexStats"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/{index_name}/stats" + .replace("{id}", ApiClient.urlEncode(id.toString())) + .replace("{index_name}", ApiClient.urlEncode(indexName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(describeTableIndexStatsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a specific index Drop the specified index from table `id`. REST NAMESPACE ONLY + * REST namespace does not use a request body for this operation. The + * `DropTableIndexRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `index_name`: pass through path + * parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to drop (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropTableIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropTableIndex( + String id, String indexName, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropTableIndexRequestBuilder(id, indexName, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a specific index Drop the specified index from table `id`. REST NAMESPACE ONLY + * REST namespace does not use a request body for this operation. The + * `DropTableIndexRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `index_name`: pass through path + * parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to drop (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropTableIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropTableIndexWithHttpInfo( + String id, String indexName, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropTableIndexRequestBuilder(id, indexName, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropTableIndexRequestBuilder( + String id, String indexName, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling dropTableIndex"); + } + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + 400, "Missing the required parameter 'indexName' when calling dropTableIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/{index_name}/drop" + .replace("{id}", ApiClient.urlEncode(id.toString())) + .replace("{index_name}", ApiClient.urlEncode(indexName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List indexes on a table List all indices created on a table. Returns information about each + * index including name, columns, status, and UUID. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param listTableIndicesRequest Index list request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ListTableIndicesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableIndices( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableIndicesRequestBuilder(id, listTableIndicesRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableIndices", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List indexes on a table List all indices created on a table. Returns information about each + * index including name, columns, status, and UUID. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param listTableIndicesRequest Index list request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<ListTableIndicesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableIndicesWithHttpInfo( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableIndicesRequestBuilder(id, listTableIndicesRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableIndices", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableIndicesRequestBuilder( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listTableIndices"); + } + // verify the required parameter 'listTableIndicesRequest' is set + if (listTableIndicesRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'listTableIndicesRequest' when calling listTableIndices"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(listTableIndicesRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java new file mode 100644 index 000000000..faa0d640e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java @@ -0,0 +1,5657 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.AlterTableAlterColumnsRequest; +import org.lance.namespace.model.AlterTableAlterColumnsResponse; +import org.lance.namespace.model.AlterTableDropColumnsRequest; +import org.lance.namespace.model.AlterTableDropColumnsResponse; +import org.lance.namespace.model.AlterTransactionRequest; +import org.lance.namespace.model.AlterTransactionResponse; +import org.lance.namespace.model.BatchCreateTableVersionsRequest; +import org.lance.namespace.model.BatchCreateTableVersionsResponse; +import org.lance.namespace.model.BatchDeleteTableVersionsRequest; +import org.lance.namespace.model.BatchDeleteTableVersionsResponse; +import org.lance.namespace.model.CreateEmptyTableRequest; +import org.lance.namespace.model.CreateEmptyTableResponse; +import org.lance.namespace.model.CreateNamespaceRequest; +import org.lance.namespace.model.CreateNamespaceResponse; +import org.lance.namespace.model.CreateTableIndexRequest; +import org.lance.namespace.model.CreateTableIndexResponse; +import org.lance.namespace.model.CreateTableScalarIndexResponse; +import org.lance.namespace.model.CreateTableTagRequest; +import org.lance.namespace.model.CreateTableTagResponse; +import org.lance.namespace.model.CreateTableVersionRequest; +import org.lance.namespace.model.CreateTableVersionResponse; +import org.lance.namespace.model.DeclareTableRequest; +import org.lance.namespace.model.DeclareTableResponse; +import org.lance.namespace.model.DeleteTableTagRequest; +import org.lance.namespace.model.DeleteTableTagResponse; +import org.lance.namespace.model.DeregisterTableRequest; +import org.lance.namespace.model.DeregisterTableResponse; +import org.lance.namespace.model.DescribeNamespaceRequest; +import org.lance.namespace.model.DescribeNamespaceResponse; +import org.lance.namespace.model.DescribeTableIndexStatsRequest; +import org.lance.namespace.model.DescribeTableIndexStatsResponse; +import org.lance.namespace.model.DescribeTableRequest; +import org.lance.namespace.model.DescribeTableResponse; +import org.lance.namespace.model.DescribeTableVersionRequest; +import org.lance.namespace.model.DescribeTableVersionResponse; +import org.lance.namespace.model.DescribeTransactionRequest; +import org.lance.namespace.model.DescribeTransactionResponse; +import org.lance.namespace.model.DropNamespaceRequest; +import org.lance.namespace.model.DropNamespaceResponse; +import org.lance.namespace.model.DropTableIndexResponse; +import org.lance.namespace.model.DropTableResponse; +import org.lance.namespace.model.GetTableStatsRequest; +import org.lance.namespace.model.GetTableStatsResponse; +import org.lance.namespace.model.GetTableTagVersionRequest; +import org.lance.namespace.model.GetTableTagVersionResponse; +import org.lance.namespace.model.ListNamespacesResponse; +import org.lance.namespace.model.ListTableIndicesRequest; +import org.lance.namespace.model.ListTableIndicesResponse; +import org.lance.namespace.model.ListTableTagsResponse; +import org.lance.namespace.model.ListTableVersionsResponse; +import org.lance.namespace.model.ListTablesResponse; +import org.lance.namespace.model.NamespaceExistsRequest; +import org.lance.namespace.model.RegisterTableRequest; +import org.lance.namespace.model.RegisterTableResponse; +import org.lance.namespace.model.RenameTableRequest; +import org.lance.namespace.model.RenameTableResponse; +import org.lance.namespace.model.RestoreTableRequest; +import org.lance.namespace.model.RestoreTableResponse; +import org.lance.namespace.model.TableExistsRequest; +import org.lance.namespace.model.UpdateTableTagRequest; +import org.lance.namespace.model.UpdateTableTagResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MetadataApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public MetadataApi() { + this(Configuration.getDefaultApiClient()); + } + + public MetadataApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Modify existing columns Modify existing columns in table `id`, such as renaming or + * changing data types. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAlterColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTableAlterColumnsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTableAlterColumns( + String id, AlterTableAlterColumnsRequest alterTableAlterColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAlterColumnsRequestBuilder(id, alterTableAlterColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAlterColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Modify existing columns Modify existing columns in table `id`, such as renaming or + * changing data types. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAlterColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTableAlterColumnsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + alterTableAlterColumnsWithHttpInfo( + String id, AlterTableAlterColumnsRequest alterTableAlterColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAlterColumnsRequestBuilder(id, alterTableAlterColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAlterColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTableAlterColumnsRequestBuilder( + String id, AlterTableAlterColumnsRequest alterTableAlterColumnsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTableAlterColumns"); + } + // verify the required parameter 'alterTableAlterColumnsRequest' is set + if (alterTableAlterColumnsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTableAlterColumnsRequest' when calling alterTableAlterColumns"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/alter_columns".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(alterTableAlterColumnsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove columns from table Remove specified columns from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableDropColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTableDropColumnsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTableDropColumns( + String id, AlterTableDropColumnsRequest alterTableDropColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableDropColumnsRequestBuilder(id, alterTableDropColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableDropColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Remove columns from table Remove specified columns from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableDropColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTableDropColumnsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + alterTableDropColumnsWithHttpInfo( + String id, AlterTableDropColumnsRequest alterTableDropColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableDropColumnsRequestBuilder(id, alterTableDropColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableDropColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTableDropColumnsRequestBuilder( + String id, AlterTableDropColumnsRequest alterTableDropColumnsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTableDropColumns"); + } + // verify the required parameter 'alterTableDropColumnsRequest' is set + if (alterTableDropColumnsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTableDropColumnsRequest' when calling alterTableDropColumns"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/drop_columns".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(alterTableDropColumnsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Alter information of a transaction. Alter a transaction with a list of actions such as setting + * status or properties. The server should either succeed and apply all actions, or fail and apply + * no action. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTransactionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTransaction( + String id, AlterTransactionRequest alterTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTransactionRequestBuilder(id, alterTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Alter information of a transaction. Alter a transaction with a list of actions such as setting + * status or properties. The server should either succeed and apply all actions, or fail and apply + * no action. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTransactionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> alterTransactionWithHttpInfo( + String id, AlterTransactionRequest alterTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTransactionRequestBuilder(id, alterTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTransactionRequestBuilder( + String id, AlterTransactionRequest alterTransactionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTransaction"); + } + // verify the required parameter 'alterTransactionRequest' is set + if (alterTransactionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTransactionRequest' when calling alterTransaction"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/transaction/{id}/alter".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(alterTransactionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Atomically create versions for multiple tables Atomically create new version entries for + * multiple tables. This operation is atomic: either all table versions are created successfully, + * or none are created. If any version creation fails (e.g., due to conflict), the entire batch + * operation fails. Each entry in the request specifies the table identifier and version details. + * This supports `put_if_not_exists` semantics for each version entry. + * + * @param batchCreateTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<BatchCreateTableVersionsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture batchCreateTableVersions( + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchCreateTableVersionsRequestBuilder(batchCreateTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchCreateTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Atomically create versions for multiple tables Atomically create new version entries for + * multiple tables. This operation is atomic: either all table versions are created successfully, + * or none are created. If any version creation fails (e.g., due to conflict), the entire batch + * operation fails. Each entry in the request specifies the table identifier and version details. + * This supports `put_if_not_exists` semantics for each version entry. + * + * @param batchCreateTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<BatchCreateTableVersionsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + batchCreateTableVersionsWithHttpInfo( + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchCreateTableVersionsRequestBuilder(batchCreateTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchCreateTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder batchCreateTableVersionsRequestBuilder( + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'batchCreateTableVersionsRequest' is set + if (batchCreateTableVersionsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'batchCreateTableVersionsRequest' when calling batchCreateTableVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/table/version/batch-create"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(batchCreateTableVersionsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete table version records Delete version metadata records for table `id`. This + * operation deletes version tracking records, NOT the actual table data. It supports deleting + * ranges of versions for efficient bulk cleanup. Special range values: - `start_version: + * 0` with `end_version: -1` means delete ALL version records + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param batchDeleteTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<BatchDeleteTableVersionsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture batchDeleteTableVersions( + String id, BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchDeleteTableVersionsRequestBuilder(id, batchDeleteTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchDeleteTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete table version records Delete version metadata records for table `id`. This + * operation deletes version tracking records, NOT the actual table data. It supports deleting + * ranges of versions for efficient bulk cleanup. Special range values: - `start_version: + * 0` with `end_version: -1` means delete ALL version records + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param batchDeleteTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<BatchDeleteTableVersionsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + batchDeleteTableVersionsWithHttpInfo( + String id, + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchDeleteTableVersionsRequestBuilder(id, batchDeleteTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchDeleteTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder batchDeleteTableVersionsRequestBuilder( + String id, BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling batchDeleteTableVersions"); + } + // verify the required parameter 'batchDeleteTableVersionsRequest' is set + if (batchDeleteTableVersionsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'batchDeleteTableVersionsRequest' when calling batchDeleteTableVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(batchDeleteTableVersionsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create an empty table Create an empty table with the given name without touching storage. This + * is a metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. **Deprecated**: Use `DeclareTable` instead. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createEmptyTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateEmptyTableResponse> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CompletableFuture createEmptyTable( + String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createEmptyTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create an empty table Create an empty table with the given name without touching storage. This + * is a metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. **Deprecated**: Use `DeclareTable` instead. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createEmptyTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateEmptyTableResponse>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CompletableFuture> createEmptyTableWithHttpInfo( + String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createEmptyTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createEmptyTableRequestBuilder( + String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createEmptyTable"); + } + // verify the required parameter 'createEmptyTableRequest' is set + if (createEmptyTableRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createEmptyTableRequest' when calling createEmptyTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create-empty".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createEmptyTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new namespace Create new namespace `id`. During the creation process, the + * implementation may modify user-provided `properties`, such as adding additional + * properties like `created_at` to user-provided properties, omitting any specific + * property, or performing actions based on any property value. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateNamespaceResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createNamespace( + String id, CreateNamespaceRequest createNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createNamespaceRequestBuilder(id, createNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new namespace Create new namespace `id`. During the creation process, the + * implementation may modify user-provided `properties`, such as adding additional + * properties like `created_at` to user-provided properties, omitting any specific + * property, or performing actions based on any property value. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateNamespaceResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createNamespaceWithHttpInfo( + String id, CreateNamespaceRequest createNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createNamespaceRequestBuilder(id, createNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createNamespaceRequestBuilder( + String id, CreateNamespaceRequest createNamespaceRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createNamespace"); + } + // verify the required parameter 'createNamespaceRequest' is set + if (createNamespaceRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createNamespaceRequest' when calling createNamespace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createNamespaceRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create an index on a table Create an index on a table column for faster search operations. + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, + * BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the + * `ListTableIndices` and `DescribeTableIndexStats` operations to monitor + * index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableIndex( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create an index on a table Create an index on a table column for faster search operations. + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, + * BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the + * `ListTableIndices` and `DescribeTableIndexStats` operations to monitor + * index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableIndexWithHttpInfo( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableIndexRequestBuilder( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableIndex"); + } + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableIndexRequest' when calling createTableIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create_index".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableIndexRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a scalar index on a table Create a scalar index on a table column for faster filtering + * operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias + * for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. + * Use the `ListTableIndices` and `DescribeTableIndexStats` operations to + * monitor index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Scalar index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableScalarIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableScalarIndex( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableScalarIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableScalarIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a scalar index on a table Create a scalar index on a table column for faster filtering + * operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias + * for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. + * Use the `ListTableIndices` and `DescribeTableIndexStats` operations to + * monitor index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Scalar index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableScalarIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + createTableScalarIndexWithHttpInfo( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableScalarIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableScalarIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableScalarIndexRequestBuilder( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableScalarIndex"); + } + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableIndexRequest' when calling createTableScalarIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create_scalar_index".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableIndexRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new tag Create a new tag for table `id` that points to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableTag( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableTagRequestBuilder(id, createTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new tag Create a new tag for table `id` that points to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableTagWithHttpInfo( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableTagRequestBuilder(id, createTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableTagRequestBuilder( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableTag"); + } + // verify the required parameter 'createTableTagRequest' is set + if (createTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableTagRequest' when calling createTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new table version Create a new version entry for table `id`. This operation + * supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if + * the version already exists. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableVersion( + String id, CreateTableVersionRequest createTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableVersionRequestBuilder(id, createTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new table version Create a new version entry for table `id`. This operation + * supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if + * the version already exists. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableVersionWithHttpInfo( + String id, CreateTableVersionRequest createTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableVersionRequestBuilder(id, createTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableVersionRequestBuilder( + String id, CreateTableVersionRequest createTableVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableVersion"); + } + // verify the required parameter 'createTableVersionRequest' is set + if (createTableVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableVersionRequest' when calling createTableVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Declare a table Declare a table with the given name without touching storage. This is a + * metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param declareTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeclareTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture declareTable( + String id, DeclareTableRequest declareTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + declareTableRequestBuilder(id, declareTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("declareTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Declare a table Declare a table with the given name without touching storage. This is a + * metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param declareTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeclareTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> declareTableWithHttpInfo( + String id, DeclareTableRequest declareTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + declareTableRequestBuilder(id, declareTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("declareTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder declareTableRequestBuilder( + String id, DeclareTableRequest declareTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling declareTable"); + } + // verify the required parameter 'declareTableRequest' is set + if (declareTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'declareTableRequest' when calling declareTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/declare".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(declareTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete a tag Delete an existing tag from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeleteTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteTableTag( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteTableTagRequestBuilder(id, deleteTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete a tag Delete an existing tag from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeleteTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteTableTagWithHttpInfo( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteTableTagRequestBuilder(id, deleteTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteTableTagRequestBuilder( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteTableTag"); + } + // verify the required parameter 'deleteTableTagRequest' is set + if (deleteTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deleteTableTagRequest' when calling deleteTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deregister a table Deregister table `id` from its namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deregisterTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeregisterTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deregisterTable( + String id, DeregisterTableRequest deregisterTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deregisterTableRequestBuilder(id, deregisterTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deregisterTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Deregister a table Deregister table `id` from its namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deregisterTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeregisterTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deregisterTableWithHttpInfo( + String id, DeregisterTableRequest deregisterTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deregisterTableRequestBuilder(id, deregisterTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deregisterTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deregisterTableRequestBuilder( + String id, DeregisterTableRequest deregisterTableRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deregisterTable"); + } + // verify the required parameter 'deregisterTableRequest' is set + if (deregisterTableRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deregisterTableRequest' when calling deregisterTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/deregister".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deregisterTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe a namespace Describe the detailed information for namespace `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeNamespaceResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeNamespace( + String id, DescribeNamespaceRequest describeNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeNamespaceRequestBuilder(id, describeNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe a namespace Describe the detailed information for namespace `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeNamespaceResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> describeNamespaceWithHttpInfo( + String id, DescribeNamespaceRequest describeNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeNamespaceRequestBuilder(id, describeNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeNamespaceRequestBuilder( + String id, DescribeNamespaceRequest describeNamespaceRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeNamespace"); + } + // verify the required parameter 'describeNamespaceRequest' is set + if (describeNamespaceRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeNamespaceRequest' when calling describeNamespace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(describeNamespaceRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe information of a table Describe the detailed information for table `id`. + * REST NAMESPACE ONLY REST namespace passes `with_table_uri` and + * `load_detailed_metadata` as query parameters instead of in the request body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param withTableUri Whether to include the table URI in the response (optional, default to + * false) + * @param loadDetailedMetadata Whether to load detailed metadata that requires opening the + * dataset. When false (default), only `location` is required in the response. When + * true, the response includes additional metadata such as `version`, + * `schema`, and `stats`. (optional, default to false) + * @return CompletableFuture<DescribeTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTable( + String id, + DescribeTableRequest describeTableRequest, + String delimiter, + Boolean withTableUri, + Boolean loadDetailedMetadata) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableRequestBuilder( + id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe information of a table Describe the detailed information for table `id`. + * REST NAMESPACE ONLY REST namespace passes `with_table_uri` and + * `load_detailed_metadata` as query parameters instead of in the request body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param withTableUri Whether to include the table URI in the response (optional, default to + * false) + * @param loadDetailedMetadata Whether to load detailed metadata that requires opening the + * dataset. When false (default), only `location` is required in the response. When + * true, the response includes additional metadata such as `version`, + * `schema`, and `stats`. (optional, default to false) + * @return CompletableFuture<ApiResponse<DescribeTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> describeTableWithHttpInfo( + String id, + DescribeTableRequest describeTableRequest, + String delimiter, + Boolean withTableUri, + Boolean loadDetailedMetadata) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableRequestBuilder( + id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableRequestBuilder( + String id, + DescribeTableRequest describeTableRequest, + String delimiter, + Boolean withTableUri, + Boolean loadDetailedMetadata) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling describeTable"); + } + // verify the required parameter 'describeTableRequest' is set + if (describeTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'describeTableRequest' when calling describeTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "with_table_uri"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("with_table_uri", withTableUri)); + localVarQueryParameterBaseName = "load_detailed_metadata"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("load_detailed_metadata", loadDetailedMetadata)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(describeTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get table index statistics Get statistics for a specific index on a table. Returns information + * about the index type, distance type (for vector indices), and row counts. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to get stats for (required) + * @param describeTableIndexStatsRequest Index stats request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTableIndexStatsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTableIndexStats( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableIndexStatsRequestBuilder( + id, indexName, describeTableIndexStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableIndexStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get table index statistics Get statistics for a specific index on a table. Returns information + * about the index type, distance type (for vector indices), and row counts. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to get stats for (required) + * @param describeTableIndexStatsRequest Index stats request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTableIndexStatsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTableIndexStatsWithHttpInfo( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableIndexStatsRequestBuilder( + id, indexName, describeTableIndexStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableIndexStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableIndexStatsRequestBuilder( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTableIndexStats"); + } + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + 400, "Missing the required parameter 'indexName' when calling describeTableIndexStats"); + } + // verify the required parameter 'describeTableIndexStatsRequest' is set + if (describeTableIndexStatsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTableIndexStatsRequest' when calling describeTableIndexStats"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/{index_name}/stats" + .replace("{id}", ApiClient.urlEncode(id.toString())) + .replace("{index_name}", ApiClient.urlEncode(indexName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(describeTableIndexStatsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe a specific table version Describe the detailed information for a specific version of + * table `id`. Returns the manifest path and metadata for the specified version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTableVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTableVersion( + String id, DescribeTableVersionRequest describeTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableVersionRequestBuilder(id, describeTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe a specific table version Describe the detailed information for a specific version of + * table `id`. Returns the manifest path and metadata for the specified version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTableVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTableVersionWithHttpInfo( + String id, DescribeTableVersionRequest describeTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableVersionRequestBuilder(id, describeTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableVersionRequestBuilder( + String id, DescribeTableVersionRequest describeTableVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTableVersion"); + } + // verify the required parameter 'describeTableVersionRequest' is set + if (describeTableVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTableVersionRequest' when calling describeTableVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(describeTableVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe information about a transaction Return a detailed information for a given transaction + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTransactionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTransaction( + String id, DescribeTransactionRequest describeTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTransactionRequestBuilder(id, describeTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe information about a transaction Return a detailed information for a given transaction + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTransactionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTransactionWithHttpInfo( + String id, DescribeTransactionRequest describeTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTransactionRequestBuilder(id, describeTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTransactionRequestBuilder( + String id, DescribeTransactionRequest describeTransactionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTransaction"); + } + // verify the required parameter 'describeTransactionRequest' is set + if (describeTransactionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTransactionRequest' when calling describeTransaction"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/transaction/{id}/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(describeTransactionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a namespace Drop namespace `id` from its parent namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param dropNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropNamespaceResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropNamespace( + String id, DropNamespaceRequest dropNamespaceRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropNamespaceRequestBuilder(id, dropNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a namespace Drop namespace `id` from its parent namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param dropNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropNamespaceResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropNamespaceWithHttpInfo( + String id, DropNamespaceRequest dropNamespaceRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropNamespaceRequestBuilder(id, dropNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropNamespaceRequestBuilder( + String id, DropNamespaceRequest dropNamespaceRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling dropNamespace"); + } + // verify the required parameter 'dropNamespaceRequest' is set + if (dropNamespaceRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'dropNamespaceRequest' when calling dropNamespace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/drop".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dropNamespaceRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a table Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace + * does not use a request body for this operation. The `DropTableRequest` information is + * passed in the following way: - `id`: pass through path parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropTable(String id, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = dropTableRequestBuilder(id, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a table Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace + * does not use a request body for this operation. The `DropTableRequest` information is + * passed in the following way: - `id`: pass through path parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropTableWithHttpInfo( + String id, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = dropTableRequestBuilder(id, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropTableRequestBuilder(String id, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling dropTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/table/{id}/drop".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a specific index Drop the specified index from table `id`. REST NAMESPACE ONLY + * REST namespace does not use a request body for this operation. The + * `DropTableIndexRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `index_name`: pass through path + * parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to drop (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropTableIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropTableIndex( + String id, String indexName, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropTableIndexRequestBuilder(id, indexName, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a specific index Drop the specified index from table `id`. REST NAMESPACE ONLY + * REST namespace does not use a request body for this operation. The + * `DropTableIndexRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `index_name`: pass through path + * parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to drop (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropTableIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropTableIndexWithHttpInfo( + String id, String indexName, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropTableIndexRequestBuilder(id, indexName, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropTableIndexRequestBuilder( + String id, String indexName, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling dropTableIndex"); + } + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + 400, "Missing the required parameter 'indexName' when calling dropTableIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/{index_name}/drop" + .replace("{id}", ApiClient.urlEncode(id.toString())) + .replace("{index_name}", ApiClient.urlEncode(indexName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get table statistics Get statistics for table `id`, including row counts, data sizes, + * and column statistics. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableStatsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<GetTableStatsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getTableStats( + String id, GetTableStatsRequest getTableStatsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableStatsRequestBuilder(id, getTableStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get table statistics Get statistics for table `id`, including row counts, data sizes, + * and column statistics. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableStatsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<GetTableStatsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getTableStatsWithHttpInfo( + String id, GetTableStatsRequest getTableStatsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableStatsRequestBuilder(id, getTableStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getTableStatsRequestBuilder( + String id, GetTableStatsRequest getTableStatsRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getTableStats"); + } + // verify the required parameter 'getTableStatsRequest' is set + if (getTableStatsRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'getTableStatsRequest' when calling getTableStats"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/stats".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getTableStatsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get version for a specific tag Get the version number that a specific tag points to for table + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableTagVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<GetTableTagVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getTableTagVersion( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableTagVersionRequestBuilder(id, getTableTagVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableTagVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get version for a specific tag Get the version number that a specific tag points to for table + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableTagVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<GetTableTagVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getTableTagVersionWithHttpInfo( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableTagVersionRequestBuilder(id, getTableTagVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableTagVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getTableTagVersionRequestBuilder( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getTableTagVersion"); + } + // verify the required parameter 'getTableTagVersionRequest' is set + if (getTableTagVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'getTableTagVersionRequest' when calling getTableTagVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/version".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getTableTagVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List namespaces List all child namespace names of the parent namespace `id`. REST + * NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It + * passes in the `ListNamespacesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListNamespacesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listNamespaces( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listNamespacesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listNamespaces", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List namespaces List all child namespace names of the parent namespace `id`. REST + * NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It + * passes in the `ListNamespacesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListNamespacesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listNamespacesWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listNamespacesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listNamespaces", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listNamespacesRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listNamespaces"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List indexes on a table List all indices created on a table. Returns information about each + * index including name, columns, status, and UUID. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param listTableIndicesRequest Index list request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ListTableIndicesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableIndices( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableIndicesRequestBuilder(id, listTableIndicesRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableIndices", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List indexes on a table List all indices created on a table. Returns information about each + * index including name, columns, status, and UUID. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param listTableIndicesRequest Index list request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<ListTableIndicesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableIndicesWithHttpInfo( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableIndicesRequestBuilder(id, listTableIndicesRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableIndices", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableIndicesRequestBuilder( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listTableIndices"); + } + // verify the required parameter 'listTableIndicesRequest' is set + if (listTableIndicesRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'listTableIndicesRequest' when calling listTableIndices"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(listTableIndicesRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all tags for a table List all tags that have been created for table `id`. + * Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableTagsRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `page_token`: pass through query + * parameter of the same name - `limit`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTableTagsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableTags( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableTagsRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableTags", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List all tags for a table List all tags that have been created for table `id`. + * Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableTagsRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `page_token`: pass through query + * parameter of the same name - `limit`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTableTagsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableTagsWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableTagsRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableTags", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableTagsRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling listTableTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all versions of a table List all versions (commits) of table `id` with their + * metadata. Use `descending=true` to guarantee versions are returned in descending + * order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableVersionsRequest` information is passed in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name - `descending`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @param descending When true, versions are guaranteed to be returned in descending order (latest + * to oldest). When false or not specified, the ordering is implementation-defined. (optional) + * @return CompletableFuture<ListTableVersionsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableVersions( + String id, String delimiter, String pageToken, Integer limit, Boolean descending) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableVersionsRequestBuilder(id, delimiter, pageToken, limit, descending); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List all versions of a table List all versions (commits) of table `id` with their + * metadata. Use `descending=true` to guarantee versions are returned in descending + * order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableVersionsRequest` information is passed in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name - `descending`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @param descending When true, versions are guaranteed to be returned in descending order (latest + * to oldest). When false or not specified, the ordering is implementation-defined. (optional) + * @return CompletableFuture<ApiResponse<ListTableVersionsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableVersionsWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit, Boolean descending) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableVersionsRequestBuilder(id, delimiter, pageToken, limit, descending); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableVersionsRequestBuilder( + String id, String delimiter, String pageToken, Integer limit, Boolean descending) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listTableVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "descending"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("descending", descending)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List tables in a namespace List all child table names of the parent namespace `id`. + * REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. + * It passes in the `ListTablesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTablesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTables( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTablesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List tables in a namespace List all child table names of the parent namespace `id`. + * REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. + * It passes in the `ListTablesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTablesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTablesWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTablesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTablesRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling listTables"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/table/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Check if a namespace exists Check if namespace `id` exists. This operation must + * behave exactly like the DescribeNamespace API, except it does not contain a response body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param namespaceExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Void> + * @throws ApiException if fails to make API call + */ + public CompletableFuture namespaceExists( + String id, NamespaceExistsRequest namespaceExistsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + namespaceExistsRequestBuilder(id, namespaceExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("namespaceExists", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Check if a namespace exists Check if namespace `id` exists. This operation must + * behave exactly like the DescribeNamespace API, except it does not contain a response body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param namespaceExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> namespaceExistsWithHttpInfo( + String id, NamespaceExistsRequest namespaceExistsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + namespaceExistsRequestBuilder(id, namespaceExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("namespaceExists", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null)); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder namespaceExistsRequestBuilder( + String id, NamespaceExistsRequest namespaceExistsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling namespaceExists"); + } + // verify the required parameter 'namespaceExistsRequest' is set + if (namespaceExistsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'namespaceExistsRequest' when calling namespaceExists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/exists".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(namespaceExistsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Register a table to a namespace Register an existing table at a given storage location as + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param registerTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<RegisterTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture registerTable( + String id, RegisterTableRequest registerTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + registerTableRequestBuilder(id, registerTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("registerTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Register a table to a namespace Register an existing table at a given storage location as + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param registerTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<RegisterTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> registerTableWithHttpInfo( + String id, RegisterTableRequest registerTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + registerTableRequestBuilder(id, registerTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("registerTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder registerTableRequestBuilder( + String id, RegisterTableRequest registerTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling registerTable"); + } + // verify the required parameter 'registerTableRequest' is set + if (registerTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'registerTableRequest' when calling registerTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/register".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(registerTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Rename a table Rename table `id` to a new name. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param renameTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<RenameTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture renameTable( + String id, RenameTableRequest renameTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + renameTableRequestBuilder(id, renameTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("renameTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Rename a table Rename table `id` to a new name. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param renameTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<RenameTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> renameTableWithHttpInfo( + String id, RenameTableRequest renameTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + renameTableRequestBuilder(id, renameTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("renameTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder renameTableRequestBuilder( + String id, RenameTableRequest renameTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling renameTable"); + } + // verify the required parameter 'renameTableRequest' is set + if (renameTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'renameTableRequest' when calling renameTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/rename".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(renameTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Restore table to a specific version Restore table `id` to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param restoreTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<RestoreTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture restoreTable( + String id, RestoreTableRequest restoreTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + restoreTableRequestBuilder(id, restoreTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("restoreTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Restore table to a specific version Restore table `id` to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param restoreTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<RestoreTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> restoreTableWithHttpInfo( + String id, RestoreTableRequest restoreTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + restoreTableRequestBuilder(id, restoreTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("restoreTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder restoreTableRequestBuilder( + String id, RestoreTableRequest restoreTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling restoreTable"); + } + // verify the required parameter 'restoreTableRequest' is set + if (restoreTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'restoreTableRequest' when calling restoreTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/restore".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(restoreTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Check if a table exists Check if table `id` exists. This operation should behave + * exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace + * implementation, a table exists if either: - The table has Lance data versions (regular table + * created with CreateTable) - A `.lance-reserved` file exists in the table directory + * (declared table created with DeclareTable) + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param tableExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Void> + * @throws ApiException if fails to make API call + */ + public CompletableFuture tableExists( + String id, TableExistsRequest tableExistsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + tableExistsRequestBuilder(id, tableExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("tableExists", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Check if a table exists Check if table `id` exists. This operation should behave + * exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace + * implementation, a table exists if either: - The table has Lance data versions (regular table + * created with CreateTable) - A `.lance-reserved` file exists in the table directory + * (declared table created with DeclareTable) + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param tableExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> tableExistsWithHttpInfo( + String id, TableExistsRequest tableExistsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + tableExistsRequestBuilder(id, tableExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("tableExists", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null)); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder tableExistsRequestBuilder( + String id, TableExistsRequest tableExistsRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling tableExists"); + } + // verify the required parameter 'tableExistsRequest' is set + if (tableExistsRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'tableExistsRequest' when calling tableExists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/exists".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(tableExistsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update table schema metadata Replace the schema metadata for table `id` with the + * provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of + * string to string) as both request and response body instead of the wrapped + * `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param requestBody (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Map<String, String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableSchemaMetadata( + String id, Map requestBody, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableSchemaMetadataRequestBuilder(id, requestBody, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableSchemaMetadata", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference>() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update table schema metadata Replace the schema metadata for table `id` with the + * provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of + * string to string) as both request and response body instead of the wrapped + * `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param requestBody (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Map<String, String>>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture>> updateTableSchemaMetadataWithHttpInfo( + String id, Map requestBody, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableSchemaMetadataRequestBuilder(id, requestBody, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableSchemaMetadata", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableSchemaMetadataRequestBuilder( + String id, Map requestBody, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateTableSchemaMetadata"); + } + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requestBody' when calling updateTableSchemaMetadata"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/schema_metadata/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a tag to point to a different version Update an existing tag for table `id` to + * point to a different version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<UpdateTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture updateTableTag( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableTagRequestBuilder(id, updateTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update a tag to point to a different version Update an existing tag for table `id` to + * point to a different version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<UpdateTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableTagWithHttpInfo( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableTagRequestBuilder(id, updateTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableTagRequestBuilder( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateTableTag"); + } + // verify the required parameter 'updateTableTagRequest' is set + if (updateTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'updateTableTagRequest' when calling updateTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/NamespaceApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/NamespaceApi.java new file mode 100644 index 000000000..409332c97 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/NamespaceApi.java @@ -0,0 +1,974 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.CreateNamespaceRequest; +import org.lance.namespace.model.CreateNamespaceResponse; +import org.lance.namespace.model.DescribeNamespaceRequest; +import org.lance.namespace.model.DescribeNamespaceResponse; +import org.lance.namespace.model.DropNamespaceRequest; +import org.lance.namespace.model.DropNamespaceResponse; +import org.lance.namespace.model.ListNamespacesResponse; +import org.lance.namespace.model.ListTablesResponse; +import org.lance.namespace.model.NamespaceExistsRequest; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NamespaceApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public NamespaceApi() { + this(Configuration.getDefaultApiClient()); + } + + public NamespaceApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create a new namespace Create new namespace `id`. During the creation process, the + * implementation may modify user-provided `properties`, such as adding additional + * properties like `created_at` to user-provided properties, omitting any specific + * property, or performing actions based on any property value. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateNamespaceResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createNamespace( + String id, CreateNamespaceRequest createNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createNamespaceRequestBuilder(id, createNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new namespace Create new namespace `id`. During the creation process, the + * implementation may modify user-provided `properties`, such as adding additional + * properties like `created_at` to user-provided properties, omitting any specific + * property, or performing actions based on any property value. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateNamespaceResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createNamespaceWithHttpInfo( + String id, CreateNamespaceRequest createNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createNamespaceRequestBuilder(id, createNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createNamespaceRequestBuilder( + String id, CreateNamespaceRequest createNamespaceRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createNamespace"); + } + // verify the required parameter 'createNamespaceRequest' is set + if (createNamespaceRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createNamespaceRequest' when calling createNamespace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createNamespaceRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe a namespace Describe the detailed information for namespace `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeNamespaceResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeNamespace( + String id, DescribeNamespaceRequest describeNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeNamespaceRequestBuilder(id, describeNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe a namespace Describe the detailed information for namespace `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeNamespaceResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> describeNamespaceWithHttpInfo( + String id, DescribeNamespaceRequest describeNamespaceRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeNamespaceRequestBuilder(id, describeNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeNamespaceRequestBuilder( + String id, DescribeNamespaceRequest describeNamespaceRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeNamespace"); + } + // verify the required parameter 'describeNamespaceRequest' is set + if (describeNamespaceRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeNamespaceRequest' when calling describeNamespace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(describeNamespaceRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a namespace Drop namespace `id` from its parent namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param dropNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropNamespaceResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropNamespace( + String id, DropNamespaceRequest dropNamespaceRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropNamespaceRequestBuilder(id, dropNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a namespace Drop namespace `id` from its parent namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param dropNamespaceRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropNamespaceResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropNamespaceWithHttpInfo( + String id, DropNamespaceRequest dropNamespaceRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropNamespaceRequestBuilder(id, dropNamespaceRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropNamespace", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropNamespaceRequestBuilder( + String id, DropNamespaceRequest dropNamespaceRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling dropNamespace"); + } + // verify the required parameter 'dropNamespaceRequest' is set + if (dropNamespaceRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'dropNamespaceRequest' when calling dropNamespace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/drop".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dropNamespaceRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List namespaces List all child namespace names of the parent namespace `id`. REST + * NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It + * passes in the `ListNamespacesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListNamespacesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listNamespaces( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listNamespacesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listNamespaces", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List namespaces List all child namespace names of the parent namespace `id`. REST + * NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It + * passes in the `ListNamespacesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListNamespacesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listNamespacesWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listNamespacesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listNamespaces", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listNamespacesRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listNamespaces"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List tables in a namespace List all child table names of the parent namespace `id`. + * REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. + * It passes in the `ListTablesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTablesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTables( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTablesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List tables in a namespace List all child table names of the parent namespace `id`. + * REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. + * It passes in the `ListTablesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTablesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTablesWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTablesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTablesRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling listTables"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/table/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Check if a namespace exists Check if namespace `id` exists. This operation must + * behave exactly like the DescribeNamespace API, except it does not contain a response body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param namespaceExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Void> + * @throws ApiException if fails to make API call + */ + public CompletableFuture namespaceExists( + String id, NamespaceExistsRequest namespaceExistsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + namespaceExistsRequestBuilder(id, namespaceExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("namespaceExists", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Check if a namespace exists Check if namespace `id` exists. This operation must + * behave exactly like the DescribeNamespace API, except it does not contain a response body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param namespaceExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> namespaceExistsWithHttpInfo( + String id, NamespaceExistsRequest namespaceExistsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + namespaceExistsRequestBuilder(id, namespaceExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("namespaceExists", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null)); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder namespaceExistsRequestBuilder( + String id, NamespaceExistsRequest namespaceExistsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling namespaceExists"); + } + // verify the required parameter 'namespaceExistsRequest' is set + if (namespaceExistsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'namespaceExistsRequest' when calling namespaceExists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/exists".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(namespaceExistsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java new file mode 100644 index 000000000..9cac30b2d --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java @@ -0,0 +1,6423 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.AlterTableAddColumnsRequest; +import org.lance.namespace.model.AlterTableAddColumnsResponse; +import org.lance.namespace.model.AlterTableAlterColumnsRequest; +import org.lance.namespace.model.AlterTableAlterColumnsResponse; +import org.lance.namespace.model.AlterTableDropColumnsRequest; +import org.lance.namespace.model.AlterTableDropColumnsResponse; +import org.lance.namespace.model.AnalyzeTableQueryPlanRequest; +import org.lance.namespace.model.BatchCreateTableVersionsRequest; +import org.lance.namespace.model.BatchCreateTableVersionsResponse; +import org.lance.namespace.model.BatchDeleteTableVersionsRequest; +import org.lance.namespace.model.BatchDeleteTableVersionsResponse; +import org.lance.namespace.model.CountTableRowsRequest; +import org.lance.namespace.model.CreateEmptyTableRequest; +import org.lance.namespace.model.CreateEmptyTableResponse; +import org.lance.namespace.model.CreateTableIndexRequest; +import org.lance.namespace.model.CreateTableIndexResponse; +import org.lance.namespace.model.CreateTableResponse; +import org.lance.namespace.model.CreateTableScalarIndexResponse; +import org.lance.namespace.model.CreateTableTagRequest; +import org.lance.namespace.model.CreateTableTagResponse; +import org.lance.namespace.model.CreateTableVersionRequest; +import org.lance.namespace.model.CreateTableVersionResponse; +import org.lance.namespace.model.DeclareTableRequest; +import org.lance.namespace.model.DeclareTableResponse; +import org.lance.namespace.model.DeleteFromTableRequest; +import org.lance.namespace.model.DeleteFromTableResponse; +import org.lance.namespace.model.DeleteTableTagRequest; +import org.lance.namespace.model.DeleteTableTagResponse; +import org.lance.namespace.model.DeregisterTableRequest; +import org.lance.namespace.model.DeregisterTableResponse; +import org.lance.namespace.model.DescribeTableIndexStatsRequest; +import org.lance.namespace.model.DescribeTableIndexStatsResponse; +import org.lance.namespace.model.DescribeTableRequest; +import org.lance.namespace.model.DescribeTableResponse; +import org.lance.namespace.model.DescribeTableVersionRequest; +import org.lance.namespace.model.DescribeTableVersionResponse; +import org.lance.namespace.model.DropTableIndexResponse; +import org.lance.namespace.model.DropTableResponse; +import org.lance.namespace.model.ExplainTableQueryPlanRequest; +import org.lance.namespace.model.GetTableStatsRequest; +import org.lance.namespace.model.GetTableStatsResponse; +import org.lance.namespace.model.GetTableTagVersionRequest; +import org.lance.namespace.model.GetTableTagVersionResponse; +import org.lance.namespace.model.InsertIntoTableResponse; +import org.lance.namespace.model.ListTableIndicesRequest; +import org.lance.namespace.model.ListTableIndicesResponse; +import org.lance.namespace.model.ListTableTagsResponse; +import org.lance.namespace.model.ListTableVersionsResponse; +import org.lance.namespace.model.ListTablesResponse; +import org.lance.namespace.model.MergeInsertIntoTableResponse; +import org.lance.namespace.model.QueryTableRequest; +import org.lance.namespace.model.RegisterTableRequest; +import org.lance.namespace.model.RegisterTableResponse; +import org.lance.namespace.model.RenameTableRequest; +import org.lance.namespace.model.RenameTableResponse; +import org.lance.namespace.model.RestoreTableRequest; +import org.lance.namespace.model.RestoreTableResponse; +import org.lance.namespace.model.TableExistsRequest; +import org.lance.namespace.model.UpdateTableRequest; +import org.lance.namespace.model.UpdateTableResponse; +import org.lance.namespace.model.UpdateTableTagRequest; +import org.lance.namespace.model.UpdateTableTagResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TableApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TableApi() { + this(Configuration.getDefaultApiClient()); + } + + public TableApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Add new columns to table schema Add new columns to table `id` using SQL expressions + * or default values. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAddColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTableAddColumnsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTableAddColumns( + String id, AlterTableAddColumnsRequest alterTableAddColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAddColumnsRequestBuilder(id, alterTableAddColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAddColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Add new columns to table schema Add new columns to table `id` using SQL expressions + * or default values. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAddColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTableAddColumnsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + alterTableAddColumnsWithHttpInfo( + String id, AlterTableAddColumnsRequest alterTableAddColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAddColumnsRequestBuilder(id, alterTableAddColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAddColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTableAddColumnsRequestBuilder( + String id, AlterTableAddColumnsRequest alterTableAddColumnsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTableAddColumns"); + } + // verify the required parameter 'alterTableAddColumnsRequest' is set + if (alterTableAddColumnsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTableAddColumnsRequest' when calling alterTableAddColumns"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/add_columns".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(alterTableAddColumnsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Modify existing columns Modify existing columns in table `id`, such as renaming or + * changing data types. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAlterColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTableAlterColumnsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTableAlterColumns( + String id, AlterTableAlterColumnsRequest alterTableAlterColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAlterColumnsRequestBuilder(id, alterTableAlterColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAlterColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Modify existing columns Modify existing columns in table `id`, such as renaming or + * changing data types. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableAlterColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTableAlterColumnsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + alterTableAlterColumnsWithHttpInfo( + String id, AlterTableAlterColumnsRequest alterTableAlterColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableAlterColumnsRequestBuilder(id, alterTableAlterColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableAlterColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTableAlterColumnsRequestBuilder( + String id, AlterTableAlterColumnsRequest alterTableAlterColumnsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTableAlterColumns"); + } + // verify the required parameter 'alterTableAlterColumnsRequest' is set + if (alterTableAlterColumnsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTableAlterColumnsRequest' when calling alterTableAlterColumns"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/alter_columns".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(alterTableAlterColumnsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove columns from table Remove specified columns from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableDropColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTableDropColumnsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTableDropColumns( + String id, AlterTableDropColumnsRequest alterTableDropColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableDropColumnsRequestBuilder(id, alterTableDropColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableDropColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Remove columns from table Remove specified columns from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTableDropColumnsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTableDropColumnsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + alterTableDropColumnsWithHttpInfo( + String id, AlterTableDropColumnsRequest alterTableDropColumnsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTableDropColumnsRequestBuilder(id, alterTableDropColumnsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTableDropColumns", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTableDropColumnsRequestBuilder( + String id, AlterTableDropColumnsRequest alterTableDropColumnsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTableDropColumns"); + } + // verify the required parameter 'alterTableDropColumnsRequest' is set + if (alterTableDropColumnsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTableDropColumnsRequest' when calling alterTableDropColumns"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/drop_columns".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(alterTableDropColumnsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Analyze query execution plan Analyze the query execution plan for a query against table + * `id`. Returns detailed statistics and analysis of the query execution plan. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `AnalyzeTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param analyzeTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<String> + * @throws ApiException if fails to make API call + */ + public CompletableFuture analyzeTableQueryPlan( + String id, AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + analyzeTableQueryPlanRequestBuilder(id, analyzeTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("analyzeTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Analyze query execution plan Analyze the query execution plan for a query against table + * `id`. Returns detailed statistics and analysis of the query execution plan. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `AnalyzeTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param analyzeTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> analyzeTableQueryPlanWithHttpInfo( + String id, AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + analyzeTableQueryPlanRequestBuilder(id, analyzeTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("analyzeTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder analyzeTableQueryPlanRequestBuilder( + String id, AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling analyzeTableQueryPlan"); + } + // verify the required parameter 'analyzeTableQueryPlanRequest' is set + if (analyzeTableQueryPlanRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'analyzeTableQueryPlanRequest' when calling analyzeTableQueryPlan"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/analyze_plan".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(analyzeTableQueryPlanRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Atomically create versions for multiple tables Atomically create new version entries for + * multiple tables. This operation is atomic: either all table versions are created successfully, + * or none are created. If any version creation fails (e.g., due to conflict), the entire batch + * operation fails. Each entry in the request specifies the table identifier and version details. + * This supports `put_if_not_exists` semantics for each version entry. + * + * @param batchCreateTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<BatchCreateTableVersionsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture batchCreateTableVersions( + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchCreateTableVersionsRequestBuilder(batchCreateTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchCreateTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Atomically create versions for multiple tables Atomically create new version entries for + * multiple tables. This operation is atomic: either all table versions are created successfully, + * or none are created. If any version creation fails (e.g., due to conflict), the entire batch + * operation fails. Each entry in the request specifies the table identifier and version details. + * This supports `put_if_not_exists` semantics for each version entry. + * + * @param batchCreateTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<BatchCreateTableVersionsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + batchCreateTableVersionsWithHttpInfo( + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchCreateTableVersionsRequestBuilder(batchCreateTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchCreateTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder batchCreateTableVersionsRequestBuilder( + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'batchCreateTableVersionsRequest' is set + if (batchCreateTableVersionsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'batchCreateTableVersionsRequest' when calling batchCreateTableVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/table/version/batch-create"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(batchCreateTableVersionsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete table version records Delete version metadata records for table `id`. This + * operation deletes version tracking records, NOT the actual table data. It supports deleting + * ranges of versions for efficient bulk cleanup. Special range values: - `start_version: + * 0` with `end_version: -1` means delete ALL version records + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param batchDeleteTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<BatchDeleteTableVersionsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture batchDeleteTableVersions( + String id, BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchDeleteTableVersionsRequestBuilder(id, batchDeleteTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchDeleteTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete table version records Delete version metadata records for table `id`. This + * operation deletes version tracking records, NOT the actual table data. It supports deleting + * ranges of versions for efficient bulk cleanup. Special range values: - `start_version: + * 0` with `end_version: -1` means delete ALL version records + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param batchDeleteTableVersionsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<BatchDeleteTableVersionsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + batchDeleteTableVersionsWithHttpInfo( + String id, + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + batchDeleteTableVersionsRequestBuilder(id, batchDeleteTableVersionsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("batchDeleteTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder batchDeleteTableVersionsRequestBuilder( + String id, BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling batchDeleteTableVersions"); + } + // verify the required parameter 'batchDeleteTableVersionsRequest' is set + if (batchDeleteTableVersionsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'batchDeleteTableVersionsRequest' when calling batchDeleteTableVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(batchDeleteTableVersionsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Count rows in a table Count the number of rows in table `id` REST NAMESPACE ONLY REST + * namespace returns the response as a plain integer instead of the + * `CountTableRowsResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param countTableRowsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Long> + * @throws ApiException if fails to make API call + */ + public CompletableFuture countTableRows( + String id, CountTableRowsRequest countTableRowsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + countTableRowsRequestBuilder(id, countTableRowsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("countTableRows", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Count rows in a table Count the number of rows in table `id` REST NAMESPACE ONLY REST + * namespace returns the response as a plain integer instead of the + * `CountTableRowsResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param countTableRowsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Long>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> countTableRowsWithHttpInfo( + String id, CountTableRowsRequest countTableRowsRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + countTableRowsRequestBuilder(id, countTableRowsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("countTableRows", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder countTableRowsRequestBuilder( + String id, CountTableRowsRequest countTableRowsRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling countTableRows"); + } + // verify the required parameter 'countTableRowsRequest' is set + if (countTableRowsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'countTableRowsRequest' when calling countTableRows"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/count_rows".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(countTableRowsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create an empty table Create an empty table with the given name without touching storage. This + * is a metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. **Deprecated**: Use `DeclareTable` instead. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createEmptyTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateEmptyTableResponse> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CompletableFuture createEmptyTable( + String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createEmptyTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create an empty table Create an empty table with the given name without touching storage. This + * is a metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. **Deprecated**: Use `DeclareTable` instead. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createEmptyTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateEmptyTableResponse>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CompletableFuture> createEmptyTableWithHttpInfo( + String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createEmptyTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createEmptyTableRequestBuilder( + String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createEmptyTable"); + } + // verify the required parameter 'createEmptyTableRequest' is set + if (createEmptyTableRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createEmptyTableRequest' when calling createEmptyTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create-empty".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createEmptyTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a table with the given name Create table `id` in the namespace with the given + * data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If + * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses + * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` + * information in the following way: - `id`: pass through path parameter of the same + * name - `mode`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC data (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode (optional) + * @return CompletableFuture<CreateTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTable( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a table with the given name Create table `id` in the namespace with the given + * data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If + * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses + * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` + * information in the following way: - `id`: pass through path parameter of the same + * name - `mode`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC data (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode (optional) + * @return CompletableFuture<ApiResponse<CreateTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableWithHttpInfo( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableRequestBuilder( + String id, byte[] body, String delimiter, String mode) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling createTable"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "mode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mode", mode)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/vnd.apache.arrow.stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create an index on a table Create an index on a table column for faster search operations. + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, + * BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the + * `ListTableIndices` and `DescribeTableIndexStats` operations to monitor + * index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableIndex( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create an index on a table Create an index on a table column for faster search operations. + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, + * BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the + * `ListTableIndices` and `DescribeTableIndexStats` operations to monitor + * index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableIndexWithHttpInfo( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableIndexRequestBuilder( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableIndex"); + } + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableIndexRequest' when calling createTableIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create_index".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableIndexRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a scalar index on a table Create a scalar index on a table column for faster filtering + * operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias + * for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. + * Use the `ListTableIndices` and `DescribeTableIndexStats` operations to + * monitor index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Scalar index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableScalarIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableScalarIndex( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableScalarIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableScalarIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a scalar index on a table Create a scalar index on a table column for faster filtering + * operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias + * for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. + * Use the `ListTableIndices` and `DescribeTableIndexStats` operations to + * monitor index creation progress. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableIndexRequest Scalar index creation request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableScalarIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + createTableScalarIndexWithHttpInfo( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableScalarIndexRequestBuilder(id, createTableIndexRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableScalarIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableScalarIndexRequestBuilder( + String id, CreateTableIndexRequest createTableIndexRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableScalarIndex"); + } + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableIndexRequest' when calling createTableScalarIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/create_scalar_index".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableIndexRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new tag Create a new tag for table `id` that points to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableTag( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableTagRequestBuilder(id, createTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new tag Create a new tag for table `id` that points to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableTagWithHttpInfo( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableTagRequestBuilder(id, createTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableTagRequestBuilder( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableTag"); + } + // verify the required parameter 'createTableTagRequest' is set + if (createTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableTagRequest' when calling createTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a new table version Create a new version entry for table `id`. This operation + * supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if + * the version already exists. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableVersion( + String id, CreateTableVersionRequest createTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableVersionRequestBuilder(id, createTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new table version Create a new version entry for table `id`. This operation + * supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if + * the version already exists. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableVersionWithHttpInfo( + String id, CreateTableVersionRequest createTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableVersionRequestBuilder(id, createTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableVersionRequestBuilder( + String id, CreateTableVersionRequest createTableVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableVersion"); + } + // verify the required parameter 'createTableVersionRequest' is set + if (createTableVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableVersionRequest' when calling createTableVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Declare a table Declare a table with the given name without touching storage. This is a + * metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param declareTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeclareTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture declareTable( + String id, DeclareTableRequest declareTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + declareTableRequestBuilder(id, declareTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("declareTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Declare a table Declare a table with the given name without touching storage. This is a + * metadata-only operation that records the table existence and sets up aspects like access + * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file + * in the table directory to mark the table's existence without creating actual Lance data + * files. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param declareTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeclareTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> declareTableWithHttpInfo( + String id, DeclareTableRequest declareTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + declareTableRequestBuilder(id, declareTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("declareTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder declareTableRequestBuilder( + String id, DeclareTableRequest declareTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling declareTable"); + } + // verify the required parameter 'declareTableRequest' is set + if (declareTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'declareTableRequest' when calling declareTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/declare".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(declareTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete rows from a table Delete rows from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteFromTableRequest Delete request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeleteFromTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteFromTable( + String id, DeleteFromTableRequest deleteFromTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteFromTableRequestBuilder(id, deleteFromTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteFromTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete rows from a table Delete rows from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteFromTableRequest Delete request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeleteFromTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteFromTableWithHttpInfo( + String id, DeleteFromTableRequest deleteFromTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteFromTableRequestBuilder(id, deleteFromTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteFromTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteFromTableRequestBuilder( + String id, DeleteFromTableRequest deleteFromTableRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteFromTable"); + } + // verify the required parameter 'deleteFromTableRequest' is set + if (deleteFromTableRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deleteFromTableRequest' when calling deleteFromTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteFromTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete a tag Delete an existing tag from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeleteTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteTableTag( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteTableTagRequestBuilder(id, deleteTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete a tag Delete an existing tag from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeleteTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteTableTagWithHttpInfo( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteTableTagRequestBuilder(id, deleteTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteTableTagRequestBuilder( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteTableTag"); + } + // verify the required parameter 'deleteTableTagRequest' is set + if (deleteTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deleteTableTagRequest' when calling deleteTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deregister a table Deregister table `id` from its namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deregisterTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeregisterTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deregisterTable( + String id, DeregisterTableRequest deregisterTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deregisterTableRequestBuilder(id, deregisterTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deregisterTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Deregister a table Deregister table `id` from its namespace. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deregisterTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeregisterTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deregisterTableWithHttpInfo( + String id, DeregisterTableRequest deregisterTableRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deregisterTableRequestBuilder(id, deregisterTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deregisterTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deregisterTableRequestBuilder( + String id, DeregisterTableRequest deregisterTableRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deregisterTable"); + } + // verify the required parameter 'deregisterTableRequest' is set + if (deregisterTableRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deregisterTableRequest' when calling deregisterTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/deregister".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deregisterTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe information of a table Describe the detailed information for table `id`. + * REST NAMESPACE ONLY REST namespace passes `with_table_uri` and + * `load_detailed_metadata` as query parameters instead of in the request body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param withTableUri Whether to include the table URI in the response (optional, default to + * false) + * @param loadDetailedMetadata Whether to load detailed metadata that requires opening the + * dataset. When false (default), only `location` is required in the response. When + * true, the response includes additional metadata such as `version`, + * `schema`, and `stats`. (optional, default to false) + * @return CompletableFuture<DescribeTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTable( + String id, + DescribeTableRequest describeTableRequest, + String delimiter, + Boolean withTableUri, + Boolean loadDetailedMetadata) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableRequestBuilder( + id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe information of a table Describe the detailed information for table `id`. + * REST NAMESPACE ONLY REST namespace passes `with_table_uri` and + * `load_detailed_metadata` as query parameters instead of in the request body. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param withTableUri Whether to include the table URI in the response (optional, default to + * false) + * @param loadDetailedMetadata Whether to load detailed metadata that requires opening the + * dataset. When false (default), only `location` is required in the response. When + * true, the response includes additional metadata such as `version`, + * `schema`, and `stats`. (optional, default to false) + * @return CompletableFuture<ApiResponse<DescribeTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> describeTableWithHttpInfo( + String id, + DescribeTableRequest describeTableRequest, + String delimiter, + Boolean withTableUri, + Boolean loadDetailedMetadata) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableRequestBuilder( + id, describeTableRequest, delimiter, withTableUri, loadDetailedMetadata); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableRequestBuilder( + String id, + DescribeTableRequest describeTableRequest, + String delimiter, + Boolean withTableUri, + Boolean loadDetailedMetadata) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling describeTable"); + } + // verify the required parameter 'describeTableRequest' is set + if (describeTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'describeTableRequest' when calling describeTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "with_table_uri"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("with_table_uri", withTableUri)); + localVarQueryParameterBaseName = "load_detailed_metadata"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("load_detailed_metadata", loadDetailedMetadata)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(describeTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get table index statistics Get statistics for a specific index on a table. Returns information + * about the index type, distance type (for vector indices), and row counts. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to get stats for (required) + * @param describeTableIndexStatsRequest Index stats request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTableIndexStatsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTableIndexStats( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableIndexStatsRequestBuilder( + id, indexName, describeTableIndexStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableIndexStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get table index statistics Get statistics for a specific index on a table. Returns information + * about the index type, distance type (for vector indices), and row counts. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to get stats for (required) + * @param describeTableIndexStatsRequest Index stats request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTableIndexStatsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTableIndexStatsWithHttpInfo( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableIndexStatsRequestBuilder( + id, indexName, describeTableIndexStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableIndexStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableIndexStatsRequestBuilder( + String id, + String indexName, + DescribeTableIndexStatsRequest describeTableIndexStatsRequest, + String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTableIndexStats"); + } + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + 400, "Missing the required parameter 'indexName' when calling describeTableIndexStats"); + } + // verify the required parameter 'describeTableIndexStatsRequest' is set + if (describeTableIndexStatsRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTableIndexStatsRequest' when calling describeTableIndexStats"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/{index_name}/stats" + .replace("{id}", ApiClient.urlEncode(id.toString())) + .replace("{index_name}", ApiClient.urlEncode(indexName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(describeTableIndexStatsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe a specific table version Describe the detailed information for a specific version of + * table `id`. Returns the manifest path and metadata for the specified version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTableVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTableVersion( + String id, DescribeTableVersionRequest describeTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableVersionRequestBuilder(id, describeTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe a specific table version Describe the detailed information for a specific version of + * table `id`. Returns the manifest path and metadata for the specified version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTableVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTableVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTableVersionWithHttpInfo( + String id, DescribeTableVersionRequest describeTableVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTableVersionRequestBuilder(id, describeTableVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTableVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTableVersionRequestBuilder( + String id, DescribeTableVersionRequest describeTableVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTableVersion"); + } + // verify the required parameter 'describeTableVersionRequest' is set + if (describeTableVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTableVersionRequest' when calling describeTableVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(describeTableVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a table Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace + * does not use a request body for this operation. The `DropTableRequest` information is + * passed in the following way: - `id`: pass through path parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropTable(String id, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = dropTableRequestBuilder(id, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a table Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace + * does not use a request body for this operation. The `DropTableRequest` information is + * passed in the following way: - `id`: pass through path parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropTableWithHttpInfo( + String id, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = dropTableRequestBuilder(id, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropTableRequestBuilder(String id, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling dropTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/table/{id}/drop".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Drop a specific index Drop the specified index from table `id`. REST NAMESPACE ONLY + * REST namespace does not use a request body for this operation. The + * `DropTableIndexRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `index_name`: pass through path + * parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to drop (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DropTableIndexResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture dropTableIndex( + String id, String indexName, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropTableIndexRequestBuilder(id, indexName, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Drop a specific index Drop the specified index from table `id`. REST NAMESPACE ONLY + * REST namespace does not use a request body for this operation. The + * `DropTableIndexRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `index_name`: pass through path + * parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param indexName Name of the index to drop (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DropTableIndexResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> dropTableIndexWithHttpInfo( + String id, String indexName, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + dropTableIndexRequestBuilder(id, indexName, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("dropTableIndex", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder dropTableIndexRequestBuilder( + String id, String indexName, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling dropTableIndex"); + } + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException( + 400, "Missing the required parameter 'indexName' when calling dropTableIndex"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/{index_name}/drop" + .replace("{id}", ApiClient.urlEncode(id.toString())) + .replace("{index_name}", ApiClient.urlEncode(indexName.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get query execution plan explanation Get the query execution plan for a query against table + * `id`. Returns a human-readable explanation of how the query will be executed. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `ExplainTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param explainTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<String> + * @throws ApiException if fails to make API call + */ + public CompletableFuture explainTableQueryPlan( + String id, ExplainTableQueryPlanRequest explainTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + explainTableQueryPlanRequestBuilder(id, explainTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("explainTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get query execution plan explanation Get the query execution plan for a query against table + * `id`. Returns a human-readable explanation of how the query will be executed. REST + * NAMESPACE ONLY REST namespace returns the response as a plain string instead of the + * `ExplainTableQueryPlanResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param explainTableQueryPlanRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> explainTableQueryPlanWithHttpInfo( + String id, ExplainTableQueryPlanRequest explainTableQueryPlanRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + explainTableQueryPlanRequestBuilder(id, explainTableQueryPlanRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("explainTableQueryPlan", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder explainTableQueryPlanRequestBuilder( + String id, ExplainTableQueryPlanRequest explainTableQueryPlanRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling explainTableQueryPlan"); + } + // verify the required parameter 'explainTableQueryPlanRequest' is set + if (explainTableQueryPlanRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'explainTableQueryPlanRequest' when calling explainTableQueryPlan"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/explain_plan".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = + memberVarObjectMapper.writeValueAsBytes(explainTableQueryPlanRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get table statistics Get statistics for table `id`, including row counts, data sizes, + * and column statistics. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableStatsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<GetTableStatsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getTableStats( + String id, GetTableStatsRequest getTableStatsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableStatsRequestBuilder(id, getTableStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get table statistics Get statistics for table `id`, including row counts, data sizes, + * and column statistics. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableStatsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<GetTableStatsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getTableStatsWithHttpInfo( + String id, GetTableStatsRequest getTableStatsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableStatsRequestBuilder(id, getTableStatsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableStats", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getTableStatsRequestBuilder( + String id, GetTableStatsRequest getTableStatsRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling getTableStats"); + } + // verify the required parameter 'getTableStatsRequest' is set + if (getTableStatsRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'getTableStatsRequest' when calling getTableStats"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/stats".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getTableStatsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get version for a specific tag Get the version number that a specific tag points to for table + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableTagVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<GetTableTagVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getTableTagVersion( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableTagVersionRequestBuilder(id, getTableTagVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableTagVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get version for a specific tag Get the version number that a specific tag points to for table + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableTagVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<GetTableTagVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getTableTagVersionWithHttpInfo( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableTagVersionRequestBuilder(id, getTableTagVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableTagVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getTableTagVersionRequestBuilder( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getTableTagVersion"); + } + // verify the required parameter 'getTableTagVersionRequest' is set + if (getTableTagVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'getTableTagVersionRequest' when calling getTableTagVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/version".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getTableTagVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Insert records into a table Insert new records into table `id`. REST NAMESPACE ONLY + * REST namespace uses Arrow IPC stream as the request body. It passes in the + * `InsertIntoTableRequest` information in the following way: - `id`: pass + * through path parameter of the same name - `mode`: pass through query parameter of the + * same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC stream containing the records to insert (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode How the insert should behave. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - Append (default): insert data to the existing table - + * Overwrite: remove all data in the table and then insert data to it (optional, default to + * append) + * @return CompletableFuture<InsertIntoTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture insertIntoTable( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + insertIntoTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("insertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Insert records into a table Insert new records into table `id`. REST NAMESPACE ONLY + * REST namespace uses Arrow IPC stream as the request body. It passes in the + * `InsertIntoTableRequest` information in the following way: - `id`: pass + * through path parameter of the same name - `mode`: pass through query parameter of the + * same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param body Arrow IPC stream containing the records to insert (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param mode How the insert should behave. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - Append (default): insert data to the existing table - + * Overwrite: remove all data in the table and then insert data to it (optional, default to + * append) + * @return CompletableFuture<ApiResponse<InsertIntoTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> insertIntoTableWithHttpInfo( + String id, byte[] body, String delimiter, String mode) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + insertIntoTableRequestBuilder(id, body, delimiter, mode); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("insertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder insertIntoTableRequestBuilder( + String id, byte[] body, String delimiter, String mode) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling insertIntoTable"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling insertIntoTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/insert".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "mode"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("mode", mode)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/vnd.apache.arrow.stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all tables List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses + * GET to perform this operation without a request body. It passes in the + * `ListAllTablesRequest` information in the following way: - `page_token`: + * pass through query parameter of the same name - `limit`: pass through query parameter + * of the same name - `delimiter`: pass through query parameter of the same name + * + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTablesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listAllTables( + String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listAllTablesRequestBuilder(delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listAllTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List all tables List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses + * GET to perform this operation without a request body. It passes in the + * `ListAllTablesRequest` information in the following way: - `page_token`: + * pass through query parameter of the same name - `limit`: pass through query parameter + * of the same name - `delimiter`: pass through query parameter of the same name + * + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTablesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listAllTablesWithHttpInfo( + String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listAllTablesRequestBuilder(delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listAllTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listAllTablesRequestBuilder( + String delimiter, String pageToken, Integer limit) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v1/table"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List indexes on a table List all indices created on a table. Returns information about each + * index including name, columns, status, and UUID. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param listTableIndicesRequest Index list request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ListTableIndicesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableIndices( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableIndicesRequestBuilder(id, listTableIndicesRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableIndices", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List indexes on a table List all indices created on a table. Returns information about each + * index including name, columns, status, and UUID. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param listTableIndicesRequest Index list request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<ListTableIndicesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableIndicesWithHttpInfo( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableIndicesRequestBuilder(id, listTableIndicesRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableIndices", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableIndicesRequestBuilder( + String id, ListTableIndicesRequest listTableIndicesRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listTableIndices"); + } + // verify the required parameter 'listTableIndicesRequest' is set + if (listTableIndicesRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'listTableIndicesRequest' when calling listTableIndices"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/index/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(listTableIndicesRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all tags for a table List all tags that have been created for table `id`. + * Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableTagsRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `page_token`: pass through query + * parameter of the same name - `limit`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTableTagsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableTags( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableTagsRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableTags", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List all tags for a table List all tags that have been created for table `id`. + * Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableTagsRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `page_token`: pass through query + * parameter of the same name - `limit`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTableTagsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableTagsWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableTagsRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableTags", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableTagsRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling listTableTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all versions of a table List all versions (commits) of table `id` with their + * metadata. Use `descending=true` to guarantee versions are returned in descending + * order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableVersionsRequest` information is passed in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name - `descending`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @param descending When true, versions are guaranteed to be returned in descending order (latest + * to oldest). When false or not specified, the ordering is implementation-defined. (optional) + * @return CompletableFuture<ListTableVersionsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableVersions( + String id, String delimiter, String pageToken, Integer limit, Boolean descending) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableVersionsRequestBuilder(id, delimiter, pageToken, limit, descending); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List all versions of a table List all versions (commits) of table `id` with their + * metadata. Use `descending=true` to guarantee versions are returned in descending + * order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableVersionsRequest` information is passed in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name - `descending`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @param descending When true, versions are guaranteed to be returned in descending order (latest + * to oldest). When false or not specified, the ordering is implementation-defined. (optional) + * @return CompletableFuture<ApiResponse<ListTableVersionsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableVersionsWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit, Boolean descending) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableVersionsRequestBuilder(id, delimiter, pageToken, limit, descending); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableVersions", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableVersionsRequestBuilder( + String id, String delimiter, String pageToken, Integer limit, Boolean descending) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling listTableVersions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/version/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + localVarQueryParameterBaseName = "descending"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("descending", descending)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List tables in a namespace List all child table names of the parent namespace `id`. + * REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. + * It passes in the `ListTablesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTablesResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTables( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTablesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List tables in a namespace List all child table names of the parent namespace `id`. + * REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. + * It passes in the `ListTablesRequest` information in the following way: - + * `id`: pass through path parameter of the same name - `page_token`: pass + * through query parameter of the same name - `limit`: pass through query parameter of + * the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTablesResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTablesWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTablesRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTables", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTablesRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling listTables"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/namespace/{id}/table/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Merge insert (upsert) records into a table Performs a merge insert (upsert) operation on table + * `id`. This operation updates existing rows based on a matching column and inserts new + * rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE + * ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the + * `MergeInsertIntoTableRequest` information in the following way: - `id`: + * pass through path parameter of the same name - `on`: pass through query parameter of + * the same name - `when_matched_update_all`: pass through query parameter of the same + * name - `when_matched_update_all_filt`: pass through query parameter of the same name + * - `when_not_matched_insert_all`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete_filt`: pass through query parameter of the same + * name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param on Column name to use for matching rows (required) (required) + * @param body Arrow IPC stream containing the records to merge (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param whenMatchedUpdateAll Update all columns when rows match (optional, default to false) + * @param whenMatchedUpdateAllFilt The row is updated (similar to UpdateAll) only for rows where + * the SQL expression evaluates to true (optional) + * @param whenNotMatchedInsertAll Insert all columns when rows don't match (optional, default + * to false) + * @param whenNotMatchedBySourceDelete Delete all rows from target table that don't match a + * row in the source table (optional, default to false) + * @param whenNotMatchedBySourceDeleteFilt Delete rows from the target table if there is no match + * AND the SQL expression evaluates to true (optional) + * @param timeout Timeout for the operation (e.g., \"30s\", \"5m\") (optional) + * @param useIndex Whether to use index for matching rows (optional, default to false) + * @return CompletableFuture<MergeInsertIntoTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture mergeInsertIntoTable( + String id, + String on, + byte[] body, + String delimiter, + Boolean whenMatchedUpdateAll, + String whenMatchedUpdateAllFilt, + Boolean whenNotMatchedInsertAll, + Boolean whenNotMatchedBySourceDelete, + String whenNotMatchedBySourceDeleteFilt, + String timeout, + Boolean useIndex) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + mergeInsertIntoTableRequestBuilder( + id, + on, + body, + delimiter, + whenMatchedUpdateAll, + whenMatchedUpdateAllFilt, + whenNotMatchedInsertAll, + whenNotMatchedBySourceDelete, + whenNotMatchedBySourceDeleteFilt, + timeout, + useIndex); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("mergeInsertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Merge insert (upsert) records into a table Performs a merge insert (upsert) operation on table + * `id`. This operation updates existing rows based on a matching column and inserts new + * rows that don't match. It returns the number of rows inserted and updated. REST NAMESPACE + * ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the + * `MergeInsertIntoTableRequest` information in the following way: - `id`: + * pass through path parameter of the same name - `on`: pass through query parameter of + * the same name - `when_matched_update_all`: pass through query parameter of the same + * name - `when_matched_update_all_filt`: pass through query parameter of the same name + * - `when_not_matched_insert_all`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete`: pass through query parameter of the same name - + * `when_not_matched_by_source_delete_filt`: pass through query parameter of the same + * name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param on Column name to use for matching rows (required) (required) + * @param body Arrow IPC stream containing the records to merge (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param whenMatchedUpdateAll Update all columns when rows match (optional, default to false) + * @param whenMatchedUpdateAllFilt The row is updated (similar to UpdateAll) only for rows where + * the SQL expression evaluates to true (optional) + * @param whenNotMatchedInsertAll Insert all columns when rows don't match (optional, default + * to false) + * @param whenNotMatchedBySourceDelete Delete all rows from target table that don't match a + * row in the source table (optional, default to false) + * @param whenNotMatchedBySourceDeleteFilt Delete rows from the target table if there is no match + * AND the SQL expression evaluates to true (optional) + * @param timeout Timeout for the operation (e.g., \"30s\", \"5m\") (optional) + * @param useIndex Whether to use index for matching rows (optional, default to false) + * @return CompletableFuture<ApiResponse<MergeInsertIntoTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + mergeInsertIntoTableWithHttpInfo( + String id, + String on, + byte[] body, + String delimiter, + Boolean whenMatchedUpdateAll, + String whenMatchedUpdateAllFilt, + Boolean whenNotMatchedInsertAll, + Boolean whenNotMatchedBySourceDelete, + String whenNotMatchedBySourceDeleteFilt, + String timeout, + Boolean useIndex) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + mergeInsertIntoTableRequestBuilder( + id, + on, + body, + delimiter, + whenMatchedUpdateAll, + whenMatchedUpdateAllFilt, + whenNotMatchedInsertAll, + whenNotMatchedBySourceDelete, + whenNotMatchedBySourceDeleteFilt, + timeout, + useIndex); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("mergeInsertIntoTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder mergeInsertIntoTableRequestBuilder( + String id, + String on, + byte[] body, + String delimiter, + Boolean whenMatchedUpdateAll, + String whenMatchedUpdateAllFilt, + Boolean whenNotMatchedInsertAll, + Boolean whenNotMatchedBySourceDelete, + String whenNotMatchedBySourceDeleteFilt, + String timeout, + Boolean useIndex) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling mergeInsertIntoTable"); + } + // verify the required parameter 'on' is set + if (on == null) { + throw new ApiException( + 400, "Missing the required parameter 'on' when calling mergeInsertIntoTable"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling mergeInsertIntoTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/merge_insert".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "on"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("on", on)); + localVarQueryParameterBaseName = "when_matched_update_all"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("when_matched_update_all", whenMatchedUpdateAll)); + localVarQueryParameterBaseName = "when_matched_update_all_filt"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("when_matched_update_all_filt", whenMatchedUpdateAllFilt)); + localVarQueryParameterBaseName = "when_not_matched_insert_all"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("when_not_matched_insert_all", whenNotMatchedInsertAll)); + localVarQueryParameterBaseName = "when_not_matched_by_source_delete"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs( + "when_not_matched_by_source_delete", whenNotMatchedBySourceDelete)); + localVarQueryParameterBaseName = "when_not_matched_by_source_delete_filt"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs( + "when_not_matched_by_source_delete_filt", whenNotMatchedBySourceDeleteFilt)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + localVarQueryParameterBaseName = "use_index"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("use_index", useIndex)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/vnd.apache.arrow.stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Query a table Query table `id` with vector search, full text search and optional SQL + * filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST + * namespace returns the response as Arrow IPC file binary data instead of the + * `QueryTableResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param queryTableRequest Query request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<byte[]> + * @throws ApiException if fails to make API call + */ + public CompletableFuture queryTable( + String id, QueryTableRequest queryTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + queryTableRequestBuilder(id, queryTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("queryTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Query a table Query table `id` with vector search, full text search and optional SQL + * filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST + * namespace returns the response as Arrow IPC file binary data instead of the + * `QueryTableResponse` JSON object. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param queryTableRequest Query request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<byte[]>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> queryTableWithHttpInfo( + String id, QueryTableRequest queryTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + queryTableRequestBuilder(id, queryTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("queryTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder queryTableRequestBuilder( + String id, QueryTableRequest queryTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling queryTable"); + } + // verify the required parameter 'queryTableRequest' is set + if (queryTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'queryTableRequest' when calling queryTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/query".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/vnd.apache.arrow.file, application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(queryTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Register a table to a namespace Register an existing table at a given storage location as + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param registerTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<RegisterTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture registerTable( + String id, RegisterTableRequest registerTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + registerTableRequestBuilder(id, registerTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("registerTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Register a table to a namespace Register an existing table at a given storage location as + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param registerTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<RegisterTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> registerTableWithHttpInfo( + String id, RegisterTableRequest registerTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + registerTableRequestBuilder(id, registerTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("registerTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder registerTableRequestBuilder( + String id, RegisterTableRequest registerTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling registerTable"); + } + // verify the required parameter 'registerTableRequest' is set + if (registerTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'registerTableRequest' when calling registerTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/register".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(registerTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Rename a table Rename table `id` to a new name. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param renameTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<RenameTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture renameTable( + String id, RenameTableRequest renameTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + renameTableRequestBuilder(id, renameTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("renameTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Rename a table Rename table `id` to a new name. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param renameTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<RenameTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> renameTableWithHttpInfo( + String id, RenameTableRequest renameTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + renameTableRequestBuilder(id, renameTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("renameTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder renameTableRequestBuilder( + String id, RenameTableRequest renameTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling renameTable"); + } + // verify the required parameter 'renameTableRequest' is set + if (renameTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'renameTableRequest' when calling renameTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/rename".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(renameTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Restore table to a specific version Restore table `id` to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param restoreTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<RestoreTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture restoreTable( + String id, RestoreTableRequest restoreTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + restoreTableRequestBuilder(id, restoreTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("restoreTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Restore table to a specific version Restore table `id` to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param restoreTableRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<RestoreTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> restoreTableWithHttpInfo( + String id, RestoreTableRequest restoreTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + restoreTableRequestBuilder(id, restoreTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("restoreTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder restoreTableRequestBuilder( + String id, RestoreTableRequest restoreTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling restoreTable"); + } + // verify the required parameter 'restoreTableRequest' is set + if (restoreTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'restoreTableRequest' when calling restoreTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/restore".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(restoreTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Check if a table exists Check if table `id` exists. This operation should behave + * exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace + * implementation, a table exists if either: - The table has Lance data versions (regular table + * created with CreateTable) - A `.lance-reserved` file exists in the table directory + * (declared table created with DeclareTable) + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param tableExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Void> + * @throws ApiException if fails to make API call + */ + public CompletableFuture tableExists( + String id, TableExistsRequest tableExistsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + tableExistsRequestBuilder(id, tableExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("tableExists", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Check if a table exists Check if table `id` exists. This operation should behave + * exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace + * implementation, a table exists if either: - The table has Lance data versions (regular table + * created with CreateTable) - A `.lance-reserved` file exists in the table directory + * (declared table created with DeclareTable) + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param tableExistsRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> tableExistsWithHttpInfo( + String id, TableExistsRequest tableExistsRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + tableExistsRequestBuilder(id, tableExistsRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("tableExists", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null)); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder tableExistsRequestBuilder( + String id, TableExistsRequest tableExistsRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling tableExists"); + } + // verify the required parameter 'tableExistsRequest' is set + if (tableExistsRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'tableExistsRequest' when calling tableExists"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/exists".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(tableExistsRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update rows in a table Update existing rows in table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableRequest Update request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<UpdateTableResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture updateTable( + String id, UpdateTableRequest updateTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableRequestBuilder(id, updateTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update rows in a table Update existing rows in table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableRequest Update request (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<UpdateTableResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableWithHttpInfo( + String id, UpdateTableRequest updateTableRequest, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableRequestBuilder(id, updateTableRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTable", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableRequestBuilder( + String id, UpdateTableRequest updateTableRequest, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling updateTable"); + } + // verify the required parameter 'updateTableRequest' is set + if (updateTableRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'updateTableRequest' when calling updateTable"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateTableRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update table schema metadata Replace the schema metadata for table `id` with the + * provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of + * string to string) as both request and response body instead of the wrapped + * `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param requestBody (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<Map<String, String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableSchemaMetadata( + String id, Map requestBody, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableSchemaMetadataRequestBuilder(id, requestBody, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableSchemaMetadata", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference>() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update table schema metadata Replace the schema metadata for table `id` with the + * provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of + * string to string) as both request and response body instead of the wrapped + * `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param requestBody (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<Map<String, String>>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture>> updateTableSchemaMetadataWithHttpInfo( + String id, Map requestBody, String delimiter) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableSchemaMetadataRequestBuilder(id, requestBody, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableSchemaMetadata", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableSchemaMetadataRequestBuilder( + String id, Map requestBody, String delimiter) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateTableSchemaMetadata"); + } + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requestBody' when calling updateTableSchemaMetadata"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/schema_metadata/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a tag to point to a different version Update an existing tag for table `id` to + * point to a different version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<UpdateTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture updateTableTag( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableTagRequestBuilder(id, updateTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update a tag to point to a different version Update an existing tag for table `id` to + * point to a different version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<UpdateTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableTagWithHttpInfo( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableTagRequestBuilder(id, updateTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableTagRequestBuilder( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateTableTag"); + } + // verify the required parameter 'updateTableTagRequest' is set + if (updateTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'updateTableTagRequest' when calling updateTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TagApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TagApi.java new file mode 100644 index 000000000..46cdddc4b --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TagApi.java @@ -0,0 +1,843 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.CreateTableTagRequest; +import org.lance.namespace.model.CreateTableTagResponse; +import org.lance.namespace.model.DeleteTableTagRequest; +import org.lance.namespace.model.DeleteTableTagResponse; +import org.lance.namespace.model.GetTableTagVersionRequest; +import org.lance.namespace.model.GetTableTagVersionResponse; +import org.lance.namespace.model.ListTableTagsResponse; +import org.lance.namespace.model.UpdateTableTagRequest; +import org.lance.namespace.model.UpdateTableTagResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TagApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TagApi() { + this(Configuration.getDefaultApiClient()); + } + + public TagApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create a new tag Create a new tag for table `id` that points to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<CreateTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createTableTag( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableTagRequestBuilder(id, createTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new tag Create a new tag for table `id` that points to a specific version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param createTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<CreateTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createTableTagWithHttpInfo( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createTableTagRequestBuilder(id, createTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createTableTagRequestBuilder( + String id, CreateTableTagRequest createTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling createTableTag"); + } + // verify the required parameter 'createTableTagRequest' is set + if (createTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'createTableTagRequest' when calling createTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/create".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete a tag Delete an existing tag from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DeleteTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteTableTag( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteTableTagRequestBuilder(id, deleteTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Delete a tag Delete an existing tag from table `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param deleteTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DeleteTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteTableTagWithHttpInfo( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + deleteTableTagRequestBuilder(id, deleteTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("deleteTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteTableTagRequestBuilder( + String id, DeleteTableTagRequest deleteTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteTableTag"); + } + // verify the required parameter 'deleteTableTagRequest' is set + if (deleteTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'deleteTableTagRequest' when calling deleteTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/delete".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get version for a specific tag Get the version number that a specific tag points to for table + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableTagVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<GetTableTagVersionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getTableTagVersion( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableTagVersionRequestBuilder(id, getTableTagVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableTagVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get version for a specific tag Get the version number that a specific tag points to for table + * `id`. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param getTableTagVersionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<GetTableTagVersionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getTableTagVersionWithHttpInfo( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getTableTagVersionRequestBuilder(id, getTableTagVersionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getTableTagVersion", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getTableTagVersionRequestBuilder( + String id, GetTableTagVersionRequest getTableTagVersionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getTableTagVersion"); + } + // verify the required parameter 'getTableTagVersionRequest' is set + if (getTableTagVersionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'getTableTagVersionRequest' when calling getTableTagVersion"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/version".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(getTableTagVersionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List all tags for a table List all tags that have been created for table `id`. + * Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableTagsRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `page_token`: pass through query + * parameter of the same name - `limit`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ListTableTagsResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listTableTags( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableTagsRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableTags", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List all tags for a table List all tags that have been created for table `id`. + * Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE + * ONLY REST namespace does not use a request body for this operation. The + * `ListTableTagsRequest` information is passed in the following way: - `id`: + * pass through path parameter of the same name - `page_token`: pass through query + * parameter of the same name - `limit`: pass through query parameter of the same name + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @param pageToken Pagination token from a previous request (optional) + * @param limit Maximum number of items to return (optional) + * @return CompletableFuture<ApiResponse<ListTableTagsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listTableTagsWithHttpInfo( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + listTableTagsRequestBuilder(id, delimiter, pageToken, limit); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("listTableTags", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listTableTagsRequestBuilder( + String id, String delimiter, String pageToken, Integer limit) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling listTableTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/list".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + localVarQueryParameterBaseName = "page_token"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page_token", pageToken)); + localVarQueryParameterBaseName = "limit"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update a tag to point to a different version Update an existing tag for table `id` to + * point to a different version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<UpdateTableTagResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture updateTableTag( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableTagRequestBuilder(id, updateTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Update a tag to point to a different version Update an existing tag for table `id` to + * point to a different version. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param updateTableTagRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<UpdateTableTagResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateTableTagWithHttpInfo( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + updateTableTagRequestBuilder(id, updateTableTagRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("updateTableTag", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateTableTagRequestBuilder( + String id, UpdateTableTagRequest updateTableTagRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateTableTag"); + } + // verify the required parameter 'updateTableTagRequest' is set + if (updateTableTagRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'updateTableTagRequest' when calling updateTableTag"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/table/{id}/tags/update".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateTableTagRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TransactionApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TransactionApi.java new file mode 100644 index 000000000..4f5d2d79e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TransactionApi.java @@ -0,0 +1,387 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.client.async.api; + +import org.lance.namespace.client.async.ApiClient; +import org.lance.namespace.client.async.ApiException; +import org.lance.namespace.client.async.ApiResponse; +import org.lance.namespace.client.async.Configuration; +import org.lance.namespace.client.async.Pair; +import org.lance.namespace.model.AlterTransactionRequest; +import org.lance.namespace.model.AlterTransactionResponse; +import org.lance.namespace.model.DescribeTransactionRequest; +import org.lance.namespace.model.DescribeTransactionResponse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TransactionApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public TransactionApi() { + this(Configuration.getDefaultApiClient()); + } + + public TransactionApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Alter information of a transaction. Alter a transaction with a list of actions such as setting + * status or properties. The server should either succeed and apply all actions, or fail and apply + * no action. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<AlterTransactionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture alterTransaction( + String id, AlterTransactionRequest alterTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTransactionRequestBuilder(id, alterTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Alter information of a transaction. Alter a transaction with a list of actions such as setting + * status or properties. The server should either succeed and apply all actions, or fail and apply + * no action. + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param alterTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<AlterTransactionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> alterTransactionWithHttpInfo( + String id, AlterTransactionRequest alterTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + alterTransactionRequestBuilder(id, alterTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("alterTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder alterTransactionRequestBuilder( + String id, AlterTransactionRequest alterTransactionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling alterTransaction"); + } + // verify the required parameter 'alterTransactionRequest' is set + if (alterTransactionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'alterTransactionRequest' when calling alterTransaction"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/transaction/{id}/alter".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(alterTransactionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Describe information about a transaction Return a detailed information for a given transaction + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<DescribeTransactionResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture describeTransaction( + String id, DescribeTransactionRequest describeTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTransactionRequestBuilder(id, describeTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, new TypeReference() {})); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Describe information about a transaction Return a detailed information for a given transaction + * + * @param id `string identifier` of an object in a namespace, following the Lance + * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. + * For example, `v1/namespace/$/list` performs a `ListNamespace` on the + * root namespace. (required) + * @param describeTransactionRequest (required) + * @param delimiter An optional delimiter of the `string identifier`, following the + * Lance Namespace spec. When not specified, the `$` delimiter must be used. + * (optional) + * @return CompletableFuture<ApiResponse<DescribeTransactionResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> + describeTransactionWithHttpInfo( + String id, DescribeTransactionRequest describeTransactionRequest, String delimiter) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + describeTransactionRequestBuilder(id, describeTransactionRequest, delimiter); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("describeTransaction", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder describeTransactionRequestBuilder( + String id, DescribeTransactionRequest describeTransactionRequest, String delimiter) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling describeTransaction"); + } + // verify the required parameter 'describeTransactionRequest' is set + if (describeTransactionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'describeTransactionRequest' when calling describeTransaction"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/v1/transaction/{id}/describe".replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "delimiter"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(describeTransactionRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AbstractOpenApiSchema.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000..f65507ba2 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AbstractOpenApiSchema.java @@ -0,0 +1,147 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AddVirtualColumnEntry.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AddVirtualColumnEntry.java new file mode 100644 index 000000000..2b653dd93 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AddVirtualColumnEntry.java @@ -0,0 +1,342 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** AddVirtualColumnEntry */ +@JsonPropertyOrder({ + AddVirtualColumnEntry.JSON_PROPERTY_INPUT_COLUMNS, + AddVirtualColumnEntry.JSON_PROPERTY_DATA_TYPE, + AddVirtualColumnEntry.JSON_PROPERTY_IMAGE, + AddVirtualColumnEntry.JSON_PROPERTY_UDF, + AddVirtualColumnEntry.JSON_PROPERTY_UDF_NAME, + AddVirtualColumnEntry.JSON_PROPERTY_UDF_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AddVirtualColumnEntry { + public static final String JSON_PROPERTY_INPUT_COLUMNS = "input_columns"; + @javax.annotation.Nonnull private List inputColumns = new ArrayList<>(); + + public static final String JSON_PROPERTY_DATA_TYPE = "data_type"; + @javax.annotation.Nonnull private Object dataType; + + public static final String JSON_PROPERTY_IMAGE = "image"; + @javax.annotation.Nonnull private String image; + + public static final String JSON_PROPERTY_UDF = "udf"; + @javax.annotation.Nonnull private String udf; + + public static final String JSON_PROPERTY_UDF_NAME = "udf_name"; + @javax.annotation.Nonnull private String udfName; + + public static final String JSON_PROPERTY_UDF_VERSION = "udf_version"; + @javax.annotation.Nonnull private String udfVersion; + + public AddVirtualColumnEntry() {} + + public AddVirtualColumnEntry inputColumns(@javax.annotation.Nonnull List inputColumns) { + this.inputColumns = inputColumns; + return this; + } + + public AddVirtualColumnEntry addInputColumnsItem(String inputColumnsItem) { + if (this.inputColumns == null) { + this.inputColumns = new ArrayList<>(); + } + this.inputColumns.add(inputColumnsItem); + return this; + } + + /** + * List of input column names for the virtual column + * + * @return inputColumns + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getInputColumns() { + return inputColumns; + } + + @JsonProperty(JSON_PROPERTY_INPUT_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputColumns(@javax.annotation.Nonnull List inputColumns) { + this.inputColumns = inputColumns; + } + + public AddVirtualColumnEntry dataType(@javax.annotation.Nonnull Object dataType) { + this.dataType = dataType; + return this; + } + + /** + * Data type of the virtual column using JSON representation + * + * @return dataType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getDataType() { + return dataType; + } + + @JsonProperty(JSON_PROPERTY_DATA_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDataType(@javax.annotation.Nonnull Object dataType) { + this.dataType = dataType; + } + + public AddVirtualColumnEntry image(@javax.annotation.Nonnull String image) { + this.image = image; + return this; + } + + /** + * Docker image to use for the UDF + * + * @return image + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IMAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getImage() { + return image; + } + + @JsonProperty(JSON_PROPERTY_IMAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setImage(@javax.annotation.Nonnull String image) { + this.image = image; + } + + public AddVirtualColumnEntry udf(@javax.annotation.Nonnull String udf) { + this.udf = udf; + return this; + } + + /** + * Base64 encoded pickled UDF + * + * @return udf + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdf() { + return udf; + } + + @JsonProperty(JSON_PROPERTY_UDF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdf(@javax.annotation.Nonnull String udf) { + this.udf = udf; + } + + public AddVirtualColumnEntry udfName(@javax.annotation.Nonnull String udfName) { + this.udfName = udfName; + return this; + } + + /** + * Name of the UDF + * + * @return udfName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDF_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdfName() { + return udfName; + } + + @JsonProperty(JSON_PROPERTY_UDF_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdfName(@javax.annotation.Nonnull String udfName) { + this.udfName = udfName; + } + + public AddVirtualColumnEntry udfVersion(@javax.annotation.Nonnull String udfVersion) { + this.udfVersion = udfVersion; + return this; + } + + /** + * Version of the UDF + * + * @return udfVersion + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDF_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdfVersion() { + return udfVersion; + } + + @JsonProperty(JSON_PROPERTY_UDF_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdfVersion(@javax.annotation.Nonnull String udfVersion) { + this.udfVersion = udfVersion; + } + + /** Return true if this AddVirtualColumnEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddVirtualColumnEntry addVirtualColumnEntry = (AddVirtualColumnEntry) o; + return Objects.equals(this.inputColumns, addVirtualColumnEntry.inputColumns) + && Objects.equals(this.dataType, addVirtualColumnEntry.dataType) + && Objects.equals(this.image, addVirtualColumnEntry.image) + && Objects.equals(this.udf, addVirtualColumnEntry.udf) + && Objects.equals(this.udfName, addVirtualColumnEntry.udfName) + && Objects.equals(this.udfVersion, addVirtualColumnEntry.udfVersion); + } + + @Override + public int hashCode() { + return Objects.hash(inputColumns, dataType, image, udf, udfName, udfVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddVirtualColumnEntry {\n"); + sb.append(" inputColumns: ").append(toIndentedString(inputColumns)).append("\n"); + sb.append(" dataType: ").append(toIndentedString(dataType)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" udf: ").append(toIndentedString(udf)).append("\n"); + sb.append(" udfName: ").append(toIndentedString(udfName)).append("\n"); + sb.append(" udfVersion: ").append(toIndentedString(udfVersion)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `input_columns` to the URL query string + if (getInputColumns() != null) { + for (int i = 0; i < getInputColumns().size(); i++) { + joiner.add( + String.format( + "%sinput_columns%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getInputColumns().get(i))))); + } + } + + // add `data_type` to the URL query string + if (getDataType() != null) { + joiner.add( + String.format( + "%sdata_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDataType())))); + } + + // add `image` to the URL query string + if (getImage() != null) { + joiner.add( + String.format( + "%simage%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getImage())))); + } + + // add `udf` to the URL query string + if (getUdf() != null) { + joiner.add( + String.format( + "%sudf%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUdf())))); + } + + // add `udf_name` to the URL query string + if (getUdfName() != null) { + joiner.add( + String.format( + "%sudf_name%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUdfName())))); + } + + // add `udf_version` to the URL query string + if (getUdfVersion() != null) { + joiner.add( + String.format( + "%sudf_version%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUdfVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterColumnsEntry.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterColumnsEntry.java new file mode 100644 index 000000000..ceeb162c2 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterColumnsEntry.java @@ -0,0 +1,286 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterColumnsEntry */ +@JsonPropertyOrder({ + AlterColumnsEntry.JSON_PROPERTY_PATH, + AlterColumnsEntry.JSON_PROPERTY_DATA_TYPE, + AlterColumnsEntry.JSON_PROPERTY_RENAME, + AlterColumnsEntry.JSON_PROPERTY_NULLABLE, + AlterColumnsEntry.JSON_PROPERTY_VIRTUAL_COLUMN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterColumnsEntry { + public static final String JSON_PROPERTY_PATH = "path"; + @javax.annotation.Nonnull private String path; + + public static final String JSON_PROPERTY_DATA_TYPE = "data_type"; + @javax.annotation.Nonnull private Object dataType; + + public static final String JSON_PROPERTY_RENAME = "rename"; + @javax.annotation.Nullable private String rename; + + public static final String JSON_PROPERTY_NULLABLE = "nullable"; + @javax.annotation.Nullable private Boolean nullable; + + public static final String JSON_PROPERTY_VIRTUAL_COLUMN = "virtual_column"; + @javax.annotation.Nullable private AlterVirtualColumnEntry virtualColumn; + + public AlterColumnsEntry() {} + + public AlterColumnsEntry path(@javax.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * Column path to alter + * + * @return path + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@javax.annotation.Nonnull String path) { + this.path = path; + } + + public AlterColumnsEntry dataType(@javax.annotation.Nonnull Object dataType) { + this.dataType = dataType; + return this; + } + + /** + * New data type for the column using JSON representation (optional) + * + * @return dataType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getDataType() { + return dataType; + } + + @JsonProperty(JSON_PROPERTY_DATA_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDataType(@javax.annotation.Nonnull Object dataType) { + this.dataType = dataType; + } + + public AlterColumnsEntry rename(@javax.annotation.Nullable String rename) { + this.rename = rename; + return this; + } + + /** + * New name for the column (optional) + * + * @return rename + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RENAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRename() { + return rename; + } + + @JsonProperty(JSON_PROPERTY_RENAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRename(@javax.annotation.Nullable String rename) { + this.rename = rename; + } + + public AlterColumnsEntry nullable(@javax.annotation.Nullable Boolean nullable) { + this.nullable = nullable; + return this; + } + + /** + * Whether the column should be nullable (optional) + * + * @return nullable + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNullable() { + return nullable; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNullable(@javax.annotation.Nullable Boolean nullable) { + this.nullable = nullable; + } + + public AlterColumnsEntry virtualColumn( + @javax.annotation.Nullable AlterVirtualColumnEntry virtualColumn) { + this.virtualColumn = virtualColumn; + return this; + } + + /** + * Virtual column alterations (optional) + * + * @return virtualColumn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIRTUAL_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlterVirtualColumnEntry getVirtualColumn() { + return virtualColumn; + } + + @JsonProperty(JSON_PROPERTY_VIRTUAL_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualColumn(@javax.annotation.Nullable AlterVirtualColumnEntry virtualColumn) { + this.virtualColumn = virtualColumn; + } + + /** Return true if this AlterColumnsEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterColumnsEntry alterColumnsEntry = (AlterColumnsEntry) o; + return Objects.equals(this.path, alterColumnsEntry.path) + && Objects.equals(this.dataType, alterColumnsEntry.dataType) + && Objects.equals(this.rename, alterColumnsEntry.rename) + && Objects.equals(this.nullable, alterColumnsEntry.nullable) + && Objects.equals(this.virtualColumn, alterColumnsEntry.virtualColumn); + } + + @Override + public int hashCode() { + return Objects.hash(path, dataType, rename, nullable, virtualColumn); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterColumnsEntry {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" dataType: ").append(toIndentedString(dataType)).append("\n"); + sb.append(" rename: ").append(toIndentedString(rename)).append("\n"); + sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n"); + sb.append(" virtualColumn: ").append(toIndentedString(virtualColumn)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add( + String.format( + "%spath%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPath())))); + } + + // add `data_type` to the URL query string + if (getDataType() != null) { + joiner.add( + String.format( + "%sdata_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDataType())))); + } + + // add `rename` to the URL query string + if (getRename() != null) { + joiner.add( + String.format( + "%srename%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRename())))); + } + + // add `nullable` to the URL query string + if (getNullable() != null) { + joiner.add( + String.format( + "%snullable%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNullable())))); + } + + // add `virtual_column` to the URL query string + if (getVirtualColumn() != null) { + joiner.add(getVirtualColumn().toUrlQueryString(prefix + "virtual_column" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAddColumnsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAddColumnsRequest.java new file mode 100644 index 000000000..7bb6ea839 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAddColumnsRequest.java @@ -0,0 +1,308 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTableAddColumnsRequest */ +@JsonPropertyOrder({ + AlterTableAddColumnsRequest.JSON_PROPERTY_IDENTITY, + AlterTableAddColumnsRequest.JSON_PROPERTY_CONTEXT, + AlterTableAddColumnsRequest.JSON_PROPERTY_ID, + AlterTableAddColumnsRequest.JSON_PROPERTY_NEW_COLUMNS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTableAddColumnsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_NEW_COLUMNS = "new_columns"; + @javax.annotation.Nonnull private List newColumns = new ArrayList<>(); + + public AlterTableAddColumnsRequest() {} + + public AlterTableAddColumnsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public AlterTableAddColumnsRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public AlterTableAddColumnsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public AlterTableAddColumnsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public AlterTableAddColumnsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public AlterTableAddColumnsRequest newColumns( + @javax.annotation.Nonnull List newColumns) { + this.newColumns = newColumns; + return this; + } + + public AlterTableAddColumnsRequest addNewColumnsItem(NewColumnTransform newColumnsItem) { + if (this.newColumns == null) { + this.newColumns = new ArrayList<>(); + } + this.newColumns.add(newColumnsItem); + return this; + } + + /** + * List of new columns to add + * + * @return newColumns + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NEW_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getNewColumns() { + return newColumns; + } + + @JsonProperty(JSON_PROPERTY_NEW_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNewColumns(@javax.annotation.Nonnull List newColumns) { + this.newColumns = newColumns; + } + + /** Return true if this AlterTableAddColumnsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTableAddColumnsRequest alterTableAddColumnsRequest = (AlterTableAddColumnsRequest) o; + return Objects.equals(this.identity, alterTableAddColumnsRequest.identity) + && Objects.equals(this.context, alterTableAddColumnsRequest.context) + && Objects.equals(this.id, alterTableAddColumnsRequest.id) + && Objects.equals(this.newColumns, alterTableAddColumnsRequest.newColumns); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, newColumns); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTableAddColumnsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" newColumns: ").append(toIndentedString(newColumns)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `new_columns` to the URL query string + if (getNewColumns() != null) { + for (int i = 0; i < getNewColumns().size(); i++) { + if (getNewColumns().get(i) != null) { + joiner.add( + getNewColumns() + .get(i) + .toUrlQueryString( + String.format( + "%snew_columns%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAddColumnsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAddColumnsResponse.java new file mode 100644 index 000000000..c9a6a0694 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAddColumnsResponse.java @@ -0,0 +1,178 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTableAddColumnsResponse */ +@JsonPropertyOrder({ + AlterTableAddColumnsResponse.JSON_PROPERTY_TRANSACTION_ID, + AlterTableAddColumnsResponse.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTableAddColumnsResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public AlterTableAddColumnsResponse() {} + + public AlterTableAddColumnsResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public AlterTableAddColumnsResponse version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version of the table after adding columns minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this AlterTableAddColumnsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTableAddColumnsResponse alterTableAddColumnsResponse = (AlterTableAddColumnsResponse) o; + return Objects.equals(this.transactionId, alterTableAddColumnsResponse.transactionId) + && Objects.equals(this.version, alterTableAddColumnsResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTableAddColumnsResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAlterColumnsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAlterColumnsRequest.java new file mode 100644 index 000000000..531697f65 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAlterColumnsRequest.java @@ -0,0 +1,308 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTableAlterColumnsRequest */ +@JsonPropertyOrder({ + AlterTableAlterColumnsRequest.JSON_PROPERTY_IDENTITY, + AlterTableAlterColumnsRequest.JSON_PROPERTY_CONTEXT, + AlterTableAlterColumnsRequest.JSON_PROPERTY_ID, + AlterTableAlterColumnsRequest.JSON_PROPERTY_ALTERATIONS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTableAlterColumnsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALTERATIONS = "alterations"; + @javax.annotation.Nonnull private List alterations = new ArrayList<>(); + + public AlterTableAlterColumnsRequest() {} + + public AlterTableAlterColumnsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public AlterTableAlterColumnsRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public AlterTableAlterColumnsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public AlterTableAlterColumnsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public AlterTableAlterColumnsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public AlterTableAlterColumnsRequest alterations( + @javax.annotation.Nonnull List alterations) { + this.alterations = alterations; + return this; + } + + public AlterTableAlterColumnsRequest addAlterationsItem(AlterColumnsEntry alterationsItem) { + if (this.alterations == null) { + this.alterations = new ArrayList<>(); + } + this.alterations.add(alterationsItem); + return this; + } + + /** + * List of column alterations to perform + * + * @return alterations + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ALTERATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getAlterations() { + return alterations; + } + + @JsonProperty(JSON_PROPERTY_ALTERATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAlterations(@javax.annotation.Nonnull List alterations) { + this.alterations = alterations; + } + + /** Return true if this AlterTableAlterColumnsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTableAlterColumnsRequest alterTableAlterColumnsRequest = (AlterTableAlterColumnsRequest) o; + return Objects.equals(this.identity, alterTableAlterColumnsRequest.identity) + && Objects.equals(this.context, alterTableAlterColumnsRequest.context) + && Objects.equals(this.id, alterTableAlterColumnsRequest.id) + && Objects.equals(this.alterations, alterTableAlterColumnsRequest.alterations); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, alterations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTableAlterColumnsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" alterations: ").append(toIndentedString(alterations)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `alterations` to the URL query string + if (getAlterations() != null) { + for (int i = 0; i < getAlterations().size(); i++) { + if (getAlterations().get(i) != null) { + joiner.add( + getAlterations() + .get(i) + .toUrlQueryString( + String.format( + "%salterations%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAlterColumnsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAlterColumnsResponse.java new file mode 100644 index 000000000..1a1d16d69 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableAlterColumnsResponse.java @@ -0,0 +1,179 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTableAlterColumnsResponse */ +@JsonPropertyOrder({ + AlterTableAlterColumnsResponse.JSON_PROPERTY_TRANSACTION_ID, + AlterTableAlterColumnsResponse.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTableAlterColumnsResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public AlterTableAlterColumnsResponse() {} + + public AlterTableAlterColumnsResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public AlterTableAlterColumnsResponse version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version of the table after altering columns minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this AlterTableAlterColumnsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTableAlterColumnsResponse alterTableAlterColumnsResponse = + (AlterTableAlterColumnsResponse) o; + return Objects.equals(this.transactionId, alterTableAlterColumnsResponse.transactionId) + && Objects.equals(this.version, alterTableAlterColumnsResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTableAlterColumnsResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableDropColumnsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableDropColumnsRequest.java new file mode 100644 index 000000000..dfddeab55 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableDropColumnsRequest.java @@ -0,0 +1,303 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTableDropColumnsRequest */ +@JsonPropertyOrder({ + AlterTableDropColumnsRequest.JSON_PROPERTY_IDENTITY, + AlterTableDropColumnsRequest.JSON_PROPERTY_CONTEXT, + AlterTableDropColumnsRequest.JSON_PROPERTY_ID, + AlterTableDropColumnsRequest.JSON_PROPERTY_COLUMNS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTableDropColumnsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_COLUMNS = "columns"; + @javax.annotation.Nonnull private List columns = new ArrayList<>(); + + public AlterTableDropColumnsRequest() {} + + public AlterTableDropColumnsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public AlterTableDropColumnsRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public AlterTableDropColumnsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public AlterTableDropColumnsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public AlterTableDropColumnsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public AlterTableDropColumnsRequest columns(@javax.annotation.Nonnull List columns) { + this.columns = columns; + return this; + } + + public AlterTableDropColumnsRequest addColumnsItem(String columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + return this; + } + + /** + * Names of columns to drop + * + * @return columns + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setColumns(@javax.annotation.Nonnull List columns) { + this.columns = columns; + } + + /** Return true if this AlterTableDropColumnsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTableDropColumnsRequest alterTableDropColumnsRequest = (AlterTableDropColumnsRequest) o; + return Objects.equals(this.identity, alterTableDropColumnsRequest.identity) + && Objects.equals(this.context, alterTableDropColumnsRequest.context) + && Objects.equals(this.id, alterTableDropColumnsRequest.id) + && Objects.equals(this.columns, alterTableDropColumnsRequest.columns); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, columns); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTableDropColumnsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `columns` to the URL query string + if (getColumns() != null) { + for (int i = 0; i < getColumns().size(); i++) { + joiner.add( + String.format( + "%scolumns%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getColumns().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableDropColumnsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableDropColumnsResponse.java new file mode 100644 index 000000000..4df27679d --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTableDropColumnsResponse.java @@ -0,0 +1,178 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTableDropColumnsResponse */ +@JsonPropertyOrder({ + AlterTableDropColumnsResponse.JSON_PROPERTY_TRANSACTION_ID, + AlterTableDropColumnsResponse.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTableDropColumnsResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public AlterTableDropColumnsResponse() {} + + public AlterTableDropColumnsResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public AlterTableDropColumnsResponse version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version of the table after dropping columns minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this AlterTableDropColumnsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTableDropColumnsResponse alterTableDropColumnsResponse = (AlterTableDropColumnsResponse) o; + return Objects.equals(this.transactionId, alterTableDropColumnsResponse.transactionId) + && Objects.equals(this.version, alterTableDropColumnsResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTableDropColumnsResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionAction.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionAction.java new file mode 100644 index 000000000..68fd98664 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionAction.java @@ -0,0 +1,218 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** + * A single action that could be performed to alter a transaction. This action holds the model + * definition for all types of specific actions models, this is to minimize difference and + * compatibility issue across codegen in different languages. When used, only one of the actions + * should be non-null for each action. If you would like to perform multiple actions, set a list of + * actions in the AlterTransactionRequest. + */ +@JsonPropertyOrder({ + AlterTransactionAction.JSON_PROPERTY_SET_STATUS_ACTION, + AlterTransactionAction.JSON_PROPERTY_SET_PROPERTY_ACTION, + AlterTransactionAction.JSON_PROPERTY_UNSET_PROPERTY_ACTION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTransactionAction { + public static final String JSON_PROPERTY_SET_STATUS_ACTION = "setStatusAction"; + @javax.annotation.Nullable private AlterTransactionSetStatus setStatusAction; + + public static final String JSON_PROPERTY_SET_PROPERTY_ACTION = "setPropertyAction"; + @javax.annotation.Nullable private AlterTransactionSetProperty setPropertyAction; + + public static final String JSON_PROPERTY_UNSET_PROPERTY_ACTION = "unsetPropertyAction"; + @javax.annotation.Nullable private AlterTransactionUnsetProperty unsetPropertyAction; + + public AlterTransactionAction() {} + + public AlterTransactionAction setStatusAction( + @javax.annotation.Nullable AlterTransactionSetStatus setStatusAction) { + this.setStatusAction = setStatusAction; + return this; + } + + /** + * Get setStatusAction + * + * @return setStatusAction + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SET_STATUS_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlterTransactionSetStatus getSetStatusAction() { + return setStatusAction; + } + + @JsonProperty(JSON_PROPERTY_SET_STATUS_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSetStatusAction( + @javax.annotation.Nullable AlterTransactionSetStatus setStatusAction) { + this.setStatusAction = setStatusAction; + } + + public AlterTransactionAction setPropertyAction( + @javax.annotation.Nullable AlterTransactionSetProperty setPropertyAction) { + this.setPropertyAction = setPropertyAction; + return this; + } + + /** + * Get setPropertyAction + * + * @return setPropertyAction + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SET_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlterTransactionSetProperty getSetPropertyAction() { + return setPropertyAction; + } + + @JsonProperty(JSON_PROPERTY_SET_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSetPropertyAction( + @javax.annotation.Nullable AlterTransactionSetProperty setPropertyAction) { + this.setPropertyAction = setPropertyAction; + } + + public AlterTransactionAction unsetPropertyAction( + @javax.annotation.Nullable AlterTransactionUnsetProperty unsetPropertyAction) { + this.unsetPropertyAction = unsetPropertyAction; + return this; + } + + /** + * Get unsetPropertyAction + * + * @return unsetPropertyAction + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNSET_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlterTransactionUnsetProperty getUnsetPropertyAction() { + return unsetPropertyAction; + } + + @JsonProperty(JSON_PROPERTY_UNSET_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnsetPropertyAction( + @javax.annotation.Nullable AlterTransactionUnsetProperty unsetPropertyAction) { + this.unsetPropertyAction = unsetPropertyAction; + } + + /** Return true if this AlterTransactionAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTransactionAction alterTransactionAction = (AlterTransactionAction) o; + return Objects.equals(this.setStatusAction, alterTransactionAction.setStatusAction) + && Objects.equals(this.setPropertyAction, alterTransactionAction.setPropertyAction) + && Objects.equals(this.unsetPropertyAction, alterTransactionAction.unsetPropertyAction); + } + + @Override + public int hashCode() { + return Objects.hash(setStatusAction, setPropertyAction, unsetPropertyAction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTransactionAction {\n"); + sb.append(" setStatusAction: ").append(toIndentedString(setStatusAction)).append("\n"); + sb.append(" setPropertyAction: ").append(toIndentedString(setPropertyAction)).append("\n"); + sb.append(" unsetPropertyAction: ") + .append(toIndentedString(unsetPropertyAction)) + .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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `setStatusAction` to the URL query string + if (getSetStatusAction() != null) { + joiner.add(getSetStatusAction().toUrlQueryString(prefix + "setStatusAction" + suffix)); + } + + // add `setPropertyAction` to the URL query string + if (getSetPropertyAction() != null) { + joiner.add(getSetPropertyAction().toUrlQueryString(prefix + "setPropertyAction" + suffix)); + } + + // add `unsetPropertyAction` to the URL query string + if (getUnsetPropertyAction() != null) { + joiner.add( + getUnsetPropertyAction().toUrlQueryString(prefix + "unsetPropertyAction" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionRequest.java new file mode 100644 index 000000000..0ade91c34 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionRequest.java @@ -0,0 +1,310 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Alter a transaction with a list of actions. The server should either succeed and apply all + * actions, or fail and apply no action. + */ +@JsonPropertyOrder({ + AlterTransactionRequest.JSON_PROPERTY_IDENTITY, + AlterTransactionRequest.JSON_PROPERTY_CONTEXT, + AlterTransactionRequest.JSON_PROPERTY_ID, + AlterTransactionRequest.JSON_PROPERTY_ACTIONS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTransactionRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_ACTIONS = "actions"; + @javax.annotation.Nonnull private List actions = new ArrayList<>(); + + public AlterTransactionRequest() {} + + public AlterTransactionRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public AlterTransactionRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public AlterTransactionRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public AlterTransactionRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public AlterTransactionRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public AlterTransactionRequest actions( + @javax.annotation.Nonnull List actions) { + this.actions = actions; + return this; + } + + public AlterTransactionRequest addActionsItem(AlterTransactionAction actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + + /** + * Get actions + * + * @return actions + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getActions() { + return actions; + } + + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setActions(@javax.annotation.Nonnull List actions) { + this.actions = actions; + } + + /** Return true if this AlterTransactionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTransactionRequest alterTransactionRequest = (AlterTransactionRequest) o; + return Objects.equals(this.identity, alterTransactionRequest.identity) + && Objects.equals(this.context, alterTransactionRequest.context) + && Objects.equals(this.id, alterTransactionRequest.id) + && Objects.equals(this.actions, alterTransactionRequest.actions); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, actions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTransactionRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `actions` to the URL query string + if (getActions() != null) { + for (int i = 0; i < getActions().size(); i++) { + if (getActions().get(i) != null) { + joiner.add( + getActions() + .get(i) + .toUrlQueryString( + String.format( + "%sactions%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionResponse.java new file mode 100644 index 000000000..df58b7a83 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionResponse.java @@ -0,0 +1,199 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTransactionResponse */ +@JsonPropertyOrder({ + AlterTransactionResponse.JSON_PROPERTY_STATUS, + AlterTransactionResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTransactionResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nonnull private String status; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public AlterTransactionResponse() {} + + public AlterTransactionResponse status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid + * values are: - Queued: the transaction is queued and not yet started - Running: the transaction + * is currently running - Succeeded: the transaction has completed successfully - Failed: the + * transaction has failed - Canceled: the transaction was canceled + * + * @return status + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + public AlterTransactionResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public AlterTransactionResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Get properties + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this AlterTransactionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTransactionResponse alterTransactionResponse = (AlterTransactionResponse) o; + return Objects.equals(this.status, alterTransactionResponse.status) + && Objects.equals(this.properties, alterTransactionResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(status, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTransactionResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionSetProperty.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionSetProperty.java new file mode 100644 index 000000000..20f22e37d --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionSetProperty.java @@ -0,0 +1,217 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTransactionSetProperty */ +@JsonPropertyOrder({ + AlterTransactionSetProperty.JSON_PROPERTY_KEY, + AlterTransactionSetProperty.JSON_PROPERTY_VALUE, + AlterTransactionSetProperty.JSON_PROPERTY_MODE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTransactionSetProperty { + public static final String JSON_PROPERTY_KEY = "key"; + @javax.annotation.Nullable private String key; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable private String value; + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode; + + public AlterTransactionSetProperty() {} + + public AlterTransactionSetProperty key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + public AlterTransactionSetProperty value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + public AlterTransactionSetProperty mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * The behavior if the property key already exists. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - Overwrite (default): overwrite the existing value with the + * provided value - Fail: fail the entire operation - Skip: keep the existing value and skip + * setting the provided value + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + /** Return true if this AlterTransactionSetProperty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTransactionSetProperty alterTransactionSetProperty = (AlterTransactionSetProperty) o; + return Objects.equals(this.key, alterTransactionSetProperty.key) + && Objects.equals(this.value, alterTransactionSetProperty.value) + && Objects.equals(this.mode, alterTransactionSetProperty.mode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTransactionSetProperty {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `key` to the URL query string + if (getKey() != null) { + joiner.add( + String.format( + "%skey%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `value` to the URL query string + if (getValue() != null) { + joiner.add( + String.format( + "%svalue%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getValue())))); + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionSetStatus.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionSetStatus.java new file mode 100644 index 000000000..93ee81ddb --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionSetStatus.java @@ -0,0 +1,141 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTransactionSetStatus */ +@JsonPropertyOrder({AlterTransactionSetStatus.JSON_PROPERTY_STATUS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTransactionSetStatus { + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nullable private String status; + + public AlterTransactionSetStatus() {} + + public AlterTransactionSetStatus status(@javax.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid + * values are: - Queued: the transaction is queued and not yet started - Running: the transaction + * is currently running - Succeeded: the transaction has completed successfully - Failed: the + * transaction has failed - Canceled: the transaction was canceled + * + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@javax.annotation.Nullable String status) { + this.status = status; + } + + /** Return true if this AlterTransactionSetStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTransactionSetStatus alterTransactionSetStatus = (AlterTransactionSetStatus) o; + return Objects.equals(this.status, alterTransactionSetStatus.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTransactionSetStatus {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionUnsetProperty.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionUnsetProperty.java new file mode 100644 index 000000000..8f6bf66f5 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterTransactionUnsetProperty.java @@ -0,0 +1,179 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterTransactionUnsetProperty */ +@JsonPropertyOrder({ + AlterTransactionUnsetProperty.JSON_PROPERTY_KEY, + AlterTransactionUnsetProperty.JSON_PROPERTY_MODE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterTransactionUnsetProperty { + public static final String JSON_PROPERTY_KEY = "key"; + @javax.annotation.Nullable private String key; + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode; + + public AlterTransactionUnsetProperty() {} + + public AlterTransactionUnsetProperty key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + public AlterTransactionUnsetProperty mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * The behavior if the property key to unset does not exist. Case insensitive, supports both + * PascalCase and snake_case. Valid values are: - Skip (default): skip the property to unset - + * Fail: fail the entire operation + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + /** Return true if this AlterTransactionUnsetProperty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterTransactionUnsetProperty alterTransactionUnsetProperty = (AlterTransactionUnsetProperty) o; + return Objects.equals(this.key, alterTransactionUnsetProperty.key) + && Objects.equals(this.mode, alterTransactionUnsetProperty.mode); + } + + @Override + public int hashCode() { + return Objects.hash(key, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterTransactionUnsetProperty {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `key` to the URL query string + if (getKey() != null) { + joiner.add( + String.format( + "%skey%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKey())))); + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterVirtualColumnEntry.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterVirtualColumnEntry.java new file mode 100644 index 000000000..32432cc88 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AlterVirtualColumnEntry.java @@ -0,0 +1,306 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** AlterVirtualColumnEntry */ +@JsonPropertyOrder({ + AlterVirtualColumnEntry.JSON_PROPERTY_INPUT_COLUMNS, + AlterVirtualColumnEntry.JSON_PROPERTY_IMAGE, + AlterVirtualColumnEntry.JSON_PROPERTY_UDF, + AlterVirtualColumnEntry.JSON_PROPERTY_UDF_NAME, + AlterVirtualColumnEntry.JSON_PROPERTY_UDF_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlterVirtualColumnEntry { + public static final String JSON_PROPERTY_INPUT_COLUMNS = "input_columns"; + @javax.annotation.Nullable private List inputColumns = new ArrayList<>(); + + public static final String JSON_PROPERTY_IMAGE = "image"; + @javax.annotation.Nullable private String image; + + public static final String JSON_PROPERTY_UDF = "udf"; + @javax.annotation.Nullable private String udf; + + public static final String JSON_PROPERTY_UDF_NAME = "udf_name"; + @javax.annotation.Nullable private String udfName; + + public static final String JSON_PROPERTY_UDF_VERSION = "udf_version"; + @javax.annotation.Nullable private String udfVersion; + + public AlterVirtualColumnEntry() {} + + public AlterVirtualColumnEntry inputColumns( + @javax.annotation.Nullable List inputColumns) { + this.inputColumns = inputColumns; + return this; + } + + public AlterVirtualColumnEntry addInputColumnsItem(String inputColumnsItem) { + if (this.inputColumns == null) { + this.inputColumns = new ArrayList<>(); + } + this.inputColumns.add(inputColumnsItem); + return this; + } + + /** + * List of input column names for the virtual column (optional) + * + * @return inputColumns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INPUT_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInputColumns() { + return inputColumns; + } + + @JsonProperty(JSON_PROPERTY_INPUT_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputColumns(@javax.annotation.Nullable List inputColumns) { + this.inputColumns = inputColumns; + } + + public AlterVirtualColumnEntry image(@javax.annotation.Nullable String image) { + this.image = image; + return this; + } + + /** + * Docker image to use for the UDF (optional) + * + * @return image + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImage() { + return image; + } + + @JsonProperty(JSON_PROPERTY_IMAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImage(@javax.annotation.Nullable String image) { + this.image = image; + } + + public AlterVirtualColumnEntry udf(@javax.annotation.Nullable String udf) { + this.udf = udf; + return this; + } + + /** + * Base64 encoded pickled UDF (optional) + * + * @return udf + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UDF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUdf() { + return udf; + } + + @JsonProperty(JSON_PROPERTY_UDF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdf(@javax.annotation.Nullable String udf) { + this.udf = udf; + } + + public AlterVirtualColumnEntry udfName(@javax.annotation.Nullable String udfName) { + this.udfName = udfName; + return this; + } + + /** + * Name of the UDF (optional) + * + * @return udfName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UDF_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUdfName() { + return udfName; + } + + @JsonProperty(JSON_PROPERTY_UDF_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdfName(@javax.annotation.Nullable String udfName) { + this.udfName = udfName; + } + + public AlterVirtualColumnEntry udfVersion(@javax.annotation.Nullable String udfVersion) { + this.udfVersion = udfVersion; + return this; + } + + /** + * Version of the UDF (optional) + * + * @return udfVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UDF_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUdfVersion() { + return udfVersion; + } + + @JsonProperty(JSON_PROPERTY_UDF_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdfVersion(@javax.annotation.Nullable String udfVersion) { + this.udfVersion = udfVersion; + } + + /** Return true if this AlterVirtualColumnEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlterVirtualColumnEntry alterVirtualColumnEntry = (AlterVirtualColumnEntry) o; + return Objects.equals(this.inputColumns, alterVirtualColumnEntry.inputColumns) + && Objects.equals(this.image, alterVirtualColumnEntry.image) + && Objects.equals(this.udf, alterVirtualColumnEntry.udf) + && Objects.equals(this.udfName, alterVirtualColumnEntry.udfName) + && Objects.equals(this.udfVersion, alterVirtualColumnEntry.udfVersion); + } + + @Override + public int hashCode() { + return Objects.hash(inputColumns, image, udf, udfName, udfVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlterVirtualColumnEntry {\n"); + sb.append(" inputColumns: ").append(toIndentedString(inputColumns)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" udf: ").append(toIndentedString(udf)).append("\n"); + sb.append(" udfName: ").append(toIndentedString(udfName)).append("\n"); + sb.append(" udfVersion: ").append(toIndentedString(udfVersion)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `input_columns` to the URL query string + if (getInputColumns() != null) { + for (int i = 0; i < getInputColumns().size(); i++) { + joiner.add( + String.format( + "%sinput_columns%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getInputColumns().get(i))))); + } + } + + // add `image` to the URL query string + if (getImage() != null) { + joiner.add( + String.format( + "%simage%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getImage())))); + } + + // add `udf` to the URL query string + if (getUdf() != null) { + joiner.add( + String.format( + "%sudf%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUdf())))); + } + + // add `udf_name` to the URL query string + if (getUdfName() != null) { + joiner.add( + String.format( + "%sudf_name%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUdfName())))); + } + + // add `udf_version` to the URL query string + if (getUdfVersion() != null) { + joiner.add( + String.format( + "%sudf_version%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUdfVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AnalyzeTableQueryPlanRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AnalyzeTableQueryPlanRequest.java new file mode 100644 index 000000000..ec1b033cd --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AnalyzeTableQueryPlanRequest.java @@ -0,0 +1,935 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** AnalyzeTableQueryPlanRequest */ +@JsonPropertyOrder({ + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_IDENTITY, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_CONTEXT, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_ID, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_BYPASS_VECTOR_INDEX, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_COLUMNS, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_DISTANCE_TYPE, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_EF, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_FAST_SEARCH, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_FILTER, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_FULL_TEXT_QUERY, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_K, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_LOWER_BOUND, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_NPROBES, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_OFFSET, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_PREFILTER, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_REFINE_FACTOR, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_UPPER_BOUND, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_VECTOR, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_VECTOR_COLUMN, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_VERSION, + AnalyzeTableQueryPlanRequest.JSON_PROPERTY_WITH_ROW_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AnalyzeTableQueryPlanRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_BYPASS_VECTOR_INDEX = "bypass_vector_index"; + @javax.annotation.Nullable private Boolean bypassVectorIndex; + + public static final String JSON_PROPERTY_COLUMNS = "columns"; + @javax.annotation.Nullable private QueryTableRequestColumns columns; + + public static final String JSON_PROPERTY_DISTANCE_TYPE = "distance_type"; + @javax.annotation.Nullable private String distanceType; + + public static final String JSON_PROPERTY_EF = "ef"; + @javax.annotation.Nullable private Integer ef; + + public static final String JSON_PROPERTY_FAST_SEARCH = "fast_search"; + @javax.annotation.Nullable private Boolean fastSearch; + + public static final String JSON_PROPERTY_FILTER = "filter"; + @javax.annotation.Nullable private String filter; + + public static final String JSON_PROPERTY_FULL_TEXT_QUERY = "full_text_query"; + @javax.annotation.Nullable private QueryTableRequestFullTextQuery fullTextQuery; + + public static final String JSON_PROPERTY_K = "k"; + @javax.annotation.Nonnull private Integer k; + + public static final String JSON_PROPERTY_LOWER_BOUND = "lower_bound"; + @javax.annotation.Nullable private Float lowerBound; + + public static final String JSON_PROPERTY_NPROBES = "nprobes"; + @javax.annotation.Nullable private Integer nprobes; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + @javax.annotation.Nullable private Integer offset; + + public static final String JSON_PROPERTY_PREFILTER = "prefilter"; + @javax.annotation.Nullable private Boolean prefilter; + + public static final String JSON_PROPERTY_REFINE_FACTOR = "refine_factor"; + @javax.annotation.Nullable private Integer refineFactor; + + public static final String JSON_PROPERTY_UPPER_BOUND = "upper_bound"; + @javax.annotation.Nullable private Float upperBound; + + public static final String JSON_PROPERTY_VECTOR = "vector"; + @javax.annotation.Nonnull private QueryTableRequestVector vector; + + public static final String JSON_PROPERTY_VECTOR_COLUMN = "vector_column"; + @javax.annotation.Nullable private String vectorColumn; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_WITH_ROW_ID = "with_row_id"; + @javax.annotation.Nullable private Boolean withRowId; + + public AnalyzeTableQueryPlanRequest() {} + + public AnalyzeTableQueryPlanRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public AnalyzeTableQueryPlanRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public AnalyzeTableQueryPlanRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public AnalyzeTableQueryPlanRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public AnalyzeTableQueryPlanRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public AnalyzeTableQueryPlanRequest bypassVectorIndex( + @javax.annotation.Nullable Boolean bypassVectorIndex) { + this.bypassVectorIndex = bypassVectorIndex; + return this; + } + + /** + * Whether to bypass vector index + * + * @return bypassVectorIndex + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BYPASS_VECTOR_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBypassVectorIndex() { + return bypassVectorIndex; + } + + @JsonProperty(JSON_PROPERTY_BYPASS_VECTOR_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBypassVectorIndex(@javax.annotation.Nullable Boolean bypassVectorIndex) { + this.bypassVectorIndex = bypassVectorIndex; + } + + public AnalyzeTableQueryPlanRequest columns( + @javax.annotation.Nullable QueryTableRequestColumns columns) { + this.columns = columns; + return this; + } + + /** + * Get columns + * + * @return columns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public QueryTableRequestColumns getColumns() { + return columns; + } + + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumns(@javax.annotation.Nullable QueryTableRequestColumns columns) { + this.columns = columns; + } + + public AnalyzeTableQueryPlanRequest distanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + return this; + } + + /** + * Distance metric to use + * + * @return distanceType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDistanceType() { + return distanceType; + } + + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDistanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + } + + public AnalyzeTableQueryPlanRequest ef(@javax.annotation.Nullable Integer ef) { + this.ef = ef; + return this; + } + + /** + * Search effort parameter for HNSW index minimum: 0 + * + * @return ef + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEf() { + return ef; + } + + @JsonProperty(JSON_PROPERTY_EF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEf(@javax.annotation.Nullable Integer ef) { + this.ef = ef; + } + + public AnalyzeTableQueryPlanRequest fastSearch(@javax.annotation.Nullable Boolean fastSearch) { + this.fastSearch = fastSearch; + return this; + } + + /** + * Whether to use fast search + * + * @return fastSearch + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAST_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFastSearch() { + return fastSearch; + } + + @JsonProperty(JSON_PROPERTY_FAST_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFastSearch(@javax.annotation.Nullable Boolean fastSearch) { + this.fastSearch = fastSearch; + } + + public AnalyzeTableQueryPlanRequest filter(@javax.annotation.Nullable String filter) { + this.filter = filter; + return this; + } + + /** + * Optional SQL filter expression + * + * @return filter + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilter() { + return filter; + } + + @JsonProperty(JSON_PROPERTY_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilter(@javax.annotation.Nullable String filter) { + this.filter = filter; + } + + public AnalyzeTableQueryPlanRequest fullTextQuery( + @javax.annotation.Nullable QueryTableRequestFullTextQuery fullTextQuery) { + this.fullTextQuery = fullTextQuery; + return this; + } + + /** + * Get fullTextQuery + * + * @return fullTextQuery + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FULL_TEXT_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public QueryTableRequestFullTextQuery getFullTextQuery() { + return fullTextQuery; + } + + @JsonProperty(JSON_PROPERTY_FULL_TEXT_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFullTextQuery( + @javax.annotation.Nullable QueryTableRequestFullTextQuery fullTextQuery) { + this.fullTextQuery = fullTextQuery; + } + + public AnalyzeTableQueryPlanRequest k(@javax.annotation.Nonnull Integer k) { + this.k = k; + return this; + } + + /** + * Number of results to return minimum: 0 + * + * @return k + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_K) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getK() { + return k; + } + + @JsonProperty(JSON_PROPERTY_K) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setK(@javax.annotation.Nonnull Integer k) { + this.k = k; + } + + public AnalyzeTableQueryPlanRequest lowerBound(@javax.annotation.Nullable Float lowerBound) { + this.lowerBound = lowerBound; + return this; + } + + /** + * Lower bound for search + * + * @return lowerBound + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOWER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getLowerBound() { + return lowerBound; + } + + @JsonProperty(JSON_PROPERTY_LOWER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLowerBound(@javax.annotation.Nullable Float lowerBound) { + this.lowerBound = lowerBound; + } + + public AnalyzeTableQueryPlanRequest nprobes(@javax.annotation.Nullable Integer nprobes) { + this.nprobes = nprobes; + return this; + } + + /** + * Number of probes for IVF index minimum: 0 + * + * @return nprobes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NPROBES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNprobes() { + return nprobes; + } + + @JsonProperty(JSON_PROPERTY_NPROBES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNprobes(@javax.annotation.Nullable Integer nprobes) { + this.nprobes = nprobes; + } + + public AnalyzeTableQueryPlanRequest offset(@javax.annotation.Nullable Integer offset) { + this.offset = offset; + return this; + } + + /** + * Number of results to skip minimum: 0 + * + * @return offset + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOffset() { + return offset; + } + + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOffset(@javax.annotation.Nullable Integer offset) { + this.offset = offset; + } + + public AnalyzeTableQueryPlanRequest prefilter(@javax.annotation.Nullable Boolean prefilter) { + this.prefilter = prefilter; + return this; + } + + /** + * Whether to apply filtering before vector search + * + * @return prefilter + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefilter() { + return prefilter; + } + + @JsonProperty(JSON_PROPERTY_PREFILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefilter(@javax.annotation.Nullable Boolean prefilter) { + this.prefilter = prefilter; + } + + public AnalyzeTableQueryPlanRequest refineFactor( + @javax.annotation.Nullable Integer refineFactor) { + this.refineFactor = refineFactor; + return this; + } + + /** + * Refine factor for search minimum: 0 + * + * @return refineFactor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REFINE_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRefineFactor() { + return refineFactor; + } + + @JsonProperty(JSON_PROPERTY_REFINE_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefineFactor(@javax.annotation.Nullable Integer refineFactor) { + this.refineFactor = refineFactor; + } + + public AnalyzeTableQueryPlanRequest upperBound(@javax.annotation.Nullable Float upperBound) { + this.upperBound = upperBound; + return this; + } + + /** + * Upper bound for search + * + * @return upperBound + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPPER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getUpperBound() { + return upperBound; + } + + @JsonProperty(JSON_PROPERTY_UPPER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpperBound(@javax.annotation.Nullable Float upperBound) { + this.upperBound = upperBound; + } + + public AnalyzeTableQueryPlanRequest vector( + @javax.annotation.Nonnull QueryTableRequestVector vector) { + this.vector = vector; + return this; + } + + /** + * Get vector + * + * @return vector + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VECTOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public QueryTableRequestVector getVector() { + return vector; + } + + @JsonProperty(JSON_PROPERTY_VECTOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVector(@javax.annotation.Nonnull QueryTableRequestVector vector) { + this.vector = vector; + } + + public AnalyzeTableQueryPlanRequest vectorColumn(@javax.annotation.Nullable String vectorColumn) { + this.vectorColumn = vectorColumn; + return this; + } + + /** + * Name of the vector column to search + * + * @return vectorColumn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VECTOR_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVectorColumn() { + return vectorColumn; + } + + @JsonProperty(JSON_PROPERTY_VECTOR_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVectorColumn(@javax.annotation.Nullable String vectorColumn) { + this.vectorColumn = vectorColumn; + } + + public AnalyzeTableQueryPlanRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Table version to query minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public AnalyzeTableQueryPlanRequest withRowId(@javax.annotation.Nullable Boolean withRowId) { + this.withRowId = withRowId; + return this; + } + + /** + * If true, return the row id as a column called `_rowid` + * + * @return withRowId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITH_ROW_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWithRowId() { + return withRowId; + } + + @JsonProperty(JSON_PROPERTY_WITH_ROW_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWithRowId(@javax.annotation.Nullable Boolean withRowId) { + this.withRowId = withRowId; + } + + /** Return true if this AnalyzeTableQueryPlanRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnalyzeTableQueryPlanRequest analyzeTableQueryPlanRequest = (AnalyzeTableQueryPlanRequest) o; + return Objects.equals(this.identity, analyzeTableQueryPlanRequest.identity) + && Objects.equals(this.context, analyzeTableQueryPlanRequest.context) + && Objects.equals(this.id, analyzeTableQueryPlanRequest.id) + && Objects.equals(this.bypassVectorIndex, analyzeTableQueryPlanRequest.bypassVectorIndex) + && Objects.equals(this.columns, analyzeTableQueryPlanRequest.columns) + && Objects.equals(this.distanceType, analyzeTableQueryPlanRequest.distanceType) + && Objects.equals(this.ef, analyzeTableQueryPlanRequest.ef) + && Objects.equals(this.fastSearch, analyzeTableQueryPlanRequest.fastSearch) + && Objects.equals(this.filter, analyzeTableQueryPlanRequest.filter) + && Objects.equals(this.fullTextQuery, analyzeTableQueryPlanRequest.fullTextQuery) + && Objects.equals(this.k, analyzeTableQueryPlanRequest.k) + && Objects.equals(this.lowerBound, analyzeTableQueryPlanRequest.lowerBound) + && Objects.equals(this.nprobes, analyzeTableQueryPlanRequest.nprobes) + && Objects.equals(this.offset, analyzeTableQueryPlanRequest.offset) + && Objects.equals(this.prefilter, analyzeTableQueryPlanRequest.prefilter) + && Objects.equals(this.refineFactor, analyzeTableQueryPlanRequest.refineFactor) + && Objects.equals(this.upperBound, analyzeTableQueryPlanRequest.upperBound) + && Objects.equals(this.vector, analyzeTableQueryPlanRequest.vector) + && Objects.equals(this.vectorColumn, analyzeTableQueryPlanRequest.vectorColumn) + && Objects.equals(this.version, analyzeTableQueryPlanRequest.version) + && Objects.equals(this.withRowId, analyzeTableQueryPlanRequest.withRowId); + } + + @Override + public int hashCode() { + return Objects.hash( + identity, + context, + id, + bypassVectorIndex, + columns, + distanceType, + ef, + fastSearch, + filter, + fullTextQuery, + k, + lowerBound, + nprobes, + offset, + prefilter, + refineFactor, + upperBound, + vector, + vectorColumn, + version, + withRowId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalyzeTableQueryPlanRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" bypassVectorIndex: ").append(toIndentedString(bypassVectorIndex)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" distanceType: ").append(toIndentedString(distanceType)).append("\n"); + sb.append(" ef: ").append(toIndentedString(ef)).append("\n"); + sb.append(" fastSearch: ").append(toIndentedString(fastSearch)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append(" fullTextQuery: ").append(toIndentedString(fullTextQuery)).append("\n"); + sb.append(" k: ").append(toIndentedString(k)).append("\n"); + sb.append(" lowerBound: ").append(toIndentedString(lowerBound)).append("\n"); + sb.append(" nprobes: ").append(toIndentedString(nprobes)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" prefilter: ").append(toIndentedString(prefilter)).append("\n"); + sb.append(" refineFactor: ").append(toIndentedString(refineFactor)).append("\n"); + sb.append(" upperBound: ").append(toIndentedString(upperBound)).append("\n"); + sb.append(" vector: ").append(toIndentedString(vector)).append("\n"); + sb.append(" vectorColumn: ").append(toIndentedString(vectorColumn)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" withRowId: ").append(toIndentedString(withRowId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `bypass_vector_index` to the URL query string + if (getBypassVectorIndex() != null) { + joiner.add( + String.format( + "%sbypass_vector_index%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBypassVectorIndex())))); + } + + // add `columns` to the URL query string + if (getColumns() != null) { + joiner.add(getColumns().toUrlQueryString(prefix + "columns" + suffix)); + } + + // add `distance_type` to the URL query string + if (getDistanceType() != null) { + joiner.add( + String.format( + "%sdistance_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDistanceType())))); + } + + // add `ef` to the URL query string + if (getEf() != null) { + joiner.add( + String.format( + "%sef%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEf())))); + } + + // add `fast_search` to the URL query string + if (getFastSearch() != null) { + joiner.add( + String.format( + "%sfast_search%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFastSearch())))); + } + + // add `filter` to the URL query string + if (getFilter() != null) { + joiner.add( + String.format( + "%sfilter%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFilter())))); + } + + // add `full_text_query` to the URL query string + if (getFullTextQuery() != null) { + joiner.add(getFullTextQuery().toUrlQueryString(prefix + "full_text_query" + suffix)); + } + + // add `k` to the URL query string + if (getK() != null) { + joiner.add( + String.format( + "%sk%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getK())))); + } + + // add `lower_bound` to the URL query string + if (getLowerBound() != null) { + joiner.add( + String.format( + "%slower_bound%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLowerBound())))); + } + + // add `nprobes` to the URL query string + if (getNprobes() != null) { + joiner.add( + String.format( + "%snprobes%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNprobes())))); + } + + // add `offset` to the URL query string + if (getOffset() != null) { + joiner.add( + String.format( + "%soffset%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOffset())))); + } + + // add `prefilter` to the URL query string + if (getPrefilter() != null) { + joiner.add( + String.format( + "%sprefilter%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPrefilter())))); + } + + // add `refine_factor` to the URL query string + if (getRefineFactor() != null) { + joiner.add( + String.format( + "%srefine_factor%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRefineFactor())))); + } + + // add `upper_bound` to the URL query string + if (getUpperBound() != null) { + joiner.add( + String.format( + "%supper_bound%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpperBound())))); + } + + // add `vector` to the URL query string + if (getVector() != null) { + joiner.add(getVector().toUrlQueryString(prefix + "vector" + suffix)); + } + + // add `vector_column` to the URL query string + if (getVectorColumn() != null) { + joiner.add( + String.format( + "%svector_column%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVectorColumn())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `with_row_id` to the URL query string + if (getWithRowId() != null) { + joiner.add( + String.format( + "%swith_row_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWithRowId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AnalyzeTableQueryPlanResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AnalyzeTableQueryPlanResponse.java new file mode 100644 index 000000000..3ef7e335d --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/AnalyzeTableQueryPlanResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** AnalyzeTableQueryPlanResponse */ +@JsonPropertyOrder({AnalyzeTableQueryPlanResponse.JSON_PROPERTY_ANALYSIS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AnalyzeTableQueryPlanResponse { + public static final String JSON_PROPERTY_ANALYSIS = "analysis"; + @javax.annotation.Nonnull private String analysis; + + public AnalyzeTableQueryPlanResponse() {} + + public AnalyzeTableQueryPlanResponse analysis(@javax.annotation.Nonnull String analysis) { + this.analysis = analysis; + return this; + } + + /** + * Detailed analysis of the query execution plan + * + * @return analysis + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ANALYSIS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAnalysis() { + return analysis; + } + + @JsonProperty(JSON_PROPERTY_ANALYSIS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAnalysis(@javax.annotation.Nonnull String analysis) { + this.analysis = analysis; + } + + /** Return true if this AnalyzeTableQueryPlanResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnalyzeTableQueryPlanResponse analyzeTableQueryPlanResponse = (AnalyzeTableQueryPlanResponse) o; + return Objects.equals(this.analysis, analyzeTableQueryPlanResponse.analysis); + } + + @Override + public int hashCode() { + return Objects.hash(analysis); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalyzeTableQueryPlanResponse {\n"); + sb.append(" analysis: ").append(toIndentedString(analysis)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `analysis` to the URL query string + if (getAnalysis() != null) { + joiner.add( + String.format( + "%sanalysis%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAnalysis())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchCreateTableVersionsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchCreateTableVersionsRequest.java new file mode 100644 index 000000000..9b98c2ebc --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchCreateTableVersionsRequest.java @@ -0,0 +1,260 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Request to atomically create new version entries for multiple tables. The operation is atomic: + * all versions are created or none are. + */ +@JsonPropertyOrder({ + BatchCreateTableVersionsRequest.JSON_PROPERTY_IDENTITY, + BatchCreateTableVersionsRequest.JSON_PROPERTY_CONTEXT, + BatchCreateTableVersionsRequest.JSON_PROPERTY_ENTRIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchCreateTableVersionsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ENTRIES = "entries"; + @javax.annotation.Nonnull private List entries = new ArrayList<>(); + + public BatchCreateTableVersionsRequest() {} + + public BatchCreateTableVersionsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public BatchCreateTableVersionsRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public BatchCreateTableVersionsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public BatchCreateTableVersionsRequest entries( + @javax.annotation.Nonnull List entries) { + this.entries = entries; + return this; + } + + public BatchCreateTableVersionsRequest addEntriesItem(CreateTableVersionEntry entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * List of table version entries to create atomically + * + * @return entries + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEntries() { + return entries; + } + + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEntries(@javax.annotation.Nonnull List entries) { + this.entries = entries; + } + + /** Return true if this BatchCreateTableVersionsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchCreateTableVersionsRequest batchCreateTableVersionsRequest = + (BatchCreateTableVersionsRequest) o; + return Objects.equals(this.identity, batchCreateTableVersionsRequest.identity) + && Objects.equals(this.context, batchCreateTableVersionsRequest.context) + && Objects.equals(this.entries, batchCreateTableVersionsRequest.entries); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, entries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchCreateTableVersionsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `entries` to the URL query string + if (getEntries() != null) { + for (int i = 0; i < getEntries().size(); i++) { + if (getEntries().get(i) != null) { + joiner.add( + getEntries() + .get(i) + .toUrlQueryString( + String.format( + "%sentries%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchCreateTableVersionsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchCreateTableVersionsResponse.java new file mode 100644 index 000000000..b2b9040e6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchCreateTableVersionsResponse.java @@ -0,0 +1,204 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Response for batch creating table versions. Contains the created versions for each table in the + * same order as the request. + */ +@JsonPropertyOrder({ + BatchCreateTableVersionsResponse.JSON_PROPERTY_TRANSACTION_ID, + BatchCreateTableVersionsResponse.JSON_PROPERTY_VERSIONS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchCreateTableVersionsResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_VERSIONS = "versions"; + @javax.annotation.Nonnull private List versions = new ArrayList<>(); + + public BatchCreateTableVersionsResponse() {} + + public BatchCreateTableVersionsResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public BatchCreateTableVersionsResponse versions( + @javax.annotation.Nonnull List versions) { + this.versions = versions; + return this; + } + + public BatchCreateTableVersionsResponse addVersionsItem(TableVersion versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * List of created table versions in the same order as the request entries + * + * @return versions + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getVersions() { + return versions; + } + + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersions(@javax.annotation.Nonnull List versions) { + this.versions = versions; + } + + /** Return true if this BatchCreateTableVersionsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchCreateTableVersionsResponse batchCreateTableVersionsResponse = + (BatchCreateTableVersionsResponse) o; + return Objects.equals(this.transactionId, batchCreateTableVersionsResponse.transactionId) + && Objects.equals(this.versions, batchCreateTableVersionsResponse.versions); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, versions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchCreateTableVersionsResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `versions` to the URL query string + if (getVersions() != null) { + for (int i = 0; i < getVersions().size(); i++) { + if (getVersions().get(i) != null) { + joiner.add( + getVersions() + .get(i) + .toUrlQueryString( + String.format( + "%sversions%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchDeleteTableVersionsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchDeleteTableVersionsRequest.java new file mode 100644 index 000000000..4c1e9d956 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchDeleteTableVersionsRequest.java @@ -0,0 +1,313 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Request to delete table version records. Supports deleting ranges of versions for efficient bulk + * cleanup. + */ +@JsonPropertyOrder({ + BatchDeleteTableVersionsRequest.JSON_PROPERTY_IDENTITY, + BatchDeleteTableVersionsRequest.JSON_PROPERTY_CONTEXT, + BatchDeleteTableVersionsRequest.JSON_PROPERTY_ID, + BatchDeleteTableVersionsRequest.JSON_PROPERTY_RANGES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchDeleteTableVersionsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_RANGES = "ranges"; + @javax.annotation.Nonnull private List ranges = new ArrayList<>(); + + public BatchDeleteTableVersionsRequest() {} + + public BatchDeleteTableVersionsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public BatchDeleteTableVersionsRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public BatchDeleteTableVersionsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public BatchDeleteTableVersionsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public BatchDeleteTableVersionsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public BatchDeleteTableVersionsRequest ranges( + @javax.annotation.Nonnull List ranges) { + this.ranges = ranges; + return this; + } + + public BatchDeleteTableVersionsRequest addRangesItem(VersionRange rangesItem) { + if (this.ranges == null) { + this.ranges = new ArrayList<>(); + } + this.ranges.add(rangesItem); + return this; + } + + /** + * List of version ranges to delete. Each range specifies start (inclusive) and end (exclusive) + * versions. + * + * @return ranges + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RANGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRanges() { + return ranges; + } + + @JsonProperty(JSON_PROPERTY_RANGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRanges(@javax.annotation.Nonnull List ranges) { + this.ranges = ranges; + } + + /** Return true if this BatchDeleteTableVersionsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchDeleteTableVersionsRequest batchDeleteTableVersionsRequest = + (BatchDeleteTableVersionsRequest) o; + return Objects.equals(this.identity, batchDeleteTableVersionsRequest.identity) + && Objects.equals(this.context, batchDeleteTableVersionsRequest.context) + && Objects.equals(this.id, batchDeleteTableVersionsRequest.id) + && Objects.equals(this.ranges, batchDeleteTableVersionsRequest.ranges); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, ranges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchDeleteTableVersionsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ranges: ").append(toIndentedString(ranges)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `ranges` to the URL query string + if (getRanges() != null) { + for (int i = 0; i < getRanges().size(); i++) { + if (getRanges().get(i) != null) { + joiner.add( + getRanges() + .get(i) + .toUrlQueryString( + String.format( + "%sranges%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchDeleteTableVersionsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchDeleteTableVersionsResponse.java new file mode 100644 index 000000000..2a9c1d839 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BatchDeleteTableVersionsResponse.java @@ -0,0 +1,180 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for deleting table version records */ +@JsonPropertyOrder({ + BatchDeleteTableVersionsResponse.JSON_PROPERTY_DELETED_COUNT, + BatchDeleteTableVersionsResponse.JSON_PROPERTY_TRANSACTION_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchDeleteTableVersionsResponse { + public static final String JSON_PROPERTY_DELETED_COUNT = "deleted_count"; + @javax.annotation.Nullable private Long deletedCount; + + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public BatchDeleteTableVersionsResponse() {} + + public BatchDeleteTableVersionsResponse deletedCount( + @javax.annotation.Nullable Long deletedCount) { + this.deletedCount = deletedCount; + return this; + } + + /** + * Number of version records deleted minimum: 0 + * + * @return deletedCount + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDeletedCount() { + return deletedCount; + } + + @JsonProperty(JSON_PROPERTY_DELETED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletedCount(@javax.annotation.Nullable Long deletedCount) { + this.deletedCount = deletedCount; + } + + public BatchDeleteTableVersionsResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this BatchDeleteTableVersionsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchDeleteTableVersionsResponse batchDeleteTableVersionsResponse = + (BatchDeleteTableVersionsResponse) o; + return Objects.equals(this.deletedCount, batchDeleteTableVersionsResponse.deletedCount) + && Objects.equals(this.transactionId, batchDeleteTableVersionsResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(deletedCount, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchDeleteTableVersionsResponse {\n"); + sb.append(" deletedCount: ").append(toIndentedString(deletedCount)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `deleted_count` to the URL query string + if (getDeletedCount() != null) { + joiner.add( + String.format( + "%sdeleted_count%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeletedCount())))); + } + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BooleanQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BooleanQuery.java new file mode 100644 index 000000000..9ffc7db67 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BooleanQuery.java @@ -0,0 +1,271 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** Boolean query with must, should, and must_not clauses */ +@JsonPropertyOrder({ + BooleanQuery.JSON_PROPERTY_MUST, + BooleanQuery.JSON_PROPERTY_MUST_NOT, + BooleanQuery.JSON_PROPERTY_SHOULD +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BooleanQuery { + public static final String JSON_PROPERTY_MUST = "must"; + @javax.annotation.Nonnull private List must = new ArrayList<>(); + + public static final String JSON_PROPERTY_MUST_NOT = "must_not"; + @javax.annotation.Nonnull private List mustNot = new ArrayList<>(); + + public static final String JSON_PROPERTY_SHOULD = "should"; + @javax.annotation.Nonnull private List should = new ArrayList<>(); + + public BooleanQuery() {} + + public BooleanQuery must(@javax.annotation.Nonnull List must) { + this.must = must; + return this; + } + + public BooleanQuery addMustItem(FtsQuery mustItem) { + if (this.must == null) { + this.must = new ArrayList<>(); + } + this.must.add(mustItem); + return this; + } + + /** + * Queries that must match (AND) + * + * @return must + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MUST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMust() { + return must; + } + + @JsonProperty(JSON_PROPERTY_MUST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMust(@javax.annotation.Nonnull List must) { + this.must = must; + } + + public BooleanQuery mustNot(@javax.annotation.Nonnull List mustNot) { + this.mustNot = mustNot; + return this; + } + + public BooleanQuery addMustNotItem(FtsQuery mustNotItem) { + if (this.mustNot == null) { + this.mustNot = new ArrayList<>(); + } + this.mustNot.add(mustNotItem); + return this; + } + + /** + * Queries that must not match (NOT) + * + * @return mustNot + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MUST_NOT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMustNot() { + return mustNot; + } + + @JsonProperty(JSON_PROPERTY_MUST_NOT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMustNot(@javax.annotation.Nonnull List mustNot) { + this.mustNot = mustNot; + } + + public BooleanQuery should(@javax.annotation.Nonnull List should) { + this.should = should; + return this; + } + + public BooleanQuery addShouldItem(FtsQuery shouldItem) { + if (this.should == null) { + this.should = new ArrayList<>(); + } + this.should.add(shouldItem); + return this; + } + + /** + * Queries that should match (OR) + * + * @return should + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHOULD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getShould() { + return should; + } + + @JsonProperty(JSON_PROPERTY_SHOULD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShould(@javax.annotation.Nonnull List should) { + this.should = should; + } + + /** Return true if this BooleanQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BooleanQuery booleanQuery = (BooleanQuery) o; + return Objects.equals(this.must, booleanQuery.must) + && Objects.equals(this.mustNot, booleanQuery.mustNot) + && Objects.equals(this.should, booleanQuery.should); + } + + @Override + public int hashCode() { + return Objects.hash(must, mustNot, should); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BooleanQuery {\n"); + sb.append(" must: ").append(toIndentedString(must)).append("\n"); + sb.append(" mustNot: ").append(toIndentedString(mustNot)).append("\n"); + sb.append(" should: ").append(toIndentedString(should)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `must` to the URL query string + if (getMust() != null) { + for (int i = 0; i < getMust().size(); i++) { + if (getMust().get(i) != null) { + joiner.add( + getMust() + .get(i) + .toUrlQueryString( + String.format( + "%smust%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `must_not` to the URL query string + if (getMustNot() != null) { + for (int i = 0; i < getMustNot().size(); i++) { + if (getMustNot().get(i) != null) { + joiner.add( + getMustNot() + .get(i) + .toUrlQueryString( + String.format( + "%smust_not%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `should` to the URL query string + if (getShould() != null) { + for (int i = 0; i < getShould().size(); i++) { + if (getShould().get(i) != null) { + joiner.add( + getShould() + .get(i) + .toUrlQueryString( + String.format( + "%sshould%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BoostQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BoostQuery.java new file mode 100644 index 000000000..bda57870e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/BoostQuery.java @@ -0,0 +1,208 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Boost query that scores documents matching positive query higher and negative query lower */ +@JsonPropertyOrder({ + BoostQuery.JSON_PROPERTY_POSITIVE, + BoostQuery.JSON_PROPERTY_NEGATIVE, + BoostQuery.JSON_PROPERTY_NEGATIVE_BOOST +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BoostQuery { + public static final String JSON_PROPERTY_POSITIVE = "positive"; + @javax.annotation.Nonnull private FtsQuery positive; + + public static final String JSON_PROPERTY_NEGATIVE = "negative"; + @javax.annotation.Nonnull private FtsQuery negative; + + public static final String JSON_PROPERTY_NEGATIVE_BOOST = "negative_boost"; + @javax.annotation.Nullable private Float negativeBoost = 0.5f; + + public BoostQuery() {} + + public BoostQuery positive(@javax.annotation.Nonnull FtsQuery positive) { + this.positive = positive; + return this; + } + + /** + * Get positive + * + * @return positive + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_POSITIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FtsQuery getPositive() { + return positive; + } + + @JsonProperty(JSON_PROPERTY_POSITIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPositive(@javax.annotation.Nonnull FtsQuery positive) { + this.positive = positive; + } + + public BoostQuery negative(@javax.annotation.Nonnull FtsQuery negative) { + this.negative = negative; + return this; + } + + /** + * Get negative + * + * @return negative + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NEGATIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FtsQuery getNegative() { + return negative; + } + + @JsonProperty(JSON_PROPERTY_NEGATIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNegative(@javax.annotation.Nonnull FtsQuery negative) { + this.negative = negative; + } + + public BoostQuery negativeBoost(@javax.annotation.Nullable Float negativeBoost) { + this.negativeBoost = negativeBoost; + return this; + } + + /** + * Boost factor for negative query (default: 0.5) + * + * @return negativeBoost + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEGATIVE_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getNegativeBoost() { + return negativeBoost; + } + + @JsonProperty(JSON_PROPERTY_NEGATIVE_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNegativeBoost(@javax.annotation.Nullable Float negativeBoost) { + this.negativeBoost = negativeBoost; + } + + /** Return true if this BoostQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BoostQuery boostQuery = (BoostQuery) o; + return Objects.equals(this.positive, boostQuery.positive) + && Objects.equals(this.negative, boostQuery.negative) + && Objects.equals(this.negativeBoost, boostQuery.negativeBoost); + } + + @Override + public int hashCode() { + return Objects.hash(positive, negative, negativeBoost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BoostQuery {\n"); + sb.append(" positive: ").append(toIndentedString(positive)).append("\n"); + sb.append(" negative: ").append(toIndentedString(negative)).append("\n"); + sb.append(" negativeBoost: ").append(toIndentedString(negativeBoost)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `positive` to the URL query string + if (getPositive() != null) { + joiner.add(getPositive().toUrlQueryString(prefix + "positive" + suffix)); + } + + // add `negative` to the URL query string + if (getNegative() != null) { + joiner.add(getNegative().toUrlQueryString(prefix + "negative" + suffix)); + } + + // add `negative_boost` to the URL query string + if (getNegativeBoost() != null) { + joiner.add( + String.format( + "%snegative_boost%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNegativeBoost())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CountTableRowsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CountTableRowsRequest.java new file mode 100644 index 000000000..5afaa54d0 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CountTableRowsRequest.java @@ -0,0 +1,325 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CountTableRowsRequest */ +@JsonPropertyOrder({ + CountTableRowsRequest.JSON_PROPERTY_IDENTITY, + CountTableRowsRequest.JSON_PROPERTY_CONTEXT, + CountTableRowsRequest.JSON_PROPERTY_ID, + CountTableRowsRequest.JSON_PROPERTY_VERSION, + CountTableRowsRequest.JSON_PROPERTY_PREDICATE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CountTableRowsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_PREDICATE = "predicate"; + @javax.annotation.Nullable private String predicate; + + public CountTableRowsRequest() {} + + public CountTableRowsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CountTableRowsRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CountTableRowsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CountTableRowsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CountTableRowsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CountTableRowsRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Version of the table to describe. If not specified, server should resolve it to the latest + * version. minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public CountTableRowsRequest predicate(@javax.annotation.Nullable String predicate) { + this.predicate = predicate; + return this; + } + + /** + * Optional SQL predicate to filter rows for counting + * + * @return predicate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREDICATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPredicate() { + return predicate; + } + + @JsonProperty(JSON_PROPERTY_PREDICATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPredicate(@javax.annotation.Nullable String predicate) { + this.predicate = predicate; + } + + /** Return true if this CountTableRowsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountTableRowsRequest countTableRowsRequest = (CountTableRowsRequest) o; + return Objects.equals(this.identity, countTableRowsRequest.identity) + && Objects.equals(this.context, countTableRowsRequest.context) + && Objects.equals(this.id, countTableRowsRequest.id) + && Objects.equals(this.version, countTableRowsRequest.version) + && Objects.equals(this.predicate, countTableRowsRequest.predicate); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, version, predicate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountTableRowsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" predicate: ").append(toIndentedString(predicate)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `predicate` to the URL query string + if (getPredicate() != null) { + joiner.add( + String.format( + "%spredicate%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPredicate())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java new file mode 100644 index 000000000..709e93c5a --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java @@ -0,0 +1,387 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. + * + * @deprecated + */ +@Deprecated +@JsonPropertyOrder({ + CreateEmptyTableRequest.JSON_PROPERTY_IDENTITY, + CreateEmptyTableRequest.JSON_PROPERTY_CONTEXT, + CreateEmptyTableRequest.JSON_PROPERTY_ID, + CreateEmptyTableRequest.JSON_PROPERTY_LOCATION, + CreateEmptyTableRequest.JSON_PROPERTY_VEND_CREDENTIALS, + CreateEmptyTableRequest.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateEmptyTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_VEND_CREDENTIALS = "vend_credentials"; + @javax.annotation.Nullable private Boolean vendCredentials; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateEmptyTableRequest() {} + + public CreateEmptyTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CreateEmptyTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CreateEmptyTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CreateEmptyTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CreateEmptyTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CreateEmptyTableRequest location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Optional storage location for the table. If not provided, the namespace implementation should + * determine the table location. + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public CreateEmptyTableRequest vendCredentials( + @javax.annotation.Nullable Boolean vendCredentials) { + this.vendCredentials = vendCredentials; + return this; + } + + /** + * Whether to include vended credentials in the response `storage_options`. When true, + * the implementation should provide vended credentials for accessing storage. When not set, the + * implementation can decide whether to return vended credentials. + * + * @return vendCredentials + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVendCredentials() { + return vendCredentials; + } + + @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { + this.vendCredentials = vendCredentials; + } + + public CreateEmptyTableRequest properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public CreateEmptyTableRequest putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the table, if supported by the server. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this CreateEmptyTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmptyTableRequest createEmptyTableRequest = (CreateEmptyTableRequest) o; + return Objects.equals(this.identity, createEmptyTableRequest.identity) + && Objects.equals(this.context, createEmptyTableRequest.context) + && Objects.equals(this.id, createEmptyTableRequest.id) + && Objects.equals(this.location, createEmptyTableRequest.location) + && Objects.equals(this.vendCredentials, createEmptyTableRequest.vendCredentials) + && Objects.equals(this.properties, createEmptyTableRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, location, vendCredentials, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEmptyTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" vendCredentials: ").append(toIndentedString(vendCredentials)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `vend_credentials` to the URL query string + if (getVendCredentials() != null) { + joiner.add( + String.format( + "%svend_credentials%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVendCredentials())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java new file mode 100644 index 000000000..5df104cf9 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java @@ -0,0 +1,295 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` + * instead. + * + * @deprecated + */ +@Deprecated +@JsonPropertyOrder({ + CreateEmptyTableResponse.JSON_PROPERTY_TRANSACTION_ID, + CreateEmptyTableResponse.JSON_PROPERTY_LOCATION, + CreateEmptyTableResponse.JSON_PROPERTY_STORAGE_OPTIONS, + CreateEmptyTableResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateEmptyTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; + @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateEmptyTableResponse() {} + + public CreateEmptyTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public CreateEmptyTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public CreateEmptyTableResponse storageOptions( + @javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + return this; + } + + public CreateEmptyTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Configuration options to be used to access storage. The available options depend on the type of + * storage in use. These will be passed directly to Lance to initialize storage access. + * + * @return storageOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getStorageOptions() { + return storageOptions; + } + + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + } + + public CreateEmptyTableResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public CreateEmptyTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this CreateEmptyTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmptyTableResponse createEmptyTableResponse = (CreateEmptyTableResponse) o; + return Objects.equals(this.transactionId, createEmptyTableResponse.transactionId) + && Objects.equals(this.location, createEmptyTableResponse.location) + && Objects.equals(this.storageOptions, createEmptyTableResponse.storageOptions) + && Objects.equals(this.properties, createEmptyTableResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, location, storageOptions, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEmptyTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `storage_options` to the URL query string + if (getStorageOptions() != null) { + for (String _key : getStorageOptions().keySet()) { + joiner.add( + String.format( + "%sstorage_options%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getStorageOptions().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getStorageOptions().get(_key))))); + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateNamespaceRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateNamespaceRequest.java new file mode 100644 index 000000000..09b946632 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateNamespaceRequest.java @@ -0,0 +1,345 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CreateNamespaceRequest */ +@JsonPropertyOrder({ + CreateNamespaceRequest.JSON_PROPERTY_IDENTITY, + CreateNamespaceRequest.JSON_PROPERTY_CONTEXT, + CreateNamespaceRequest.JSON_PROPERTY_ID, + CreateNamespaceRequest.JSON_PROPERTY_MODE, + CreateNamespaceRequest.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateNamespaceRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateNamespaceRequest() {} + + public CreateNamespaceRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CreateNamespaceRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CreateNamespaceRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CreateNamespaceRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CreateNamespaceRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CreateNamespaceRequest mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * There are three modes when trying to create a namespace, to differentiate the behavior when a + * namespace of the same name already exists. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation + * succeeds and the existing namespace is kept. * Overwrite: the existing namespace is dropped and + * a new empty namespace with this name is created. + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + public CreateNamespaceRequest properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public CreateNamespaceRequest putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the namespace, if supported by the implementation. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this CreateNamespaceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNamespaceRequest createNamespaceRequest = (CreateNamespaceRequest) o; + return Objects.equals(this.identity, createNamespaceRequest.identity) + && Objects.equals(this.context, createNamespaceRequest.context) + && Objects.equals(this.id, createNamespaceRequest.id) + && Objects.equals(this.mode, createNamespaceRequest.mode) + && Objects.equals(this.properties, createNamespaceRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, mode, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateNamespaceResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateNamespaceResponse.java new file mode 100644 index 000000000..c8e7c3f71 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateNamespaceResponse.java @@ -0,0 +1,198 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CreateNamespaceResponse */ +@JsonPropertyOrder({ + CreateNamespaceResponse.JSON_PROPERTY_TRANSACTION_ID, + CreateNamespaceResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateNamespaceResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateNamespaceResponse() {} + + public CreateNamespaceResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public CreateNamespaceResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public CreateNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties after the namespace is created. If the server does not support namespace properties, + * it should return null for this field. If namespace properties are supported, but none are set, + * it should return an empty object. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this CreateNamespaceResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNamespaceResponse createNamespaceResponse = (CreateNamespaceResponse) o; + return Objects.equals(this.transactionId, createNamespaceResponse.transactionId) + && Objects.equals(this.properties, createNamespaceResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableIndexRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableIndexRequest.java new file mode 100644 index 000000000..888d6bac8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableIndexRequest.java @@ -0,0 +1,710 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CreateTableIndexRequest */ +@JsonPropertyOrder({ + CreateTableIndexRequest.JSON_PROPERTY_IDENTITY, + CreateTableIndexRequest.JSON_PROPERTY_CONTEXT, + CreateTableIndexRequest.JSON_PROPERTY_ID, + CreateTableIndexRequest.JSON_PROPERTY_COLUMN, + CreateTableIndexRequest.JSON_PROPERTY_INDEX_TYPE, + CreateTableIndexRequest.JSON_PROPERTY_NAME, + CreateTableIndexRequest.JSON_PROPERTY_DISTANCE_TYPE, + CreateTableIndexRequest.JSON_PROPERTY_WITH_POSITION, + CreateTableIndexRequest.JSON_PROPERTY_BASE_TOKENIZER, + CreateTableIndexRequest.JSON_PROPERTY_LANGUAGE, + CreateTableIndexRequest.JSON_PROPERTY_MAX_TOKEN_LENGTH, + CreateTableIndexRequest.JSON_PROPERTY_LOWER_CASE, + CreateTableIndexRequest.JSON_PROPERTY_STEM, + CreateTableIndexRequest.JSON_PROPERTY_REMOVE_STOP_WORDS, + CreateTableIndexRequest.JSON_PROPERTY_ASCII_FOLDING +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableIndexRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_COLUMN = "column"; + @javax.annotation.Nonnull private String column; + + public static final String JSON_PROPERTY_INDEX_TYPE = "index_type"; + @javax.annotation.Nonnull private String indexType; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable private String name; + + public static final String JSON_PROPERTY_DISTANCE_TYPE = "distance_type"; + @javax.annotation.Nullable private String distanceType; + + public static final String JSON_PROPERTY_WITH_POSITION = "with_position"; + @javax.annotation.Nullable private Boolean withPosition; + + public static final String JSON_PROPERTY_BASE_TOKENIZER = "base_tokenizer"; + @javax.annotation.Nullable private String baseTokenizer; + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + @javax.annotation.Nullable private String language; + + public static final String JSON_PROPERTY_MAX_TOKEN_LENGTH = "max_token_length"; + @javax.annotation.Nullable private Integer maxTokenLength; + + public static final String JSON_PROPERTY_LOWER_CASE = "lower_case"; + @javax.annotation.Nullable private Boolean lowerCase; + + public static final String JSON_PROPERTY_STEM = "stem"; + @javax.annotation.Nullable private Boolean stem; + + public static final String JSON_PROPERTY_REMOVE_STOP_WORDS = "remove_stop_words"; + @javax.annotation.Nullable private Boolean removeStopWords; + + public static final String JSON_PROPERTY_ASCII_FOLDING = "ascii_folding"; + @javax.annotation.Nullable private Boolean asciiFolding; + + public CreateTableIndexRequest() {} + + public CreateTableIndexRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CreateTableIndexRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CreateTableIndexRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CreateTableIndexRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CreateTableIndexRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CreateTableIndexRequest column(@javax.annotation.Nonnull String column) { + this.column = column; + return this; + } + + /** + * Name of the column to create index on + * + * @return column + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getColumn() { + return column; + } + + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setColumn(@javax.annotation.Nonnull String column) { + this.column = column; + } + + public CreateTableIndexRequest indexType(@javax.annotation.Nonnull String indexType) { + this.indexType = indexType; + return this; + } + + /** + * Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS) + * + * @return indexType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIndexType() { + return indexType; + } + + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndexType(@javax.annotation.Nonnull String indexType) { + this.indexType = indexType; + } + + public CreateTableIndexRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Optional name for the index. If not provided, a name will be auto-generated. + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + public CreateTableIndexRequest distanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + return this; + } + + /** + * Distance metric type for vector indexes (e.g., l2, cosine, dot) + * + * @return distanceType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDistanceType() { + return distanceType; + } + + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDistanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + } + + public CreateTableIndexRequest withPosition(@javax.annotation.Nullable Boolean withPosition) { + this.withPosition = withPosition; + return this; + } + + /** + * Optional FTS parameter for position tracking + * + * @return withPosition + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITH_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWithPosition() { + return withPosition; + } + + @JsonProperty(JSON_PROPERTY_WITH_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWithPosition(@javax.annotation.Nullable Boolean withPosition) { + this.withPosition = withPosition; + } + + public CreateTableIndexRequest baseTokenizer(@javax.annotation.Nullable String baseTokenizer) { + this.baseTokenizer = baseTokenizer; + return this; + } + + /** + * Optional FTS parameter for base tokenizer + * + * @return baseTokenizer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BASE_TOKENIZER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaseTokenizer() { + return baseTokenizer; + } + + @JsonProperty(JSON_PROPERTY_BASE_TOKENIZER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaseTokenizer(@javax.annotation.Nullable String baseTokenizer) { + this.baseTokenizer = baseTokenizer; + } + + public CreateTableIndexRequest language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Optional FTS parameter for language + * + * @return language + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + public CreateTableIndexRequest maxTokenLength(@javax.annotation.Nullable Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + return this; + } + + /** + * Optional FTS parameter for maximum token length minimum: 0 + * + * @return maxTokenLength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_TOKEN_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxTokenLength() { + return maxTokenLength; + } + + @JsonProperty(JSON_PROPERTY_MAX_TOKEN_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxTokenLength(@javax.annotation.Nullable Integer maxTokenLength) { + this.maxTokenLength = maxTokenLength; + } + + public CreateTableIndexRequest lowerCase(@javax.annotation.Nullable Boolean lowerCase) { + this.lowerCase = lowerCase; + return this; + } + + /** + * Optional FTS parameter for lowercase conversion + * + * @return lowerCase + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOWER_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLowerCase() { + return lowerCase; + } + + @JsonProperty(JSON_PROPERTY_LOWER_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLowerCase(@javax.annotation.Nullable Boolean lowerCase) { + this.lowerCase = lowerCase; + } + + public CreateTableIndexRequest stem(@javax.annotation.Nullable Boolean stem) { + this.stem = stem; + return this; + } + + /** + * Optional FTS parameter for stemming + * + * @return stem + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getStem() { + return stem; + } + + @JsonProperty(JSON_PROPERTY_STEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStem(@javax.annotation.Nullable Boolean stem) { + this.stem = stem; + } + + public CreateTableIndexRequest removeStopWords( + @javax.annotation.Nullable Boolean removeStopWords) { + this.removeStopWords = removeStopWords; + return this; + } + + /** + * Optional FTS parameter for stop word removal + * + * @return removeStopWords + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMOVE_STOP_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRemoveStopWords() { + return removeStopWords; + } + + @JsonProperty(JSON_PROPERTY_REMOVE_STOP_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoveStopWords(@javax.annotation.Nullable Boolean removeStopWords) { + this.removeStopWords = removeStopWords; + } + + public CreateTableIndexRequest asciiFolding(@javax.annotation.Nullable Boolean asciiFolding) { + this.asciiFolding = asciiFolding; + return this; + } + + /** + * Optional FTS parameter for ASCII folding + * + * @return asciiFolding + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASCII_FOLDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAsciiFolding() { + return asciiFolding; + } + + @JsonProperty(JSON_PROPERTY_ASCII_FOLDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAsciiFolding(@javax.annotation.Nullable Boolean asciiFolding) { + this.asciiFolding = asciiFolding; + } + + /** Return true if this CreateTableIndexRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableIndexRequest createTableIndexRequest = (CreateTableIndexRequest) o; + return Objects.equals(this.identity, createTableIndexRequest.identity) + && Objects.equals(this.context, createTableIndexRequest.context) + && Objects.equals(this.id, createTableIndexRequest.id) + && Objects.equals(this.column, createTableIndexRequest.column) + && Objects.equals(this.indexType, createTableIndexRequest.indexType) + && Objects.equals(this.name, createTableIndexRequest.name) + && Objects.equals(this.distanceType, createTableIndexRequest.distanceType) + && Objects.equals(this.withPosition, createTableIndexRequest.withPosition) + && Objects.equals(this.baseTokenizer, createTableIndexRequest.baseTokenizer) + && Objects.equals(this.language, createTableIndexRequest.language) + && Objects.equals(this.maxTokenLength, createTableIndexRequest.maxTokenLength) + && Objects.equals(this.lowerCase, createTableIndexRequest.lowerCase) + && Objects.equals(this.stem, createTableIndexRequest.stem) + && Objects.equals(this.removeStopWords, createTableIndexRequest.removeStopWords) + && Objects.equals(this.asciiFolding, createTableIndexRequest.asciiFolding); + } + + @Override + public int hashCode() { + return Objects.hash( + identity, + context, + id, + column, + indexType, + name, + distanceType, + withPosition, + baseTokenizer, + language, + maxTokenLength, + lowerCase, + stem, + removeStopWords, + asciiFolding); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableIndexRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" distanceType: ").append(toIndentedString(distanceType)).append("\n"); + sb.append(" withPosition: ").append(toIndentedString(withPosition)).append("\n"); + sb.append(" baseTokenizer: ").append(toIndentedString(baseTokenizer)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" maxTokenLength: ").append(toIndentedString(maxTokenLength)).append("\n"); + sb.append(" lowerCase: ").append(toIndentedString(lowerCase)).append("\n"); + sb.append(" stem: ").append(toIndentedString(stem)).append("\n"); + sb.append(" removeStopWords: ").append(toIndentedString(removeStopWords)).append("\n"); + sb.append(" asciiFolding: ").append(toIndentedString(asciiFolding)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `column` to the URL query string + if (getColumn() != null) { + joiner.add( + String.format( + "%scolumn%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getColumn())))); + } + + // add `index_type` to the URL query string + if (getIndexType() != null) { + joiner.add( + String.format( + "%sindex_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexType())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `distance_type` to the URL query string + if (getDistanceType() != null) { + joiner.add( + String.format( + "%sdistance_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDistanceType())))); + } + + // add `with_position` to the URL query string + if (getWithPosition() != null) { + joiner.add( + String.format( + "%swith_position%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWithPosition())))); + } + + // add `base_tokenizer` to the URL query string + if (getBaseTokenizer() != null) { + joiner.add( + String.format( + "%sbase_tokenizer%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBaseTokenizer())))); + } + + // add `language` to the URL query string + if (getLanguage() != null) { + joiner.add( + String.format( + "%slanguage%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLanguage())))); + } + + // add `max_token_length` to the URL query string + if (getMaxTokenLength() != null) { + joiner.add( + String.format( + "%smax_token_length%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaxTokenLength())))); + } + + // add `lower_case` to the URL query string + if (getLowerCase() != null) { + joiner.add( + String.format( + "%slower_case%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLowerCase())))); + } + + // add `stem` to the URL query string + if (getStem() != null) { + joiner.add( + String.format( + "%sstem%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStem())))); + } + + // add `remove_stop_words` to the URL query string + if (getRemoveStopWords() != null) { + joiner.add( + String.format( + "%sremove_stop_words%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRemoveStopWords())))); + } + + // add `ascii_folding` to the URL query string + if (getAsciiFolding() != null) { + joiner.add( + String.format( + "%sascii_folding%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAsciiFolding())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableIndexResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableIndexResponse.java new file mode 100644 index 000000000..3a9605697 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableIndexResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for create index operation */ +@JsonPropertyOrder({CreateTableIndexResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableIndexResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public CreateTableIndexResponse() {} + + public CreateTableIndexResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this CreateTableIndexResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableIndexResponse createTableIndexResponse = (CreateTableIndexResponse) o; + return Objects.equals(this.transactionId, createTableIndexResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableIndexResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java new file mode 100644 index 000000000..1ac36e1c5 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java @@ -0,0 +1,344 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Request for creating a table, excluding the Arrow IPC stream. */ +@JsonPropertyOrder({ + CreateTableRequest.JSON_PROPERTY_IDENTITY, + CreateTableRequest.JSON_PROPERTY_CONTEXT, + CreateTableRequest.JSON_PROPERTY_ID, + CreateTableRequest.JSON_PROPERTY_MODE, + CreateTableRequest.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateTableRequest() {} + + public CreateTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CreateTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CreateTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CreateTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CreateTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CreateTableRequest mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * There are three modes when trying to create a table, to differentiate the behavior when a table + * of the same name already exists. Case insensitive, supports both PascalCase and snake_case. + * Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and + * the existing table is kept. * Overwrite: the existing table is dropped and a new table with + * this name is created. + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + public CreateTableRequest properties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public CreateTableRequest putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the table, if supported by the implementation. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this CreateTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequest createTableRequest = (CreateTableRequest) o; + return Objects.equals(this.identity, createTableRequest.identity) + && Objects.equals(this.context, createTableRequest.context) + && Objects.equals(this.id, createTableRequest.id) + && Objects.equals(this.mode, createTableRequest.mode) + && Objects.equals(this.properties, createTableRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, mode, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java new file mode 100644 index 000000000..8c14aee11 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java @@ -0,0 +1,325 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CreateTableResponse */ +@JsonPropertyOrder({ + CreateTableResponse.JSON_PROPERTY_TRANSACTION_ID, + CreateTableResponse.JSON_PROPERTY_LOCATION, + CreateTableResponse.JSON_PROPERTY_VERSION, + CreateTableResponse.JSON_PROPERTY_STORAGE_OPTIONS, + CreateTableResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; + @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateTableResponse() {} + + public CreateTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public CreateTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public CreateTableResponse version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Get version minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public CreateTableResponse storageOptions( + @javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + return this; + } + + public CreateTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Configuration options to be used to access storage. The available options depend on the type of + * storage in use. These will be passed directly to Lance to initialize storage access. + * + * @return storageOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getStorageOptions() { + return storageOptions; + } + + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + } + + public CreateTableResponse properties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public CreateTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this CreateTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableResponse createTableResponse = (CreateTableResponse) o; + return Objects.equals(this.transactionId, createTableResponse.transactionId) + && Objects.equals(this.location, createTableResponse.location) + && Objects.equals(this.version, createTableResponse.version) + && Objects.equals(this.storageOptions, createTableResponse.storageOptions) + && Objects.equals(this.properties, createTableResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, location, version, storageOptions, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `storage_options` to the URL query string + if (getStorageOptions() != null) { + for (String _key : getStorageOptions().keySet()) { + joiner.add( + String.format( + "%sstorage_options%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getStorageOptions().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getStorageOptions().get(_key))))); + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableScalarIndexResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableScalarIndexResponse.java new file mode 100644 index 000000000..9b63d5b06 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableScalarIndexResponse.java @@ -0,0 +1,140 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for create scalar index operation */ +@JsonPropertyOrder({CreateTableScalarIndexResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableScalarIndexResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public CreateTableScalarIndexResponse() {} + + public CreateTableScalarIndexResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this CreateTableScalarIndexResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableScalarIndexResponse createTableScalarIndexResponse = + (CreateTableScalarIndexResponse) o; + return Objects.equals(this.transactionId, createTableScalarIndexResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableScalarIndexResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableTagRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableTagRequest.java new file mode 100644 index 000000000..4ed236ee2 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableTagRequest.java @@ -0,0 +1,324 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CreateTableTagRequest */ +@JsonPropertyOrder({ + CreateTableTagRequest.JSON_PROPERTY_IDENTITY, + CreateTableTagRequest.JSON_PROPERTY_CONTEXT, + CreateTableTagRequest.JSON_PROPERTY_ID, + CreateTableTagRequest.JSON_PROPERTY_TAG, + CreateTableTagRequest.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableTagRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAG = "tag"; + @javax.annotation.Nonnull private String tag; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public CreateTableTagRequest() {} + + public CreateTableTagRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CreateTableTagRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CreateTableTagRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CreateTableTagRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CreateTableTagRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CreateTableTagRequest tag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + return this; + } + + /** + * Name of the tag to create + * + * @return tag + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTag() { + return tag; + } + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + } + + public CreateTableTagRequest version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version number for the tag to point to minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this CreateTableTagRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableTagRequest createTableTagRequest = (CreateTableTagRequest) o; + return Objects.equals(this.identity, createTableTagRequest.identity) + && Objects.equals(this.context, createTableTagRequest.context) + && Objects.equals(this.id, createTableTagRequest.id) + && Objects.equals(this.tag, createTableTagRequest.tag) + && Objects.equals(this.version, createTableTagRequest.version); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, tag, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableTagRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + joiner.add( + String.format( + "%stag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTag())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableTagResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableTagResponse.java new file mode 100644 index 000000000..f44d72205 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableTagResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for create tag operation */ +@JsonPropertyOrder({CreateTableTagResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableTagResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public CreateTableTagResponse() {} + + public CreateTableTagResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this CreateTableTagResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableTagResponse createTableTagResponse = (CreateTableTagResponse) o; + return Objects.equals(this.transactionId, createTableTagResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableTagResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionEntry.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionEntry.java new file mode 100644 index 000000000..cea3b0186 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionEntry.java @@ -0,0 +1,405 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * An entry for creating a new table version in a batch operation. This supports + * `put_if_not_exists` semantics, where the operation fails if the version already exists. + */ +@JsonPropertyOrder({ + CreateTableVersionEntry.JSON_PROPERTY_ID, + CreateTableVersionEntry.JSON_PROPERTY_VERSION, + CreateTableVersionEntry.JSON_PROPERTY_MANIFEST_PATH, + CreateTableVersionEntry.JSON_PROPERTY_MANIFEST_SIZE, + CreateTableVersionEntry.JSON_PROPERTY_E_TAG, + CreateTableVersionEntry.JSON_PROPERTY_METADATA, + CreateTableVersionEntry.JSON_PROPERTY_NAMING_SCHEME +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableVersionEntry { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public static final String JSON_PROPERTY_MANIFEST_PATH = "manifest_path"; + @javax.annotation.Nonnull private String manifestPath; + + public static final String JSON_PROPERTY_MANIFEST_SIZE = "manifest_size"; + @javax.annotation.Nullable private Long manifestSize; + + public static final String JSON_PROPERTY_E_TAG = "e_tag"; + @javax.annotation.Nullable private String eTag; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_NAMING_SCHEME = "naming_scheme"; + @javax.annotation.Nullable private String namingScheme; + + public CreateTableVersionEntry() {} + + public CreateTableVersionEntry id(@javax.annotation.Nonnull List id) { + this.id = id; + return this; + } + + public CreateTableVersionEntry addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull List id) { + this.id = id; + } + + public CreateTableVersionEntry version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version number to create minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + public CreateTableVersionEntry manifestPath(@javax.annotation.Nonnull String manifestPath) { + this.manifestPath = manifestPath; + return this; + } + + /** + * Path to the manifest file for this version + * + * @return manifestPath + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MANIFEST_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getManifestPath() { + return manifestPath; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setManifestPath(@javax.annotation.Nonnull String manifestPath) { + this.manifestPath = manifestPath; + } + + public CreateTableVersionEntry manifestSize(@javax.annotation.Nullable Long manifestSize) { + this.manifestSize = manifestSize; + return this; + } + + /** + * Size of the manifest file in bytes minimum: 0 + * + * @return manifestSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getManifestSize() { + return manifestSize; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManifestSize(@javax.annotation.Nullable Long manifestSize) { + this.manifestSize = manifestSize; + } + + public CreateTableVersionEntry eTag(@javax.annotation.Nullable String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Optional ETag for the manifest file + * + * @return eTag + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_E_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String geteTag() { + return eTag; + } + + @JsonProperty(JSON_PROPERTY_E_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void seteTag(@javax.annotation.Nullable String eTag) { + this.eTag = eTag; + } + + public CreateTableVersionEntry metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public CreateTableVersionEntry putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Optional metadata for the version + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + public CreateTableVersionEntry namingScheme(@javax.annotation.Nullable String namingScheme) { + this.namingScheme = namingScheme; + return this; + } + + /** + * The naming scheme used for manifest files in the `_versions/` directory. Known + * values: - `V1`: `_versions/{version}.manifest` - Simple version-based + * naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, + * reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version + * on object stores V2 is preferred for new tables as it enables efficient latest-version + * discovery without needing to list all versions. + * + * @return namingScheme + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMING_SCHEME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamingScheme() { + return namingScheme; + } + + @JsonProperty(JSON_PROPERTY_NAMING_SCHEME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamingScheme(@javax.annotation.Nullable String namingScheme) { + this.namingScheme = namingScheme; + } + + /** Return true if this CreateTableVersionEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableVersionEntry createTableVersionEntry = (CreateTableVersionEntry) o; + return Objects.equals(this.id, createTableVersionEntry.id) + && Objects.equals(this.version, createTableVersionEntry.version) + && Objects.equals(this.manifestPath, createTableVersionEntry.manifestPath) + && Objects.equals(this.manifestSize, createTableVersionEntry.manifestSize) + && Objects.equals(this.eTag, createTableVersionEntry.eTag) + && Objects.equals(this.metadata, createTableVersionEntry.metadata) + && Objects.equals(this.namingScheme, createTableVersionEntry.namingScheme); + } + + @Override + public int hashCode() { + return Objects.hash(id, version, manifestPath, manifestSize, eTag, metadata, namingScheme); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableVersionEntry {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" manifestPath: ").append(toIndentedString(manifestPath)).append("\n"); + sb.append(" manifestSize: ").append(toIndentedString(manifestSize)).append("\n"); + sb.append(" eTag: ").append(toIndentedString(eTag)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" namingScheme: ").append(toIndentedString(namingScheme)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `manifest_path` to the URL query string + if (getManifestPath() != null) { + joiner.add( + String.format( + "%smanifest_path%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestPath())))); + } + + // add `manifest_size` to the URL query string + if (getManifestSize() != null) { + joiner.add( + String.format( + "%smanifest_size%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestSize())))); + } + + // add `e_tag` to the URL query string + if (geteTag() != null) { + joiner.add( + String.format( + "%se_tag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(geteTag())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + // add `naming_scheme` to the URL query string + if (getNamingScheme() != null) { + joiner.add( + String.format( + "%snaming_scheme%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNamingScheme())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionRequest.java new file mode 100644 index 000000000..39bf38a1f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionRequest.java @@ -0,0 +1,498 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Request to create a new table version entry. This supports `put_if_not_exists` + * semantics, where the operation fails if the version already exists. + */ +@JsonPropertyOrder({ + CreateTableVersionRequest.JSON_PROPERTY_IDENTITY, + CreateTableVersionRequest.JSON_PROPERTY_CONTEXT, + CreateTableVersionRequest.JSON_PROPERTY_ID, + CreateTableVersionRequest.JSON_PROPERTY_VERSION, + CreateTableVersionRequest.JSON_PROPERTY_MANIFEST_PATH, + CreateTableVersionRequest.JSON_PROPERTY_MANIFEST_SIZE, + CreateTableVersionRequest.JSON_PROPERTY_E_TAG, + CreateTableVersionRequest.JSON_PROPERTY_METADATA, + CreateTableVersionRequest.JSON_PROPERTY_NAMING_SCHEME +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableVersionRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public static final String JSON_PROPERTY_MANIFEST_PATH = "manifest_path"; + @javax.annotation.Nonnull private String manifestPath; + + public static final String JSON_PROPERTY_MANIFEST_SIZE = "manifest_size"; + @javax.annotation.Nullable private Long manifestSize; + + public static final String JSON_PROPERTY_E_TAG = "e_tag"; + @javax.annotation.Nullable private String eTag; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_NAMING_SCHEME = "naming_scheme"; + @javax.annotation.Nullable private String namingScheme; + + public CreateTableVersionRequest() {} + + public CreateTableVersionRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public CreateTableVersionRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public CreateTableVersionRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public CreateTableVersionRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public CreateTableVersionRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public CreateTableVersionRequest version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version number to create minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + public CreateTableVersionRequest manifestPath(@javax.annotation.Nonnull String manifestPath) { + this.manifestPath = manifestPath; + return this; + } + + /** + * Path to the manifest file for this version + * + * @return manifestPath + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MANIFEST_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getManifestPath() { + return manifestPath; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setManifestPath(@javax.annotation.Nonnull String manifestPath) { + this.manifestPath = manifestPath; + } + + public CreateTableVersionRequest manifestSize(@javax.annotation.Nullable Long manifestSize) { + this.manifestSize = manifestSize; + return this; + } + + /** + * Size of the manifest file in bytes minimum: 0 + * + * @return manifestSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getManifestSize() { + return manifestSize; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManifestSize(@javax.annotation.Nullable Long manifestSize) { + this.manifestSize = manifestSize; + } + + public CreateTableVersionRequest eTag(@javax.annotation.Nullable String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Optional ETag for the manifest file + * + * @return eTag + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_E_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String geteTag() { + return eTag; + } + + @JsonProperty(JSON_PROPERTY_E_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void seteTag(@javax.annotation.Nullable String eTag) { + this.eTag = eTag; + } + + public CreateTableVersionRequest metadata( + @javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public CreateTableVersionRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Optional metadata for the version + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + public CreateTableVersionRequest namingScheme(@javax.annotation.Nullable String namingScheme) { + this.namingScheme = namingScheme; + return this; + } + + /** + * The naming scheme used for manifest files in the `_versions/` directory. Known + * values: - `V1`: `_versions/{version}.manifest` - Simple version-based + * naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, + * reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version + * on object stores V2 is preferred for new tables as it enables efficient latest-version + * discovery without needing to list all versions. + * + * @return namingScheme + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMING_SCHEME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamingScheme() { + return namingScheme; + } + + @JsonProperty(JSON_PROPERTY_NAMING_SCHEME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamingScheme(@javax.annotation.Nullable String namingScheme) { + this.namingScheme = namingScheme; + } + + /** Return true if this CreateTableVersionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableVersionRequest createTableVersionRequest = (CreateTableVersionRequest) o; + return Objects.equals(this.identity, createTableVersionRequest.identity) + && Objects.equals(this.context, createTableVersionRequest.context) + && Objects.equals(this.id, createTableVersionRequest.id) + && Objects.equals(this.version, createTableVersionRequest.version) + && Objects.equals(this.manifestPath, createTableVersionRequest.manifestPath) + && Objects.equals(this.manifestSize, createTableVersionRequest.manifestSize) + && Objects.equals(this.eTag, createTableVersionRequest.eTag) + && Objects.equals(this.metadata, createTableVersionRequest.metadata) + && Objects.equals(this.namingScheme, createTableVersionRequest.namingScheme); + } + + @Override + public int hashCode() { + return Objects.hash( + identity, context, id, version, manifestPath, manifestSize, eTag, metadata, namingScheme); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableVersionRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" manifestPath: ").append(toIndentedString(manifestPath)).append("\n"); + sb.append(" manifestSize: ").append(toIndentedString(manifestSize)).append("\n"); + sb.append(" eTag: ").append(toIndentedString(eTag)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" namingScheme: ").append(toIndentedString(namingScheme)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `manifest_path` to the URL query string + if (getManifestPath() != null) { + joiner.add( + String.format( + "%smanifest_path%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestPath())))); + } + + // add `manifest_size` to the URL query string + if (getManifestSize() != null) { + joiner.add( + String.format( + "%smanifest_size%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestSize())))); + } + + // add `e_tag` to the URL query string + if (geteTag() != null) { + joiner.add( + String.format( + "%se_tag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(geteTag())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + // add `naming_scheme` to the URL query string + if (getNamingScheme() != null) { + joiner.add( + String.format( + "%snaming_scheme%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNamingScheme())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionResponse.java new file mode 100644 index 000000000..6eb1d448e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableVersionResponse.java @@ -0,0 +1,174 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for creating a table version */ +@JsonPropertyOrder({ + CreateTableVersionResponse.JSON_PROPERTY_TRANSACTION_ID, + CreateTableVersionResponse.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateTableVersionResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private TableVersion version; + + public CreateTableVersionResponse() {} + + public CreateTableVersionResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public CreateTableVersionResponse version(@javax.annotation.Nullable TableVersion version) { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableVersion getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable TableVersion version) { + this.version = version; + } + + /** Return true if this CreateTableVersionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableVersionResponse createTableVersionResponse = (CreateTableVersionResponse) o; + return Objects.equals(this.transactionId, createTableVersionResponse.transactionId) + && Objects.equals(this.version, createTableVersionResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTableVersionResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add(getVersion().toUrlQueryString(prefix + "version" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java new file mode 100644 index 000000000..85cc627e6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java @@ -0,0 +1,380 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Request for declaring a table. */ +@JsonPropertyOrder({ + DeclareTableRequest.JSON_PROPERTY_IDENTITY, + DeclareTableRequest.JSON_PROPERTY_CONTEXT, + DeclareTableRequest.JSON_PROPERTY_ID, + DeclareTableRequest.JSON_PROPERTY_LOCATION, + DeclareTableRequest.JSON_PROPERTY_VEND_CREDENTIALS, + DeclareTableRequest.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeclareTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_VEND_CREDENTIALS = "vend_credentials"; + @javax.annotation.Nullable private Boolean vendCredentials; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public DeclareTableRequest() {} + + public DeclareTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DeclareTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DeclareTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DeclareTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DeclareTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DeclareTableRequest location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Optional storage location for the table. If not provided, the namespace implementation should + * determine the table location. + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public DeclareTableRequest vendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { + this.vendCredentials = vendCredentials; + return this; + } + + /** + * Whether to include vended credentials in the response `storage_options`. When true, + * the implementation should provide vended credentials for accessing storage. When not set, the + * implementation can decide whether to return vended credentials. + * + * @return vendCredentials + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVendCredentials() { + return vendCredentials; + } + + @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { + this.vendCredentials = vendCredentials; + } + + public DeclareTableRequest properties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DeclareTableRequest putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the table, if supported by the server. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this DeclareTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeclareTableRequest declareTableRequest = (DeclareTableRequest) o; + return Objects.equals(this.identity, declareTableRequest.identity) + && Objects.equals(this.context, declareTableRequest.context) + && Objects.equals(this.id, declareTableRequest.id) + && Objects.equals(this.location, declareTableRequest.location) + && Objects.equals(this.vendCredentials, declareTableRequest.vendCredentials) + && Objects.equals(this.properties, declareTableRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, location, vendCredentials, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeclareTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" vendCredentials: ").append(toIndentedString(vendCredentials)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `vend_credentials` to the URL query string + if (getVendCredentials() != null) { + joiner.add( + String.format( + "%svend_credentials%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVendCredentials())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableResponse.java new file mode 100644 index 000000000..cc6fcc531 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableResponse.java @@ -0,0 +1,331 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for declaring a table. */ +@JsonPropertyOrder({ + DeclareTableResponse.JSON_PROPERTY_TRANSACTION_ID, + DeclareTableResponse.JSON_PROPERTY_LOCATION, + DeclareTableResponse.JSON_PROPERTY_STORAGE_OPTIONS, + DeclareTableResponse.JSON_PROPERTY_PROPERTIES, + DeclareTableResponse.JSON_PROPERTY_MANAGED_VERSIONING +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeclareTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; + @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public static final String JSON_PROPERTY_MANAGED_VERSIONING = "managed_versioning"; + @javax.annotation.Nullable private Boolean managedVersioning; + + public DeclareTableResponse() {} + + public DeclareTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public DeclareTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public DeclareTableResponse storageOptions( + @javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + return this; + } + + public DeclareTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Configuration options to be used to access storage. The available options depend on the type of + * storage in use. These will be passed directly to Lance to initialize storage access. + * + * @return storageOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getStorageOptions() { + return storageOptions; + } + + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + } + + public DeclareTableResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DeclareTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + public DeclareTableResponse managedVersioning( + @javax.annotation.Nullable Boolean managedVersioning) { + this.managedVersioning = managedVersioning; + return this; + } + + /** + * When true, the caller should use namespace table version operations (CreateTableVersion, + * BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) to + * manage table versions instead of relying on Lance's native version management. + * + * @return managedVersioning + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANAGED_VERSIONING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getManagedVersioning() { + return managedVersioning; + } + + @JsonProperty(JSON_PROPERTY_MANAGED_VERSIONING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManagedVersioning(@javax.annotation.Nullable Boolean managedVersioning) { + this.managedVersioning = managedVersioning; + } + + /** Return true if this DeclareTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeclareTableResponse declareTableResponse = (DeclareTableResponse) o; + return Objects.equals(this.transactionId, declareTableResponse.transactionId) + && Objects.equals(this.location, declareTableResponse.location) + && Objects.equals(this.storageOptions, declareTableResponse.storageOptions) + && Objects.equals(this.properties, declareTableResponse.properties) + && Objects.equals(this.managedVersioning, declareTableResponse.managedVersioning); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, location, storageOptions, properties, managedVersioning); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeclareTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" managedVersioning: ").append(toIndentedString(managedVersioning)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `storage_options` to the URL query string + if (getStorageOptions() != null) { + for (String _key : getStorageOptions().keySet()) { + joiner.add( + String.format( + "%sstorage_options%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getStorageOptions().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getStorageOptions().get(_key))))); + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + // add `managed_versioning` to the URL query string + if (getManagedVersioning() != null) { + joiner.add( + String.format( + "%smanaged_versioning%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getManagedVersioning())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteFromTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteFromTableRequest.java new file mode 100644 index 000000000..ad9c8721f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteFromTableRequest.java @@ -0,0 +1,289 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Delete data from table based on a SQL predicate. Returns the number of rows that were deleted. + */ +@JsonPropertyOrder({ + DeleteFromTableRequest.JSON_PROPERTY_IDENTITY, + DeleteFromTableRequest.JSON_PROPERTY_CONTEXT, + DeleteFromTableRequest.JSON_PROPERTY_ID, + DeleteFromTableRequest.JSON_PROPERTY_PREDICATE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeleteFromTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_PREDICATE = "predicate"; + @javax.annotation.Nonnull private String predicate; + + public DeleteFromTableRequest() {} + + public DeleteFromTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DeleteFromTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DeleteFromTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DeleteFromTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DeleteFromTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The namespace identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DeleteFromTableRequest predicate(@javax.annotation.Nonnull String predicate) { + this.predicate = predicate; + return this; + } + + /** + * SQL predicate to filter rows for deletion + * + * @return predicate + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PREDICATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPredicate() { + return predicate; + } + + @JsonProperty(JSON_PROPERTY_PREDICATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPredicate(@javax.annotation.Nonnull String predicate) { + this.predicate = predicate; + } + + /** Return true if this DeleteFromTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteFromTableRequest deleteFromTableRequest = (DeleteFromTableRequest) o; + return Objects.equals(this.identity, deleteFromTableRequest.identity) + && Objects.equals(this.context, deleteFromTableRequest.context) + && Objects.equals(this.id, deleteFromTableRequest.id) + && Objects.equals(this.predicate, deleteFromTableRequest.predicate); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, predicate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteFromTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" predicate: ").append(toIndentedString(predicate)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `predicate` to the URL query string + if (getPredicate() != null) { + joiner.add( + String.format( + "%spredicate%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPredicate())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteFromTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteFromTableResponse.java new file mode 100644 index 000000000..5e823a9ae --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteFromTableResponse.java @@ -0,0 +1,177 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** DeleteFromTableResponse */ +@JsonPropertyOrder({ + DeleteFromTableResponse.JSON_PROPERTY_TRANSACTION_ID, + DeleteFromTableResponse.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeleteFromTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public DeleteFromTableResponse() {} + + public DeleteFromTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public DeleteFromTableResponse version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * The commit version associated with the operation minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + /** Return true if this DeleteFromTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteFromTableResponse deleteFromTableResponse = (DeleteFromTableResponse) o; + return Objects.equals(this.transactionId, deleteFromTableResponse.transactionId) + && Objects.equals(this.version, deleteFromTableResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteFromTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteTableTagRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteTableTagRequest.java new file mode 100644 index 000000000..12f3121b0 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteTableTagRequest.java @@ -0,0 +1,287 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DeleteTableTagRequest */ +@JsonPropertyOrder({ + DeleteTableTagRequest.JSON_PROPERTY_IDENTITY, + DeleteTableTagRequest.JSON_PROPERTY_CONTEXT, + DeleteTableTagRequest.JSON_PROPERTY_ID, + DeleteTableTagRequest.JSON_PROPERTY_TAG +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeleteTableTagRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAG = "tag"; + @javax.annotation.Nonnull private String tag; + + public DeleteTableTagRequest() {} + + public DeleteTableTagRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DeleteTableTagRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DeleteTableTagRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DeleteTableTagRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DeleteTableTagRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DeleteTableTagRequest tag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + return this; + } + + /** + * Name of the tag to delete + * + * @return tag + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTag() { + return tag; + } + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + } + + /** Return true if this DeleteTableTagRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTableTagRequest deleteTableTagRequest = (DeleteTableTagRequest) o; + return Objects.equals(this.identity, deleteTableTagRequest.identity) + && Objects.equals(this.context, deleteTableTagRequest.context) + && Objects.equals(this.id, deleteTableTagRequest.id) + && Objects.equals(this.tag, deleteTableTagRequest.tag); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, tag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTableTagRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + joiner.add( + String.format( + "%stag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTag())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteTableTagResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteTableTagResponse.java new file mode 100644 index 000000000..32905456f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeleteTableTagResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for delete tag operation */ +@JsonPropertyOrder({DeleteTableTagResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeleteTableTagResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public DeleteTableTagResponse() {} + + public DeleteTableTagResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this DeleteTableTagResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTableTagResponse deleteTableTagResponse = (DeleteTableTagResponse) o; + return Objects.equals(this.transactionId, deleteTableTagResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTableTagResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeregisterTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeregisterTableRequest.java new file mode 100644 index 000000000..bf8f62ef3 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeregisterTableRequest.java @@ -0,0 +1,250 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** The table content remains available in the storage. */ +@JsonPropertyOrder({ + DeregisterTableRequest.JSON_PROPERTY_IDENTITY, + DeregisterTableRequest.JSON_PROPERTY_CONTEXT, + DeregisterTableRequest.JSON_PROPERTY_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeregisterTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public DeregisterTableRequest() {} + + public DeregisterTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DeregisterTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DeregisterTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DeregisterTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DeregisterTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + /** Return true if this DeregisterTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeregisterTableRequest deregisterTableRequest = (DeregisterTableRequest) o; + return Objects.equals(this.identity, deregisterTableRequest.identity) + && Objects.equals(this.context, deregisterTableRequest.context) + && Objects.equals(this.id, deregisterTableRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeregisterTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeregisterTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeregisterTableResponse.java new file mode 100644 index 000000000..fa5b6070d --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeregisterTableResponse.java @@ -0,0 +1,288 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DeregisterTableResponse */ +@JsonPropertyOrder({ + DeregisterTableResponse.JSON_PROPERTY_TRANSACTION_ID, + DeregisterTableResponse.JSON_PROPERTY_ID, + DeregisterTableResponse.JSON_PROPERTY_LOCATION, + DeregisterTableResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DeregisterTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public DeregisterTableResponse() {} + + public DeregisterTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public DeregisterTableResponse id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DeregisterTableResponse addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DeregisterTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public DeregisterTableResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DeregisterTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this DeregisterTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeregisterTableResponse deregisterTableResponse = (DeregisterTableResponse) o; + return Objects.equals(this.transactionId, deregisterTableResponse.transactionId) + && Objects.equals(this.id, deregisterTableResponse.id) + && Objects.equals(this.location, deregisterTableResponse.location) + && Objects.equals(this.properties, deregisterTableResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, id, location, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeregisterTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeNamespaceRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeNamespaceRequest.java new file mode 100644 index 000000000..47dc696ae --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeNamespaceRequest.java @@ -0,0 +1,250 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeNamespaceRequest */ +@JsonPropertyOrder({ + DescribeNamespaceRequest.JSON_PROPERTY_IDENTITY, + DescribeNamespaceRequest.JSON_PROPERTY_CONTEXT, + DescribeNamespaceRequest.JSON_PROPERTY_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeNamespaceRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public DescribeNamespaceRequest() {} + + public DescribeNamespaceRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DescribeNamespaceRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DescribeNamespaceRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DescribeNamespaceRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DescribeNamespaceRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + /** Return true if this DescribeNamespaceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeNamespaceRequest describeNamespaceRequest = (DescribeNamespaceRequest) o; + return Objects.equals(this.identity, describeNamespaceRequest.identity) + && Objects.equals(this.context, describeNamespaceRequest.context) + && Objects.equals(this.id, describeNamespaceRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeNamespaceRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeNamespaceResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeNamespaceResponse.java new file mode 100644 index 000000000..bce4acc8b --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeNamespaceResponse.java @@ -0,0 +1,159 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeNamespaceResponse */ +@JsonPropertyOrder({DescribeNamespaceResponse.JSON_PROPERTY_PROPERTIES}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeNamespaceResponse { + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public DescribeNamespaceResponse() {} + + public DescribeNamespaceResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DescribeNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the namespace, if supported by the server. If the server does not support + * namespace properties, it should return null for this field. If namespace properties are + * supported, but none are set, it should return an empty object. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this DescribeNamespaceResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeNamespaceResponse describeNamespaceResponse = (DescribeNamespaceResponse) o; + return Objects.equals(this.properties, describeNamespaceResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeNamespaceResponse {\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableIndexStatsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableIndexStatsRequest.java new file mode 100644 index 000000000..bc98ff3e8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableIndexStatsRequest.java @@ -0,0 +1,326 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeTableIndexStatsRequest */ +@JsonPropertyOrder({ + DescribeTableIndexStatsRequest.JSON_PROPERTY_IDENTITY, + DescribeTableIndexStatsRequest.JSON_PROPERTY_CONTEXT, + DescribeTableIndexStatsRequest.JSON_PROPERTY_ID, + DescribeTableIndexStatsRequest.JSON_PROPERTY_VERSION, + DescribeTableIndexStatsRequest.JSON_PROPERTY_INDEX_NAME +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTableIndexStatsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_INDEX_NAME = "index_name"; + @javax.annotation.Nullable private String indexName; + + public DescribeTableIndexStatsRequest() {} + + public DescribeTableIndexStatsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DescribeTableIndexStatsRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DescribeTableIndexStatsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DescribeTableIndexStatsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DescribeTableIndexStatsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DescribeTableIndexStatsRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Optional table version to get stats for minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public DescribeTableIndexStatsRequest indexName(@javax.annotation.Nullable String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Name of the index + * + * @return indexName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexName() { + return indexName; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexName(@javax.annotation.Nullable String indexName) { + this.indexName = indexName; + } + + /** Return true if this DescribeTableIndexStatsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTableIndexStatsRequest describeTableIndexStatsRequest = + (DescribeTableIndexStatsRequest) o; + return Objects.equals(this.identity, describeTableIndexStatsRequest.identity) + && Objects.equals(this.context, describeTableIndexStatsRequest.context) + && Objects.equals(this.id, describeTableIndexStatsRequest.id) + && Objects.equals(this.version, describeTableIndexStatsRequest.version) + && Objects.equals(this.indexName, describeTableIndexStatsRequest.indexName); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, version, indexName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTableIndexStatsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" indexName: ").append(toIndentedString(indexName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `index_name` to the URL query string + if (getIndexName() != null) { + joiner.add( + String.format( + "%sindex_name%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexName())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableIndexStatsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableIndexStatsResponse.java new file mode 100644 index 000000000..66d9b5ac1 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableIndexStatsResponse.java @@ -0,0 +1,292 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeTableIndexStatsResponse */ +@JsonPropertyOrder({ + DescribeTableIndexStatsResponse.JSON_PROPERTY_DISTANCE_TYPE, + DescribeTableIndexStatsResponse.JSON_PROPERTY_INDEX_TYPE, + DescribeTableIndexStatsResponse.JSON_PROPERTY_NUM_INDEXED_ROWS, + DescribeTableIndexStatsResponse.JSON_PROPERTY_NUM_UNINDEXED_ROWS, + DescribeTableIndexStatsResponse.JSON_PROPERTY_NUM_INDICES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTableIndexStatsResponse { + public static final String JSON_PROPERTY_DISTANCE_TYPE = "distance_type"; + @javax.annotation.Nullable private String distanceType; + + public static final String JSON_PROPERTY_INDEX_TYPE = "index_type"; + @javax.annotation.Nullable private String indexType; + + public static final String JSON_PROPERTY_NUM_INDEXED_ROWS = "num_indexed_rows"; + @javax.annotation.Nullable private Long numIndexedRows; + + public static final String JSON_PROPERTY_NUM_UNINDEXED_ROWS = "num_unindexed_rows"; + @javax.annotation.Nullable private Long numUnindexedRows; + + public static final String JSON_PROPERTY_NUM_INDICES = "num_indices"; + @javax.annotation.Nullable private Integer numIndices; + + public DescribeTableIndexStatsResponse() {} + + public DescribeTableIndexStatsResponse distanceType( + @javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + return this; + } + + /** + * Distance type for vector indexes + * + * @return distanceType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDistanceType() { + return distanceType; + } + + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDistanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + } + + public DescribeTableIndexStatsResponse indexType(@javax.annotation.Nullable String indexType) { + this.indexType = indexType; + return this; + } + + /** + * Type of the index + * + * @return indexType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexType() { + return indexType; + } + + @JsonProperty(JSON_PROPERTY_INDEX_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexType(@javax.annotation.Nullable String indexType) { + this.indexType = indexType; + } + + public DescribeTableIndexStatsResponse numIndexedRows( + @javax.annotation.Nullable Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + return this; + } + + /** + * Number of indexed rows minimum: 0 + * + * @return numIndexedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_INDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumIndexedRows() { + return numIndexedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_INDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumIndexedRows(@javax.annotation.Nullable Long numIndexedRows) { + this.numIndexedRows = numIndexedRows; + } + + public DescribeTableIndexStatsResponse numUnindexedRows( + @javax.annotation.Nullable Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + return this; + } + + /** + * Number of unindexed rows minimum: 0 + * + * @return numUnindexedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_UNINDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumUnindexedRows() { + return numUnindexedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_UNINDEXED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumUnindexedRows(@javax.annotation.Nullable Long numUnindexedRows) { + this.numUnindexedRows = numUnindexedRows; + } + + public DescribeTableIndexStatsResponse numIndices(@javax.annotation.Nullable Integer numIndices) { + this.numIndices = numIndices; + return this; + } + + /** + * Number of indices minimum: 0 + * + * @return numIndices + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_INDICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumIndices() { + return numIndices; + } + + @JsonProperty(JSON_PROPERTY_NUM_INDICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumIndices(@javax.annotation.Nullable Integer numIndices) { + this.numIndices = numIndices; + } + + /** Return true if this DescribeTableIndexStatsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTableIndexStatsResponse describeTableIndexStatsResponse = + (DescribeTableIndexStatsResponse) o; + return Objects.equals(this.distanceType, describeTableIndexStatsResponse.distanceType) + && Objects.equals(this.indexType, describeTableIndexStatsResponse.indexType) + && Objects.equals(this.numIndexedRows, describeTableIndexStatsResponse.numIndexedRows) + && Objects.equals(this.numUnindexedRows, describeTableIndexStatsResponse.numUnindexedRows) + && Objects.equals(this.numIndices, describeTableIndexStatsResponse.numIndices); + } + + @Override + public int hashCode() { + return Objects.hash(distanceType, indexType, numIndexedRows, numUnindexedRows, numIndices); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTableIndexStatsResponse {\n"); + sb.append(" distanceType: ").append(toIndentedString(distanceType)).append("\n"); + sb.append(" indexType: ").append(toIndentedString(indexType)).append("\n"); + sb.append(" numIndexedRows: ").append(toIndentedString(numIndexedRows)).append("\n"); + sb.append(" numUnindexedRows: ").append(toIndentedString(numUnindexedRows)).append("\n"); + sb.append(" numIndices: ").append(toIndentedString(numIndices)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `distance_type` to the URL query string + if (getDistanceType() != null) { + joiner.add( + String.format( + "%sdistance_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDistanceType())))); + } + + // add `index_type` to the URL query string + if (getIndexType() != null) { + joiner.add( + String.format( + "%sindex_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexType())))); + } + + // add `num_indexed_rows` to the URL query string + if (getNumIndexedRows() != null) { + joiner.add( + String.format( + "%snum_indexed_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumIndexedRows())))); + } + + // add `num_unindexed_rows` to the URL query string + if (getNumUnindexedRows() != null) { + joiner.add( + String.format( + "%snum_unindexed_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumUnindexedRows())))); + } + + // add `num_indices` to the URL query string + if (getNumIndices() != null) { + joiner.add( + String.format( + "%snum_indices%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumIndices())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableRequest.java new file mode 100644 index 000000000..6bbf52cc6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableRequest.java @@ -0,0 +1,410 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeTableRequest */ +@JsonPropertyOrder({ + DescribeTableRequest.JSON_PROPERTY_IDENTITY, + DescribeTableRequest.JSON_PROPERTY_CONTEXT, + DescribeTableRequest.JSON_PROPERTY_ID, + DescribeTableRequest.JSON_PROPERTY_VERSION, + DescribeTableRequest.JSON_PROPERTY_WITH_TABLE_URI, + DescribeTableRequest.JSON_PROPERTY_LOAD_DETAILED_METADATA, + DescribeTableRequest.JSON_PROPERTY_VEND_CREDENTIALS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_WITH_TABLE_URI = "with_table_uri"; + @javax.annotation.Nullable private Boolean withTableUri = false; + + public static final String JSON_PROPERTY_LOAD_DETAILED_METADATA = "load_detailed_metadata"; + @javax.annotation.Nullable private Boolean loadDetailedMetadata; + + public static final String JSON_PROPERTY_VEND_CREDENTIALS = "vend_credentials"; + @javax.annotation.Nullable private Boolean vendCredentials; + + public DescribeTableRequest() {} + + public DescribeTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DescribeTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DescribeTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DescribeTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DescribeTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DescribeTableRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Version of the table to describe. If not specified, server should resolve it to the latest + * version. minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public DescribeTableRequest withTableUri(@javax.annotation.Nullable Boolean withTableUri) { + this.withTableUri = withTableUri; + return this; + } + + /** + * Whether to include the table URI in the response. Default is false. + * + * @return withTableUri + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITH_TABLE_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWithTableUri() { + return withTableUri; + } + + @JsonProperty(JSON_PROPERTY_WITH_TABLE_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWithTableUri(@javax.annotation.Nullable Boolean withTableUri) { + this.withTableUri = withTableUri; + } + + public DescribeTableRequest loadDetailedMetadata( + @javax.annotation.Nullable Boolean loadDetailedMetadata) { + this.loadDetailedMetadata = loadDetailedMetadata; + return this; + } + + /** + * Whether to load detailed metadata that requires opening the dataset. When true, the response + * must include all detailed metadata such as `version`, `schema`, and + * `stats` which require reading the dataset. When not set, the implementation can + * decide whether to return detailed metadata and which parts of detailed metadata to return. + * + * @return loadDetailedMetadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOAD_DETAILED_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getLoadDetailedMetadata() { + return loadDetailedMetadata; + } + + @JsonProperty(JSON_PROPERTY_LOAD_DETAILED_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoadDetailedMetadata(@javax.annotation.Nullable Boolean loadDetailedMetadata) { + this.loadDetailedMetadata = loadDetailedMetadata; + } + + public DescribeTableRequest vendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { + this.vendCredentials = vendCredentials; + return this; + } + + /** + * Whether to include vended credentials in the response `storage_options`. When true, + * the implementation should provide vended credentials for accessing storage. When not set, the + * implementation can decide whether to return vended credentials. + * + * @return vendCredentials + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVendCredentials() { + return vendCredentials; + } + + @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { + this.vendCredentials = vendCredentials; + } + + /** Return true if this DescribeTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTableRequest describeTableRequest = (DescribeTableRequest) o; + return Objects.equals(this.identity, describeTableRequest.identity) + && Objects.equals(this.context, describeTableRequest.context) + && Objects.equals(this.id, describeTableRequest.id) + && Objects.equals(this.version, describeTableRequest.version) + && Objects.equals(this.withTableUri, describeTableRequest.withTableUri) + && Objects.equals(this.loadDetailedMetadata, describeTableRequest.loadDetailedMetadata) + && Objects.equals(this.vendCredentials, describeTableRequest.vendCredentials); + } + + @Override + public int hashCode() { + return Objects.hash( + identity, context, id, version, withTableUri, loadDetailedMetadata, vendCredentials); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" withTableUri: ").append(toIndentedString(withTableUri)).append("\n"); + sb.append(" loadDetailedMetadata: ") + .append(toIndentedString(loadDetailedMetadata)) + .append("\n"); + sb.append(" vendCredentials: ").append(toIndentedString(vendCredentials)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `with_table_uri` to the URL query string + if (getWithTableUri() != null) { + joiner.add( + String.format( + "%swith_table_uri%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWithTableUri())))); + } + + // add `load_detailed_metadata` to the URL query string + if (getLoadDetailedMetadata() != null) { + joiner.add( + String.format( + "%sload_detailed_metadata%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getLoadDetailedMetadata())))); + } + + // add `vend_credentials` to the URL query string + if (getVendCredentials() != null) { + joiner.add( + String.format( + "%svend_credentials%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVendCredentials())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableResponse.java new file mode 100644 index 000000000..a75d8c200 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableResponse.java @@ -0,0 +1,602 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeTableResponse */ +@JsonPropertyOrder({ + DescribeTableResponse.JSON_PROPERTY_TABLE, + DescribeTableResponse.JSON_PROPERTY_NAMESPACE, + DescribeTableResponse.JSON_PROPERTY_VERSION, + DescribeTableResponse.JSON_PROPERTY_LOCATION, + DescribeTableResponse.JSON_PROPERTY_TABLE_URI, + DescribeTableResponse.JSON_PROPERTY_SCHEMA, + DescribeTableResponse.JSON_PROPERTY_STORAGE_OPTIONS, + DescribeTableResponse.JSON_PROPERTY_STATS, + DescribeTableResponse.JSON_PROPERTY_METADATA, + DescribeTableResponse.JSON_PROPERTY_PROPERTIES, + DescribeTableResponse.JSON_PROPERTY_MANAGED_VERSIONING +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTableResponse { + public static final String JSON_PROPERTY_TABLE = "table"; + @javax.annotation.Nullable private String table; + + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; + @javax.annotation.Nullable private List namespace = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_TABLE_URI = "table_uri"; + @javax.annotation.Nullable private String tableUri; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + @javax.annotation.Nullable private JsonArrowSchema schema; + + public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; + @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); + + public static final String JSON_PROPERTY_STATS = "stats"; + @javax.annotation.Nullable private TableBasicStats stats; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public static final String JSON_PROPERTY_MANAGED_VERSIONING = "managed_versioning"; + @javax.annotation.Nullable private Boolean managedVersioning; + + public DescribeTableResponse() {} + + public DescribeTableResponse table(@javax.annotation.Nullable String table) { + this.table = table; + return this; + } + + /** + * Table name. Only populated when `load_detailed_metadata` is true. + * + * @return table + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTable() { + return table; + } + + @JsonProperty(JSON_PROPERTY_TABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTable(@javax.annotation.Nullable String table) { + this.table = table; + } + + public DescribeTableResponse namespace(@javax.annotation.Nullable List namespace) { + this.namespace = namespace; + return this; + } + + public DescribeTableResponse addNamespaceItem(String namespaceItem) { + if (this.namespace == null) { + this.namespace = new ArrayList<>(); + } + this.namespace.add(namespaceItem); + return this; + } + + /** + * The namespace identifier as a list of parts. Only populated when + * `load_detailed_metadata` is true. + * + * @return namespace + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespace() { + return namespace; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespace(@javax.annotation.Nullable List namespace) { + this.namespace = namespace; + } + + public DescribeTableResponse version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Table version number. Only populated when `load_detailed_metadata` is true. minimum: + * 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public DescribeTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Table storage location (e.g., S3/GCS path). + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public DescribeTableResponse tableUri(@javax.annotation.Nullable String tableUri) { + this.tableUri = tableUri; + return this; + } + + /** + * Table URI. Unlike location, this field must be a complete and valid URI. Only returned when + * `with_table_uri` is true. + * + * @return tableUri + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TABLE_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTableUri() { + return tableUri; + } + + @JsonProperty(JSON_PROPERTY_TABLE_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTableUri(@javax.annotation.Nullable String tableUri) { + this.tableUri = tableUri; + } + + public DescribeTableResponse schema(@javax.annotation.Nullable JsonArrowSchema schema) { + this.schema = schema; + return this; + } + + /** + * Table schema in JSON Arrow format. Only populated when `load_detailed_metadata` is + * true. + * + * @return schema + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonArrowSchema getSchema() { + return schema; + } + + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchema(@javax.annotation.Nullable JsonArrowSchema schema) { + this.schema = schema; + } + + public DescribeTableResponse storageOptions( + @javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + return this; + } + + public DescribeTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Configuration options to be used to access storage. The available options depend on the type of + * storage in use. These will be passed directly to Lance to initialize storage access. When + * `vend_credentials` is true, this field may include vended credentials. If the vended + * credentials are temporary, the `expires_at_millis` key should be included to indicate + * the millisecond timestamp when the credentials expire. + * + * @return storageOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getStorageOptions() { + return storageOptions; + } + + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + } + + public DescribeTableResponse stats(@javax.annotation.Nullable TableBasicStats stats) { + this.stats = stats; + return this; + } + + /** + * Table statistics. Only populated when `load_detailed_metadata` is true. + * + * @return stats + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TableBasicStats getStats() { + return stats; + } + + @JsonProperty(JSON_PROPERTY_STATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStats(@javax.annotation.Nullable TableBasicStats stats) { + this.stats = stats; + } + + public DescribeTableResponse metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public DescribeTableResponse putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Optional table metadata as key-value pairs. This records the information of the table and + * requires loading the table. It is only populated when `load_detailed_metadata` is + * true. + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + public DescribeTableResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DescribeTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the table, if supported by the server. This records the information + * managed by the namespace. If the server does not support table properties, it should return + * null for this field. If table properties are supported, but none are set, it should return an + * empty object. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + public DescribeTableResponse managedVersioning( + @javax.annotation.Nullable Boolean managedVersioning) { + this.managedVersioning = managedVersioning; + return this; + } + + /** + * When true, the caller should use namespace table version operations (CreateTableVersion, + * BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) to + * manage table versions instead of relying on Lance's native version management. + * + * @return managedVersioning + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANAGED_VERSIONING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getManagedVersioning() { + return managedVersioning; + } + + @JsonProperty(JSON_PROPERTY_MANAGED_VERSIONING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManagedVersioning(@javax.annotation.Nullable Boolean managedVersioning) { + this.managedVersioning = managedVersioning; + } + + /** Return true if this DescribeTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTableResponse describeTableResponse = (DescribeTableResponse) o; + return Objects.equals(this.table, describeTableResponse.table) + && Objects.equals(this.namespace, describeTableResponse.namespace) + && Objects.equals(this.version, describeTableResponse.version) + && Objects.equals(this.location, describeTableResponse.location) + && Objects.equals(this.tableUri, describeTableResponse.tableUri) + && Objects.equals(this.schema, describeTableResponse.schema) + && Objects.equals(this.storageOptions, describeTableResponse.storageOptions) + && Objects.equals(this.stats, describeTableResponse.stats) + && Objects.equals(this.metadata, describeTableResponse.metadata) + && Objects.equals(this.properties, describeTableResponse.properties) + && Objects.equals(this.managedVersioning, describeTableResponse.managedVersioning); + } + + @Override + public int hashCode() { + return Objects.hash( + table, + namespace, + version, + location, + tableUri, + schema, + storageOptions, + stats, + metadata, + properties, + managedVersioning); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTableResponse {\n"); + sb.append(" table: ").append(toIndentedString(table)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" tableUri: ").append(toIndentedString(tableUri)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" managedVersioning: ").append(toIndentedString(managedVersioning)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `table` to the URL query string + if (getTable() != null) { + joiner.add( + String.format( + "%stable%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTable())))); + } + + // add `namespace` to the URL query string + if (getNamespace() != null) { + for (int i = 0; i < getNamespace().size(); i++) { + joiner.add( + String.format( + "%snamespace%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getNamespace().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `table_uri` to the URL query string + if (getTableUri() != null) { + joiner.add( + String.format( + "%stable_uri%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTableUri())))); + } + + // add `schema` to the URL query string + if (getSchema() != null) { + joiner.add(getSchema().toUrlQueryString(prefix + "schema" + suffix)); + } + + // add `storage_options` to the URL query string + if (getStorageOptions() != null) { + for (String _key : getStorageOptions().keySet()) { + joiner.add( + String.format( + "%sstorage_options%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getStorageOptions().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getStorageOptions().get(_key))))); + } + } + + // add `stats` to the URL query string + if (getStats() != null) { + joiner.add(getStats().toUrlQueryString(prefix + "stats" + suffix)); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + // add `managed_versioning` to the URL query string + if (getManagedVersioning() != null) { + joiner.add( + String.format( + "%smanaged_versioning%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getManagedVersioning())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableVersionRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableVersionRequest.java new file mode 100644 index 000000000..7ad6f49ee --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableVersionRequest.java @@ -0,0 +1,288 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Request to describe a specific table version */ +@JsonPropertyOrder({ + DescribeTableVersionRequest.JSON_PROPERTY_IDENTITY, + DescribeTableVersionRequest.JSON_PROPERTY_CONTEXT, + DescribeTableVersionRequest.JSON_PROPERTY_ID, + DescribeTableVersionRequest.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTableVersionRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public DescribeTableVersionRequest() {} + + public DescribeTableVersionRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DescribeTableVersionRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DescribeTableVersionRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DescribeTableVersionRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DescribeTableVersionRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DescribeTableVersionRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Version number to describe minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + /** Return true if this DescribeTableVersionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTableVersionRequest describeTableVersionRequest = (DescribeTableVersionRequest) o; + return Objects.equals(this.identity, describeTableVersionRequest.identity) + && Objects.equals(this.context, describeTableVersionRequest.context) + && Objects.equals(this.id, describeTableVersionRequest.id) + && Objects.equals(this.version, describeTableVersionRequest.version); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTableVersionRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableVersionResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableVersionResponse.java new file mode 100644 index 000000000..833e95ce7 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTableVersionResponse.java @@ -0,0 +1,133 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response containing the table version information */ +@JsonPropertyOrder({DescribeTableVersionResponse.JSON_PROPERTY_VERSION}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTableVersionResponse { + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private TableVersion version; + + public DescribeTableVersionResponse() {} + + public DescribeTableVersionResponse version(@javax.annotation.Nonnull TableVersion version) { + this.version = version; + return this; + } + + /** + * The table version information + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TableVersion getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull TableVersion version) { + this.version = version; + } + + /** Return true if this DescribeTableVersionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTableVersionResponse describeTableVersionResponse = (DescribeTableVersionResponse) o; + return Objects.equals(this.version, describeTableVersionResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTableVersionResponse {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add(getVersion().toUrlQueryString(prefix + "version" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTransactionRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTransactionRequest.java new file mode 100644 index 000000000..09a4bc4ff --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTransactionRequest.java @@ -0,0 +1,251 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeTransactionRequest */ +@JsonPropertyOrder({ + DescribeTransactionRequest.JSON_PROPERTY_IDENTITY, + DescribeTransactionRequest.JSON_PROPERTY_CONTEXT, + DescribeTransactionRequest.JSON_PROPERTY_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTransactionRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public DescribeTransactionRequest() {} + + public DescribeTransactionRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DescribeTransactionRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DescribeTransactionRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DescribeTransactionRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DescribeTransactionRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + /** Return true if this DescribeTransactionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTransactionRequest describeTransactionRequest = (DescribeTransactionRequest) o; + return Objects.equals(this.identity, describeTransactionRequest.identity) + && Objects.equals(this.context, describeTransactionRequest.context) + && Objects.equals(this.id, describeTransactionRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTransactionRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTransactionResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTransactionResponse.java new file mode 100644 index 000000000..75cd114ec --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DescribeTransactionResponse.java @@ -0,0 +1,199 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DescribeTransactionResponse */ +@JsonPropertyOrder({ + DescribeTransactionResponse.JSON_PROPERTY_STATUS, + DescribeTransactionResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DescribeTransactionResponse { + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nonnull private String status; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public DescribeTransactionResponse() {} + + public DescribeTransactionResponse status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid + * values are: - Queued: the transaction is queued and not yet started - Running: the transaction + * is currently running - Succeeded: the transaction has completed successfully - Failed: the + * transaction has failed - Canceled: the transaction was canceled + * + * @return status + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + public DescribeTransactionResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DescribeTransactionResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Get properties + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this DescribeTransactionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DescribeTransactionResponse describeTransactionResponse = (DescribeTransactionResponse) o; + return Objects.equals(this.status, describeTransactionResponse.status) + && Objects.equals(this.properties, describeTransactionResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(status, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DescribeTransactionResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropNamespaceRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropNamespaceRequest.java new file mode 100644 index 000000000..6aaba5cc6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropNamespaceRequest.java @@ -0,0 +1,331 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DropNamespaceRequest */ +@JsonPropertyOrder({ + DropNamespaceRequest.JSON_PROPERTY_IDENTITY, + DropNamespaceRequest.JSON_PROPERTY_CONTEXT, + DropNamespaceRequest.JSON_PROPERTY_ID, + DropNamespaceRequest.JSON_PROPERTY_MODE, + DropNamespaceRequest.JSON_PROPERTY_BEHAVIOR +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropNamespaceRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode; + + public static final String JSON_PROPERTY_BEHAVIOR = "behavior"; + @javax.annotation.Nullable private String behavior; + + public DropNamespaceRequest() {} + + public DropNamespaceRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DropNamespaceRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DropNamespaceRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DropNamespaceRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DropNamespaceRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DropNamespaceRequest mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * The mode for dropping a namespace, deciding the server behavior when the namespace to drop is + * not found. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Fail + * (default): the server must return 400 indicating the namespace to drop does not exist. - Skip: + * the server must return 204 indicating the drop operation has succeeded. + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + public DropNamespaceRequest behavior(@javax.annotation.Nullable String behavior) { + this.behavior = behavior; + return this; + } + + /** + * The behavior for dropping a namespace. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - Restrict (default): the namespace should not contain any table + * or child namespace when drop is initiated. If tables are found, the server should return error + * and not drop the namespace. - Cascade: all tables and child namespaces in the namespace are + * dropped before the namespace is dropped. + * + * @return behavior + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BEHAVIOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBehavior() { + return behavior; + } + + @JsonProperty(JSON_PROPERTY_BEHAVIOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBehavior(@javax.annotation.Nullable String behavior) { + this.behavior = behavior; + } + + /** Return true if this DropNamespaceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropNamespaceRequest dropNamespaceRequest = (DropNamespaceRequest) o; + return Objects.equals(this.identity, dropNamespaceRequest.identity) + && Objects.equals(this.context, dropNamespaceRequest.context) + && Objects.equals(this.id, dropNamespaceRequest.id) + && Objects.equals(this.mode, dropNamespaceRequest.mode) + && Objects.equals(this.behavior, dropNamespaceRequest.behavior); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, mode, behavior); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropNamespaceRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" behavior: ").append(toIndentedString(behavior)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + // add `behavior` to the URL query string + if (getBehavior() != null) { + joiner.add( + String.format( + "%sbehavior%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBehavior())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropNamespaceResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropNamespaceResponse.java new file mode 100644 index 000000000..07d0b99ed --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropNamespaceResponse.java @@ -0,0 +1,216 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DropNamespaceResponse */ +@JsonPropertyOrder({ + DropNamespaceResponse.JSON_PROPERTY_PROPERTIES, + DropNamespaceResponse.JSON_PROPERTY_TRANSACTION_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropNamespaceResponse { + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private List transactionId = new ArrayList<>(); + + public DropNamespaceResponse() {} + + public DropNamespaceResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DropNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support namespace properties, it should return null for this + * field. Otherwise it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + public DropNamespaceResponse transactionId( + @javax.annotation.Nullable List transactionId) { + this.transactionId = transactionId; + return this; + } + + public DropNamespaceResponse addTransactionIdItem(String transactionIdItem) { + if (this.transactionId == null) { + this.transactionId = new ArrayList<>(); + } + this.transactionId.add(transactionIdItem); + return this; + } + + /** + * If present, indicating the operation is long running and should be tracked using + * DescribeTransaction + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable List transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this DropNamespaceResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropNamespaceResponse dropNamespaceResponse = (DropNamespaceResponse) o; + return Objects.equals(this.properties, dropNamespaceResponse.properties) + && Objects.equals(this.transactionId, dropNamespaceResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(properties, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropNamespaceResponse {\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + for (int i = 0; i < getTransactionId().size(); i++) { + joiner.add( + String.format( + "%stransaction_id%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getTransactionId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableIndexRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableIndexRequest.java new file mode 100644 index 000000000..8ae54844f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableIndexRequest.java @@ -0,0 +1,287 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DropTableIndexRequest */ +@JsonPropertyOrder({ + DropTableIndexRequest.JSON_PROPERTY_IDENTITY, + DropTableIndexRequest.JSON_PROPERTY_CONTEXT, + DropTableIndexRequest.JSON_PROPERTY_ID, + DropTableIndexRequest.JSON_PROPERTY_INDEX_NAME +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropTableIndexRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_INDEX_NAME = "index_name"; + @javax.annotation.Nullable private String indexName; + + public DropTableIndexRequest() {} + + public DropTableIndexRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DropTableIndexRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DropTableIndexRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DropTableIndexRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DropTableIndexRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DropTableIndexRequest indexName(@javax.annotation.Nullable String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Name of the index to drop + * + * @return indexName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndexName() { + return indexName; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexName(@javax.annotation.Nullable String indexName) { + this.indexName = indexName; + } + + /** Return true if this DropTableIndexRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropTableIndexRequest dropTableIndexRequest = (DropTableIndexRequest) o; + return Objects.equals(this.identity, dropTableIndexRequest.identity) + && Objects.equals(this.context, dropTableIndexRequest.context) + && Objects.equals(this.id, dropTableIndexRequest.id) + && Objects.equals(this.indexName, dropTableIndexRequest.indexName); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, indexName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropTableIndexRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" indexName: ").append(toIndentedString(indexName)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `index_name` to the URL query string + if (getIndexName() != null) { + joiner.add( + String.format( + "%sindex_name%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexName())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableIndexResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableIndexResponse.java new file mode 100644 index 000000000..7dea233e4 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableIndexResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for drop index operation */ +@JsonPropertyOrder({DropTableIndexResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropTableIndexResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public DropTableIndexResponse() {} + + public DropTableIndexResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this DropTableIndexResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropTableIndexResponse dropTableIndexResponse = (DropTableIndexResponse) o; + return Objects.equals(this.transactionId, dropTableIndexResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropTableIndexResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableRequest.java new file mode 100644 index 000000000..d27d0d6bd --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableRequest.java @@ -0,0 +1,253 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * If the table and its data can be immediately deleted, return information of the deleted table. + * Otherwise, return a transaction ID that client can use to track deletion progress. + */ +@JsonPropertyOrder({ + DropTableRequest.JSON_PROPERTY_IDENTITY, + DropTableRequest.JSON_PROPERTY_CONTEXT, + DropTableRequest.JSON_PROPERTY_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public DropTableRequest() {} + + public DropTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public DropTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public DropTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public DropTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DropTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + /** Return true if this DropTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropTableRequest dropTableRequest = (DropTableRequest) o; + return Objects.equals(this.identity, dropTableRequest.identity) + && Objects.equals(this.context, dropTableRequest.context) + && Objects.equals(this.id, dropTableRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableResponse.java new file mode 100644 index 000000000..b1b62c352 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DropTableResponse.java @@ -0,0 +1,287 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DropTableResponse */ +@JsonPropertyOrder({ + DropTableResponse.JSON_PROPERTY_TRANSACTION_ID, + DropTableResponse.JSON_PROPERTY_ID, + DropTableResponse.JSON_PROPERTY_LOCATION, + DropTableResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public DropTableResponse() {} + + public DropTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public DropTableResponse id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public DropTableResponse addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public DropTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public DropTableResponse properties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public DropTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this DropTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropTableResponse dropTableResponse = (DropTableResponse) o; + return Objects.equals(this.transactionId, dropTableResponse.transactionId) + && Objects.equals(this.id, dropTableResponse.id) + && Objects.equals(this.location, dropTableResponse.location) + && Objects.equals(this.properties, dropTableResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, id, location, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ErrorResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ErrorResponse.java new file mode 100644 index 000000000..bc35ecaec --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ErrorResponse.java @@ -0,0 +1,269 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Common JSON error response model */ +@JsonPropertyOrder({ + ErrorResponse.JSON_PROPERTY_ERROR, + ErrorResponse.JSON_PROPERTY_CODE, + ErrorResponse.JSON_PROPERTY_DETAIL, + ErrorResponse.JSON_PROPERTY_INSTANCE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ErrorResponse { + public static final String JSON_PROPERTY_ERROR = "error"; + @javax.annotation.Nullable private String error; + + public static final String JSON_PROPERTY_CODE = "code"; + @javax.annotation.Nonnull private Integer code; + + public static final String JSON_PROPERTY_DETAIL = "detail"; + @javax.annotation.Nullable private String detail; + + public static final String JSON_PROPERTY_INSTANCE = "instance"; + @javax.annotation.Nullable private String instance; + + public ErrorResponse() {} + + public ErrorResponse error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * A brief, human-readable message about the error. + * + * @return error + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + public ErrorResponse code(@javax.annotation.Nonnull Integer code) { + this.code = code; + return this; + } + + /** + * Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation + * not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - + * NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: + * Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not + * exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The + * specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name + * already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - + * TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The + * specified transaction does not exist 11 - TableVersionNotFound: The specified table version + * does not exist 12 - TableColumnNotFound: The specified table column does not exist 13 - + * InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic + * concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - + * Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: + * Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - + * InvalidTableState: Table is in an invalid state for the operation 20 - + * TableSchemaValidationError: Table schema validation failed minimum: 0 + * + * @return code + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(@javax.annotation.Nonnull Integer code) { + this.code = code; + } + + public ErrorResponse detail(@javax.annotation.Nullable String detail) { + this.detail = detail; + return this; + } + + /** + * An optional human-readable explanation of the error. This can be used to record additional + * information such as stack trace. + * + * @return detail + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(@javax.annotation.Nullable String detail) { + this.detail = detail; + } + + public ErrorResponse instance(@javax.annotation.Nullable String instance) { + this.instance = instance; + return this; + } + + /** + * A string that identifies the specific occurrence of the error. This can be a URI, a request or + * response ID, or anything that the implementation can recognize to trace specific occurrence of + * the error. + * + * @return instance + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(@javax.annotation.Nullable String instance) { + this.instance = instance; + } + + /** Return true if this ErrorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.error, errorResponse.error) + && Objects.equals(this.code, errorResponse.code) + && Objects.equals(this.detail, errorResponse.detail) + && Objects.equals(this.instance, errorResponse.instance); + } + + @Override + public int hashCode() { + return Objects.hash(error, code, detail, instance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `error` to the URL query string + if (getError() != null) { + joiner.add( + String.format( + "%serror%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getError())))); + } + + // add `code` to the URL query string + if (getCode() != null) { + joiner.add( + String.format( + "%scode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCode())))); + } + + // add `detail` to the URL query string + if (getDetail() != null) { + joiner.add( + String.format( + "%sdetail%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDetail())))); + } + + // add `instance` to the URL query string + if (getInstance() != null) { + joiner.add( + String.format( + "%sinstance%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getInstance())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ExplainTableQueryPlanRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ExplainTableQueryPlanRequest.java new file mode 100644 index 000000000..fbe9e884f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ExplainTableQueryPlanRequest.java @@ -0,0 +1,322 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** ExplainTableQueryPlanRequest */ +@JsonPropertyOrder({ + ExplainTableQueryPlanRequest.JSON_PROPERTY_IDENTITY, + ExplainTableQueryPlanRequest.JSON_PROPERTY_CONTEXT, + ExplainTableQueryPlanRequest.JSON_PROPERTY_ID, + ExplainTableQueryPlanRequest.JSON_PROPERTY_QUERY, + ExplainTableQueryPlanRequest.JSON_PROPERTY_VERBOSE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExplainTableQueryPlanRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @javax.annotation.Nonnull private QueryTableRequest query; + + public static final String JSON_PROPERTY_VERBOSE = "verbose"; + @javax.annotation.Nullable private Boolean verbose = false; + + public ExplainTableQueryPlanRequest() {} + + public ExplainTableQueryPlanRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public ExplainTableQueryPlanRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public ExplainTableQueryPlanRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public ExplainTableQueryPlanRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public ExplainTableQueryPlanRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public ExplainTableQueryPlanRequest query(@javax.annotation.Nonnull QueryTableRequest query) { + this.query = query; + return this; + } + + /** + * Get query + * + * @return query + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public QueryTableRequest getQuery() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuery(@javax.annotation.Nonnull QueryTableRequest query) { + this.query = query; + } + + public ExplainTableQueryPlanRequest verbose(@javax.annotation.Nullable Boolean verbose) { + this.verbose = verbose; + return this; + } + + /** + * Whether to return verbose explanation + * + * @return verbose + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERBOSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVerbose() { + return verbose; + } + + @JsonProperty(JSON_PROPERTY_VERBOSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVerbose(@javax.annotation.Nullable Boolean verbose) { + this.verbose = verbose; + } + + /** Return true if this ExplainTableQueryPlanRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExplainTableQueryPlanRequest explainTableQueryPlanRequest = (ExplainTableQueryPlanRequest) o; + return Objects.equals(this.identity, explainTableQueryPlanRequest.identity) + && Objects.equals(this.context, explainTableQueryPlanRequest.context) + && Objects.equals(this.id, explainTableQueryPlanRequest.id) + && Objects.equals(this.query, explainTableQueryPlanRequest.query) + && Objects.equals(this.verbose, explainTableQueryPlanRequest.verbose); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, query, verbose); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExplainTableQueryPlanRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" verbose: ").append(toIndentedString(verbose)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + joiner.add(getQuery().toUrlQueryString(prefix + "query" + suffix)); + } + + // add `verbose` to the URL query string + if (getVerbose() != null) { + joiner.add( + String.format( + "%sverbose%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVerbose())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ExplainTableQueryPlanResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ExplainTableQueryPlanResponse.java new file mode 100644 index 000000000..5db3b70fc --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ExplainTableQueryPlanResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** ExplainTableQueryPlanResponse */ +@JsonPropertyOrder({ExplainTableQueryPlanResponse.JSON_PROPERTY_PLAN}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExplainTableQueryPlanResponse { + public static final String JSON_PROPERTY_PLAN = "plan"; + @javax.annotation.Nonnull private String plan; + + public ExplainTableQueryPlanResponse() {} + + public ExplainTableQueryPlanResponse plan(@javax.annotation.Nonnull String plan) { + this.plan = plan; + return this; + } + + /** + * Human-readable query execution plan + * + * @return plan + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PLAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPlan() { + return plan; + } + + @JsonProperty(JSON_PROPERTY_PLAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPlan(@javax.annotation.Nonnull String plan) { + this.plan = plan; + } + + /** Return true if this ExplainTableQueryPlanResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExplainTableQueryPlanResponse explainTableQueryPlanResponse = (ExplainTableQueryPlanResponse) o; + return Objects.equals(this.plan, explainTableQueryPlanResponse.plan); + } + + @Override + public int hashCode() { + return Objects.hash(plan); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExplainTableQueryPlanResponse {\n"); + sb.append(" plan: ").append(toIndentedString(plan)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `plan` to the URL query string + if (getPlan() != null) { + joiner.add( + String.format( + "%splan%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPlan())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FragmentStats.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FragmentStats.java new file mode 100644 index 000000000..8a4d9a7f1 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FragmentStats.java @@ -0,0 +1,213 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** FragmentStats */ +@JsonPropertyOrder({ + FragmentStats.JSON_PROPERTY_NUM_FRAGMENTS, + FragmentStats.JSON_PROPERTY_NUM_SMALL_FRAGMENTS, + FragmentStats.JSON_PROPERTY_LENGTHS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FragmentStats { + public static final String JSON_PROPERTY_NUM_FRAGMENTS = "num_fragments"; + @javax.annotation.Nonnull private Long numFragments; + + public static final String JSON_PROPERTY_NUM_SMALL_FRAGMENTS = "num_small_fragments"; + @javax.annotation.Nonnull private Long numSmallFragments; + + public static final String JSON_PROPERTY_LENGTHS = "lengths"; + @javax.annotation.Nonnull private FragmentSummary lengths; + + public FragmentStats() {} + + public FragmentStats numFragments(@javax.annotation.Nonnull Long numFragments) { + this.numFragments = numFragments; + return this; + } + + /** + * The number of fragments in the table minimum: 0 + * + * @return numFragments + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUM_FRAGMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNumFragments() { + return numFragments; + } + + @JsonProperty(JSON_PROPERTY_NUM_FRAGMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumFragments(@javax.annotation.Nonnull Long numFragments) { + this.numFragments = numFragments; + } + + public FragmentStats numSmallFragments(@javax.annotation.Nonnull Long numSmallFragments) { + this.numSmallFragments = numSmallFragments; + return this; + } + + /** + * The number of uncompacted fragments in the table minimum: 0 + * + * @return numSmallFragments + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUM_SMALL_FRAGMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNumSmallFragments() { + return numSmallFragments; + } + + @JsonProperty(JSON_PROPERTY_NUM_SMALL_FRAGMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumSmallFragments(@javax.annotation.Nonnull Long numSmallFragments) { + this.numSmallFragments = numSmallFragments; + } + + public FragmentStats lengths(@javax.annotation.Nonnull FragmentSummary lengths) { + this.lengths = lengths; + return this; + } + + /** + * Statistics on the number of rows in the table fragments + * + * @return lengths + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LENGTHS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FragmentSummary getLengths() { + return lengths; + } + + @JsonProperty(JSON_PROPERTY_LENGTHS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLengths(@javax.annotation.Nonnull FragmentSummary lengths) { + this.lengths = lengths; + } + + /** Return true if this FragmentStats object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FragmentStats fragmentStats = (FragmentStats) o; + return Objects.equals(this.numFragments, fragmentStats.numFragments) + && Objects.equals(this.numSmallFragments, fragmentStats.numSmallFragments) + && Objects.equals(this.lengths, fragmentStats.lengths); + } + + @Override + public int hashCode() { + return Objects.hash(numFragments, numSmallFragments, lengths); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FragmentStats {\n"); + sb.append(" numFragments: ").append(toIndentedString(numFragments)).append("\n"); + sb.append(" numSmallFragments: ").append(toIndentedString(numSmallFragments)).append("\n"); + sb.append(" lengths: ").append(toIndentedString(lengths)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `num_fragments` to the URL query string + if (getNumFragments() != null) { + joiner.add( + String.format( + "%snum_fragments%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumFragments())))); + } + + // add `num_small_fragments` to the URL query string + if (getNumSmallFragments() != null) { + joiner.add( + String.format( + "%snum_small_fragments%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getNumSmallFragments())))); + } + + // add `lengths` to the URL query string + if (getLengths() != null) { + joiner.add(getLengths().toUrlQueryString(prefix + "lengths" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FragmentSummary.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FragmentSummary.java new file mode 100644 index 000000000..5e4aa3bb4 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FragmentSummary.java @@ -0,0 +1,362 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** FragmentSummary */ +@JsonPropertyOrder({ + FragmentSummary.JSON_PROPERTY_MIN, + FragmentSummary.JSON_PROPERTY_MAX, + FragmentSummary.JSON_PROPERTY_MEAN, + FragmentSummary.JSON_PROPERTY_P25, + FragmentSummary.JSON_PROPERTY_P50, + FragmentSummary.JSON_PROPERTY_P75, + FragmentSummary.JSON_PROPERTY_P99 +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FragmentSummary { + public static final String JSON_PROPERTY_MIN = "min"; + @javax.annotation.Nonnull private Long min; + + public static final String JSON_PROPERTY_MAX = "max"; + @javax.annotation.Nonnull private Long max; + + public static final String JSON_PROPERTY_MEAN = "mean"; + @javax.annotation.Nonnull private Long mean; + + public static final String JSON_PROPERTY_P25 = "p25"; + @javax.annotation.Nonnull private Long p25; + + public static final String JSON_PROPERTY_P50 = "p50"; + @javax.annotation.Nonnull private Long p50; + + public static final String JSON_PROPERTY_P75 = "p75"; + @javax.annotation.Nonnull private Long p75; + + public static final String JSON_PROPERTY_P99 = "p99"; + @javax.annotation.Nonnull private Long p99; + + public FragmentSummary() {} + + public FragmentSummary min(@javax.annotation.Nonnull Long min) { + this.min = min; + return this; + } + + /** + * Get min minimum: 0 + * + * @return min + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMin() { + return min; + } + + @JsonProperty(JSON_PROPERTY_MIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMin(@javax.annotation.Nonnull Long min) { + this.min = min; + } + + public FragmentSummary max(@javax.annotation.Nonnull Long max) { + this.max = max; + return this; + } + + /** + * Get max minimum: 0 + * + * @return max + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMax() { + return max; + } + + @JsonProperty(JSON_PROPERTY_MAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMax(@javax.annotation.Nonnull Long max) { + this.max = max; + } + + public FragmentSummary mean(@javax.annotation.Nonnull Long mean) { + this.mean = mean; + return this; + } + + /** + * Get mean minimum: 0 + * + * @return mean + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MEAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMean() { + return mean; + } + + @JsonProperty(JSON_PROPERTY_MEAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMean(@javax.annotation.Nonnull Long mean) { + this.mean = mean; + } + + public FragmentSummary p25(@javax.annotation.Nonnull Long p25) { + this.p25 = p25; + return this; + } + + /** + * Get p25 minimum: 0 + * + * @return p25 + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_P25) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getP25() { + return p25; + } + + @JsonProperty(JSON_PROPERTY_P25) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setP25(@javax.annotation.Nonnull Long p25) { + this.p25 = p25; + } + + public FragmentSummary p50(@javax.annotation.Nonnull Long p50) { + this.p50 = p50; + return this; + } + + /** + * Get p50 minimum: 0 + * + * @return p50 + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_P50) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getP50() { + return p50; + } + + @JsonProperty(JSON_PROPERTY_P50) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setP50(@javax.annotation.Nonnull Long p50) { + this.p50 = p50; + } + + public FragmentSummary p75(@javax.annotation.Nonnull Long p75) { + this.p75 = p75; + return this; + } + + /** + * Get p75 minimum: 0 + * + * @return p75 + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_P75) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getP75() { + return p75; + } + + @JsonProperty(JSON_PROPERTY_P75) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setP75(@javax.annotation.Nonnull Long p75) { + this.p75 = p75; + } + + public FragmentSummary p99(@javax.annotation.Nonnull Long p99) { + this.p99 = p99; + return this; + } + + /** + * Get p99 minimum: 0 + * + * @return p99 + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_P99) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getP99() { + return p99; + } + + @JsonProperty(JSON_PROPERTY_P99) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setP99(@javax.annotation.Nonnull Long p99) { + this.p99 = p99; + } + + /** Return true if this FragmentSummary object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FragmentSummary fragmentSummary = (FragmentSummary) o; + return Objects.equals(this.min, fragmentSummary.min) + && Objects.equals(this.max, fragmentSummary.max) + && Objects.equals(this.mean, fragmentSummary.mean) + && Objects.equals(this.p25, fragmentSummary.p25) + && Objects.equals(this.p50, fragmentSummary.p50) + && Objects.equals(this.p75, fragmentSummary.p75) + && Objects.equals(this.p99, fragmentSummary.p99); + } + + @Override + public int hashCode() { + return Objects.hash(min, max, mean, p25, p50, p75, p99); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FragmentSummary {\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" mean: ").append(toIndentedString(mean)).append("\n"); + sb.append(" p25: ").append(toIndentedString(p25)).append("\n"); + sb.append(" p50: ").append(toIndentedString(p50)).append("\n"); + sb.append(" p75: ").append(toIndentedString(p75)).append("\n"); + sb.append(" p99: ").append(toIndentedString(p99)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `min` to the URL query string + if (getMin() != null) { + joiner.add( + String.format( + "%smin%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMin())))); + } + + // add `max` to the URL query string + if (getMax() != null) { + joiner.add( + String.format( + "%smax%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMax())))); + } + + // add `mean` to the URL query string + if (getMean() != null) { + joiner.add( + String.format( + "%smean%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMean())))); + } + + // add `p25` to the URL query string + if (getP25() != null) { + joiner.add( + String.format( + "%sp25%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getP25())))); + } + + // add `p50` to the URL query string + if (getP50() != null) { + joiner.add( + String.format( + "%sp50%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getP50())))); + } + + // add `p75` to the URL query string + if (getP75() != null) { + joiner.add( + String.format( + "%sp75%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getP75())))); + } + + // add `p99` to the URL query string + if (getP99() != null) { + joiner.add( + String.format( + "%sp99%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getP99())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FtsQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FtsQuery.java new file mode 100644 index 000000000..04ed08e6a --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/FtsQuery.java @@ -0,0 +1,275 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Full-text search query. Exactly one query type field must be provided. This structure follows the + * same pattern as AlterTransactionAction to minimize differences and compatibility issues across + * codegen in different languages. + */ +@JsonPropertyOrder({ + FtsQuery.JSON_PROPERTY_MATCH, + FtsQuery.JSON_PROPERTY_PHRASE, + FtsQuery.JSON_PROPERTY_BOOST, + FtsQuery.JSON_PROPERTY_MULTI_MATCH, + FtsQuery.JSON_PROPERTY_BOOLEAN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FtsQuery { + public static final String JSON_PROPERTY_MATCH = "match"; + @javax.annotation.Nullable private MatchQuery match; + + public static final String JSON_PROPERTY_PHRASE = "phrase"; + @javax.annotation.Nullable private PhraseQuery phrase; + + public static final String JSON_PROPERTY_BOOST = "boost"; + @javax.annotation.Nullable private BoostQuery boost; + + public static final String JSON_PROPERTY_MULTI_MATCH = "multi_match"; + @javax.annotation.Nullable private MultiMatchQuery multiMatch; + + public static final String JSON_PROPERTY_BOOLEAN = "boolean"; + @javax.annotation.Nullable private BooleanQuery _boolean; + + public FtsQuery() {} + + public FtsQuery match(@javax.annotation.Nullable MatchQuery match) { + this.match = match; + return this; + } + + /** + * Get match + * + * @return match + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MatchQuery getMatch() { + return match; + } + + @JsonProperty(JSON_PROPERTY_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMatch(@javax.annotation.Nullable MatchQuery match) { + this.match = match; + } + + public FtsQuery phrase(@javax.annotation.Nullable PhraseQuery phrase) { + this.phrase = phrase; + return this; + } + + /** + * Get phrase + * + * @return phrase + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHRASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PhraseQuery getPhrase() { + return phrase; + } + + @JsonProperty(JSON_PROPERTY_PHRASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhrase(@javax.annotation.Nullable PhraseQuery phrase) { + this.phrase = phrase; + } + + public FtsQuery boost(@javax.annotation.Nullable BoostQuery boost) { + this.boost = boost; + return this; + } + + /** + * Get boost + * + * @return boost + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BoostQuery getBoost() { + return boost; + } + + @JsonProperty(JSON_PROPERTY_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoost(@javax.annotation.Nullable BoostQuery boost) { + this.boost = boost; + } + + public FtsQuery multiMatch(@javax.annotation.Nullable MultiMatchQuery multiMatch) { + this.multiMatch = multiMatch; + return this; + } + + /** + * Get multiMatch + * + * @return multiMatch + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MULTI_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MultiMatchQuery getMultiMatch() { + return multiMatch; + } + + @JsonProperty(JSON_PROPERTY_MULTI_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMultiMatch(@javax.annotation.Nullable MultiMatchQuery multiMatch) { + this.multiMatch = multiMatch; + } + + public FtsQuery _boolean(@javax.annotation.Nullable BooleanQuery _boolean) { + this._boolean = _boolean; + return this; + } + + /** + * Get _boolean + * + * @return _boolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BooleanQuery getBoolean() { + return _boolean; + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoolean(@javax.annotation.Nullable BooleanQuery _boolean) { + this._boolean = _boolean; + } + + /** Return true if this FtsQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FtsQuery ftsQuery = (FtsQuery) o; + return Objects.equals(this.match, ftsQuery.match) + && Objects.equals(this.phrase, ftsQuery.phrase) + && Objects.equals(this.boost, ftsQuery.boost) + && Objects.equals(this.multiMatch, ftsQuery.multiMatch) + && Objects.equals(this._boolean, ftsQuery._boolean); + } + + @Override + public int hashCode() { + return Objects.hash(match, phrase, boost, multiMatch, _boolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FtsQuery {\n"); + sb.append(" match: ").append(toIndentedString(match)).append("\n"); + sb.append(" phrase: ").append(toIndentedString(phrase)).append("\n"); + sb.append(" boost: ").append(toIndentedString(boost)).append("\n"); + sb.append(" multiMatch: ").append(toIndentedString(multiMatch)).append("\n"); + sb.append(" _boolean: ").append(toIndentedString(_boolean)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `match` to the URL query string + if (getMatch() != null) { + joiner.add(getMatch().toUrlQueryString(prefix + "match" + suffix)); + } + + // add `phrase` to the URL query string + if (getPhrase() != null) { + joiner.add(getPhrase().toUrlQueryString(prefix + "phrase" + suffix)); + } + + // add `boost` to the URL query string + if (getBoost() != null) { + joiner.add(getBoost().toUrlQueryString(prefix + "boost" + suffix)); + } + + // add `multi_match` to the URL query string + if (getMultiMatch() != null) { + joiner.add(getMultiMatch().toUrlQueryString(prefix + "multi_match" + suffix)); + } + + // add `boolean` to the URL query string + if (getBoolean() != null) { + joiner.add(getBoolean().toUrlQueryString(prefix + "boolean" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableStatsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableStatsRequest.java new file mode 100644 index 000000000..7d539b845 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableStatsRequest.java @@ -0,0 +1,250 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** GetTableStatsRequest */ +@JsonPropertyOrder({ + GetTableStatsRequest.JSON_PROPERTY_IDENTITY, + GetTableStatsRequest.JSON_PROPERTY_CONTEXT, + GetTableStatsRequest.JSON_PROPERTY_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetTableStatsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public GetTableStatsRequest() {} + + public GetTableStatsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public GetTableStatsRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public GetTableStatsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public GetTableStatsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public GetTableStatsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + /** Return true if this GetTableStatsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTableStatsRequest getTableStatsRequest = (GetTableStatsRequest) o; + return Objects.equals(this.identity, getTableStatsRequest.identity) + && Objects.equals(this.context, getTableStatsRequest.context) + && Objects.equals(this.id, getTableStatsRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTableStatsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableStatsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableStatsResponse.java new file mode 100644 index 000000000..30baaaa28 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableStatsResponse.java @@ -0,0 +1,249 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** GetTableStatsResponse */ +@JsonPropertyOrder({ + GetTableStatsResponse.JSON_PROPERTY_TOTAL_BYTES, + GetTableStatsResponse.JSON_PROPERTY_NUM_ROWS, + GetTableStatsResponse.JSON_PROPERTY_NUM_INDICES, + GetTableStatsResponse.JSON_PROPERTY_FRAGMENT_STATS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetTableStatsResponse { + public static final String JSON_PROPERTY_TOTAL_BYTES = "total_bytes"; + @javax.annotation.Nonnull private Long totalBytes; + + public static final String JSON_PROPERTY_NUM_ROWS = "num_rows"; + @javax.annotation.Nonnull private Long numRows; + + public static final String JSON_PROPERTY_NUM_INDICES = "num_indices"; + @javax.annotation.Nonnull private Long numIndices; + + public static final String JSON_PROPERTY_FRAGMENT_STATS = "fragment_stats"; + @javax.annotation.Nonnull private FragmentStats fragmentStats; + + public GetTableStatsResponse() {} + + public GetTableStatsResponse totalBytes(@javax.annotation.Nonnull Long totalBytes) { + this.totalBytes = totalBytes; + return this; + } + + /** + * The total number of bytes in the table minimum: 0 + * + * @return totalBytes + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOTAL_BYTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalBytes() { + return totalBytes; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_BYTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTotalBytes(@javax.annotation.Nonnull Long totalBytes) { + this.totalBytes = totalBytes; + } + + public GetTableStatsResponse numRows(@javax.annotation.Nonnull Long numRows) { + this.numRows = numRows; + return this; + } + + /** + * The number of rows in the table minimum: 0 + * + * @return numRows + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUM_ROWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNumRows() { + return numRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_ROWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumRows(@javax.annotation.Nonnull Long numRows) { + this.numRows = numRows; + } + + public GetTableStatsResponse numIndices(@javax.annotation.Nonnull Long numIndices) { + this.numIndices = numIndices; + return this; + } + + /** + * The number of indices in the table minimum: 0 + * + * @return numIndices + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUM_INDICES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNumIndices() { + return numIndices; + } + + @JsonProperty(JSON_PROPERTY_NUM_INDICES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumIndices(@javax.annotation.Nonnull Long numIndices) { + this.numIndices = numIndices; + } + + public GetTableStatsResponse fragmentStats( + @javax.annotation.Nonnull FragmentStats fragmentStats) { + this.fragmentStats = fragmentStats; + return this; + } + + /** + * Statistics on table fragments + * + * @return fragmentStats + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FRAGMENT_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FragmentStats getFragmentStats() { + return fragmentStats; + } + + @JsonProperty(JSON_PROPERTY_FRAGMENT_STATS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFragmentStats(@javax.annotation.Nonnull FragmentStats fragmentStats) { + this.fragmentStats = fragmentStats; + } + + /** Return true if this GetTableStatsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTableStatsResponse getTableStatsResponse = (GetTableStatsResponse) o; + return Objects.equals(this.totalBytes, getTableStatsResponse.totalBytes) + && Objects.equals(this.numRows, getTableStatsResponse.numRows) + && Objects.equals(this.numIndices, getTableStatsResponse.numIndices) + && Objects.equals(this.fragmentStats, getTableStatsResponse.fragmentStats); + } + + @Override + public int hashCode() { + return Objects.hash(totalBytes, numRows, numIndices, fragmentStats); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTableStatsResponse {\n"); + sb.append(" totalBytes: ").append(toIndentedString(totalBytes)).append("\n"); + sb.append(" numRows: ").append(toIndentedString(numRows)).append("\n"); + sb.append(" numIndices: ").append(toIndentedString(numIndices)).append("\n"); + sb.append(" fragmentStats: ").append(toIndentedString(fragmentStats)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `total_bytes` to the URL query string + if (getTotalBytes() != null) { + joiner.add( + String.format( + "%stotal_bytes%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalBytes())))); + } + + // add `num_rows` to the URL query string + if (getNumRows() != null) { + joiner.add( + String.format( + "%snum_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumRows())))); + } + + // add `num_indices` to the URL query string + if (getNumIndices() != null) { + joiner.add( + String.format( + "%snum_indices%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumIndices())))); + } + + // add `fragment_stats` to the URL query string + if (getFragmentStats() != null) { + joiner.add(getFragmentStats().toUrlQueryString(prefix + "fragment_stats" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableTagVersionRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableTagVersionRequest.java new file mode 100644 index 000000000..7537f476f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableTagVersionRequest.java @@ -0,0 +1,287 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** GetTableTagVersionRequest */ +@JsonPropertyOrder({ + GetTableTagVersionRequest.JSON_PROPERTY_IDENTITY, + GetTableTagVersionRequest.JSON_PROPERTY_CONTEXT, + GetTableTagVersionRequest.JSON_PROPERTY_ID, + GetTableTagVersionRequest.JSON_PROPERTY_TAG +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetTableTagVersionRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAG = "tag"; + @javax.annotation.Nonnull private String tag; + + public GetTableTagVersionRequest() {} + + public GetTableTagVersionRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public GetTableTagVersionRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public GetTableTagVersionRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public GetTableTagVersionRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public GetTableTagVersionRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public GetTableTagVersionRequest tag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + return this; + } + + /** + * Name of the tag to get version for + * + * @return tag + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTag() { + return tag; + } + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + } + + /** Return true if this GetTableTagVersionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTableTagVersionRequest getTableTagVersionRequest = (GetTableTagVersionRequest) o; + return Objects.equals(this.identity, getTableTagVersionRequest.identity) + && Objects.equals(this.context, getTableTagVersionRequest.context) + && Objects.equals(this.id, getTableTagVersionRequest.id) + && Objects.equals(this.tag, getTableTagVersionRequest.tag); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, tag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTableTagVersionRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + joiner.add( + String.format( + "%stag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTag())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableTagVersionResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableTagVersionResponse.java new file mode 100644 index 000000000..87d9a24e8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/GetTableTagVersionResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** GetTableTagVersionResponse */ +@JsonPropertyOrder({GetTableTagVersionResponse.JSON_PROPERTY_VERSION}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetTableTagVersionResponse { + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public GetTableTagVersionResponse() {} + + public GetTableTagVersionResponse version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * version number that the tag points to minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this GetTableTagVersionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTableTagVersionResponse getTableTagVersionResponse = (GetTableTagVersionResponse) o; + return Objects.equals(this.version, getTableTagVersionResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTableTagVersionResponse {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/Identity.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/Identity.java new file mode 100644 index 000000000..f2890aa5c --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/Identity.java @@ -0,0 +1,177 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Identity information of a request. */ +@JsonPropertyOrder({Identity.JSON_PROPERTY_API_KEY, Identity.JSON_PROPERTY_AUTH_TOKEN}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Identity { + public static final String JSON_PROPERTY_API_KEY = "api_key"; + @javax.annotation.Nullable private String apiKey; + + public static final String JSON_PROPERTY_AUTH_TOKEN = "auth_token"; + @javax.annotation.Nullable private String authToken; + + public Identity() {} + + public Identity apiKey(@javax.annotation.Nullable String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * API key for authentication. REST NAMESPACE ONLY This is passed via the `x-api-key` + * header. + * + * @return apiKey + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiKey() { + return apiKey; + } + + @JsonProperty(JSON_PROPERTY_API_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKey(@javax.annotation.Nullable String apiKey) { + this.apiKey = apiKey; + } + + public Identity authToken(@javax.annotation.Nullable String authToken) { + this.authToken = authToken; + return this; + } + + /** + * Bearer token for authentication. REST NAMESPACE ONLY This is passed via the + * `Authorization` header with the Bearer scheme (e.g., `Bearer + * <token>`). + * + * @return authToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthToken() { + return authToken; + } + + @JsonProperty(JSON_PROPERTY_AUTH_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthToken(@javax.annotation.Nullable String authToken) { + this.authToken = authToken; + } + + /** Return true if this Identity object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Identity identity = (Identity) o; + return Objects.equals(this.apiKey, identity.apiKey) + && Objects.equals(this.authToken, identity.authToken); + } + + @Override + public int hashCode() { + return Objects.hash(apiKey, authToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Identity {\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" authToken: ").append(toIndentedString(authToken)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `api_key` to the URL query string + if (getApiKey() != null) { + joiner.add( + String.format( + "%sapi_key%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getApiKey())))); + } + + // add `auth_token` to the URL query string + if (getAuthToken() != null) { + joiner.add( + String.format( + "%sauth_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAuthToken())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java new file mode 100644 index 000000000..c7d100274 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/IndexContent.java @@ -0,0 +1,268 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** IndexContent */ +@JsonPropertyOrder({ + IndexContent.JSON_PROPERTY_INDEX_NAME, + IndexContent.JSON_PROPERTY_INDEX_UUID, + IndexContent.JSON_PROPERTY_COLUMNS, + IndexContent.JSON_PROPERTY_STATUS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IndexContent { + public static final String JSON_PROPERTY_INDEX_NAME = "index_name"; + @javax.annotation.Nonnull private String indexName; + + public static final String JSON_PROPERTY_INDEX_UUID = "index_uuid"; + @javax.annotation.Nonnull private String indexUuid; + + public static final String JSON_PROPERTY_COLUMNS = "columns"; + @javax.annotation.Nonnull private List columns = new ArrayList<>(); + + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nonnull private String status; + + public IndexContent() {} + + public IndexContent indexName(@javax.annotation.Nonnull String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Name of the index + * + * @return indexName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INDEX_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIndexName() { + return indexName; + } + + @JsonProperty(JSON_PROPERTY_INDEX_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndexName(@javax.annotation.Nonnull String indexName) { + this.indexName = indexName; + } + + public IndexContent indexUuid(@javax.annotation.Nonnull String indexUuid) { + this.indexUuid = indexUuid; + return this; + } + + /** + * Unique identifier for the index + * + * @return indexUuid + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INDEX_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIndexUuid() { + return indexUuid; + } + + @JsonProperty(JSON_PROPERTY_INDEX_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndexUuid(@javax.annotation.Nonnull String indexUuid) { + this.indexUuid = indexUuid; + } + + public IndexContent columns(@javax.annotation.Nonnull List columns) { + this.columns = columns; + return this; + } + + public IndexContent addColumnsItem(String columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + return this; + } + + /** + * Columns covered by this index + * + * @return columns + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setColumns(@javax.annotation.Nonnull List columns) { + this.columns = columns; + } + + public IndexContent status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Current status of the index + * + * @return status + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + /** Return true if this IndexContent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexContent indexContent = (IndexContent) o; + return Objects.equals(this.indexName, indexContent.indexName) + && Objects.equals(this.indexUuid, indexContent.indexUuid) + && Objects.equals(this.columns, indexContent.columns) + && Objects.equals(this.status, indexContent.status); + } + + @Override + public int hashCode() { + return Objects.hash(indexName, indexUuid, columns, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexContent {\n"); + sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n"); + sb.append(" indexUuid: ").append(toIndentedString(indexUuid)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `index_name` to the URL query string + if (getIndexName() != null) { + joiner.add( + String.format( + "%sindex_name%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexName())))); + } + + // add `index_uuid` to the URL query string + if (getIndexUuid() != null) { + joiner.add( + String.format( + "%sindex_uuid%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIndexUuid())))); + } + + // add `columns` to the URL query string + if (getColumns() != null) { + for (int i = 0; i < getColumns().size(); i++) { + joiner.add( + String.format( + "%scolumns%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getColumns().get(i))))); + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/InsertIntoTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/InsertIntoTableRequest.java new file mode 100644 index 000000000..be43bd5bb --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/InsertIntoTableRequest.java @@ -0,0 +1,289 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Request for inserting records into a table, excluding the Arrow IPC stream. */ +@JsonPropertyOrder({ + InsertIntoTableRequest.JSON_PROPERTY_IDENTITY, + InsertIntoTableRequest.JSON_PROPERTY_CONTEXT, + InsertIntoTableRequest.JSON_PROPERTY_ID, + InsertIntoTableRequest.JSON_PROPERTY_MODE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class InsertIntoTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode = "append"; + + public InsertIntoTableRequest() {} + + public InsertIntoTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public InsertIntoTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public InsertIntoTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public InsertIntoTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public InsertIntoTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public InsertIntoTableRequest mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid + * values are: - Append (default): insert data to the existing table - Overwrite: remove all data + * in the table and then insert data to it + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + /** Return true if this InsertIntoTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertIntoTableRequest insertIntoTableRequest = (InsertIntoTableRequest) o; + return Objects.equals(this.identity, insertIntoTableRequest.identity) + && Objects.equals(this.context, insertIntoTableRequest.context) + && Objects.equals(this.id, insertIntoTableRequest.id) + && Objects.equals(this.mode, insertIntoTableRequest.mode); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertIntoTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/InsertIntoTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/InsertIntoTableResponse.java new file mode 100644 index 000000000..d7e741b15 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/InsertIntoTableResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response from inserting records into a table */ +@JsonPropertyOrder({InsertIntoTableResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class InsertIntoTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public InsertIntoTableResponse() {} + + public InsertIntoTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this InsertIntoTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertIntoTableResponse insertIntoTableResponse = (InsertIntoTableResponse) o; + return Objects.equals(this.transactionId, insertIntoTableResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertIntoTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowDataType.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowDataType.java new file mode 100644 index 000000000..84d13df0e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowDataType.java @@ -0,0 +1,235 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** JSON representation of an Apache Arrow DataType */ +@JsonPropertyOrder({ + JsonArrowDataType.JSON_PROPERTY_FIELDS, + JsonArrowDataType.JSON_PROPERTY_LENGTH, + JsonArrowDataType.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class JsonArrowDataType { + public static final String JSON_PROPERTY_FIELDS = "fields"; + @javax.annotation.Nullable private List fields = new ArrayList<>(); + + public static final String JSON_PROPERTY_LENGTH = "length"; + @javax.annotation.Nullable private Long length; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull private String type; + + public JsonArrowDataType() {} + + public JsonArrowDataType fields(@javax.annotation.Nullable List fields) { + this.fields = fields; + return this; + } + + public JsonArrowDataType addFieldsItem(JsonArrowField fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Fields for complex types like Struct, Union, etc. + * + * @return fields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFields() { + return fields; + } + + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFields(@javax.annotation.Nullable List fields) { + this.fields = fields; + } + + public JsonArrowDataType length(@javax.annotation.Nullable Long length) { + this.length = length; + return this; + } + + /** + * Length for fixed-size types minimum: 0 + * + * @return length + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLength() { + return length; + } + + @JsonProperty(JSON_PROPERTY_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLength(@javax.annotation.Nullable Long length) { + this.length = length; + } + + public JsonArrowDataType type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The data type name + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + /** Return true if this JsonArrowDataType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JsonArrowDataType jsonArrowDataType = (JsonArrowDataType) o; + return Objects.equals(this.fields, jsonArrowDataType.fields) + && Objects.equals(this.length, jsonArrowDataType.length) + && Objects.equals(this.type, jsonArrowDataType.type); + } + + @Override + public int hashCode() { + return Objects.hash(fields, length, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JsonArrowDataType {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" length: ").append(toIndentedString(length)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `fields` to the URL query string + if (getFields() != null) { + for (int i = 0; i < getFields().size(); i++) { + if (getFields().get(i) != null) { + joiner.add( + getFields() + .get(i) + .toUrlQueryString( + String.format( + "%sfields%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `length` to the URL query string + if (getLength() != null) { + joiner.add( + String.format( + "%slength%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLength())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add( + String.format( + "%stype%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowField.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowField.java new file mode 100644 index 000000000..30be0012b --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowField.java @@ -0,0 +1,266 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** JSON representation of an Apache Arrow field. */ +@JsonPropertyOrder({ + JsonArrowField.JSON_PROPERTY_METADATA, + JsonArrowField.JSON_PROPERTY_NAME, + JsonArrowField.JSON_PROPERTY_NULLABLE, + JsonArrowField.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class JsonArrowField { + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull private String name; + + public static final String JSON_PROPERTY_NULLABLE = "nullable"; + @javax.annotation.Nonnull private Boolean nullable; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull private JsonArrowDataType type; + + public JsonArrowField() {} + + public JsonArrowField metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public JsonArrowField putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + public JsonArrowField name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + public JsonArrowField nullable(@javax.annotation.Nonnull Boolean nullable) { + this.nullable = nullable; + return this; + } + + /** + * Get nullable + * + * @return nullable + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NULLABLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getNullable() { + return nullable; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNullable(@javax.annotation.Nonnull Boolean nullable) { + this.nullable = nullable; + } + + public JsonArrowField type(@javax.annotation.Nonnull JsonArrowDataType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JsonArrowDataType getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull JsonArrowDataType type) { + this.type = type; + } + + /** Return true if this JsonArrowField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JsonArrowField jsonArrowField = (JsonArrowField) o; + return Objects.equals(this.metadata, jsonArrowField.metadata) + && Objects.equals(this.name, jsonArrowField.name) + && Objects.equals(this.nullable, jsonArrowField.nullable) + && Objects.equals(this.type, jsonArrowField.type); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, name, nullable, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JsonArrowField {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `nullable` to the URL query string + if (getNullable() != null) { + joiner.add( + String.format( + "%snullable%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNullable())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(getType().toUrlQueryString(prefix + "type" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowSchema.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowSchema.java new file mode 100644 index 000000000..605e894b6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/JsonArrowSchema.java @@ -0,0 +1,213 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** JSON representation of a Apache Arrow schema. */ +@JsonPropertyOrder({JsonArrowSchema.JSON_PROPERTY_FIELDS, JsonArrowSchema.JSON_PROPERTY_METADATA}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class JsonArrowSchema { + public static final String JSON_PROPERTY_FIELDS = "fields"; + @javax.annotation.Nonnull private List fields = new ArrayList<>(); + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public JsonArrowSchema() {} + + public JsonArrowSchema fields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + return this; + } + + public JsonArrowSchema addFieldsItem(JsonArrowField fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Get fields + * + * @return fields + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFields() { + return fields; + } + + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + } + + public JsonArrowSchema metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public JsonArrowSchema putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + /** Return true if this JsonArrowSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JsonArrowSchema jsonArrowSchema = (JsonArrowSchema) o; + return Objects.equals(this.fields, jsonArrowSchema.fields) + && Objects.equals(this.metadata, jsonArrowSchema.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(fields, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JsonArrowSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `fields` to the URL query string + if (getFields() != null) { + for (int i = 0; i < getFields().size(); i++) { + if (getFields().get(i) != null) { + joiner.add( + getFields() + .get(i) + .toUrlQueryString( + String.format( + "%sfields%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListNamespacesRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListNamespacesRequest.java new file mode 100644 index 000000000..cfe55ebc6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListNamespacesRequest.java @@ -0,0 +1,331 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListNamespacesRequest */ +@JsonPropertyOrder({ + ListNamespacesRequest.JSON_PROPERTY_IDENTITY, + ListNamespacesRequest.JSON_PROPERTY_CONTEXT, + ListNamespacesRequest.JSON_PROPERTY_ID, + ListNamespacesRequest.JSON_PROPERTY_PAGE_TOKEN, + ListNamespacesRequest.JSON_PROPERTY_LIMIT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListNamespacesRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + @javax.annotation.Nullable private Integer limit; + + public ListNamespacesRequest() {} + + public ListNamespacesRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public ListNamespacesRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public ListNamespacesRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public ListNamespacesRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public ListNamespacesRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public ListNamespacesRequest pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + public ListNamespacesRequest limit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + return this; + } + + /** + * An inclusive upper bound of the number of results that a caller will receive. + * + * @return limit + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + } + + /** Return true if this ListNamespacesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListNamespacesRequest listNamespacesRequest = (ListNamespacesRequest) o; + return Objects.equals(this.identity, listNamespacesRequest.identity) + && Objects.equals(this.context, listNamespacesRequest.context) + && Objects.equals(this.id, listNamespacesRequest.id) + && Objects.equals(this.pageToken, listNamespacesRequest.pageToken) + && Objects.equals(this.limit, listNamespacesRequest.limit); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, pageToken, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListNamespacesRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + // add `limit` to the URL query string + if (getLimit() != null) { + joiner.add( + String.format( + "%slimit%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListNamespacesResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListNamespacesResponse.java new file mode 100644 index 000000000..f325339f4 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListNamespacesResponse.java @@ -0,0 +1,206 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +import java.util.LinkedHashSet; +import java.util.Objects; +import java.util.Set; +import java.util.StringJoiner; + +/** ListNamespacesResponse */ +@JsonPropertyOrder({ + ListNamespacesResponse.JSON_PROPERTY_NAMESPACES, + ListNamespacesResponse.JSON_PROPERTY_PAGE_TOKEN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListNamespacesResponse { + public static final String JSON_PROPERTY_NAMESPACES = "namespaces"; + @javax.annotation.Nonnull private Set namespaces = new LinkedHashSet<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public ListNamespacesResponse() {} + + public ListNamespacesResponse namespaces(@javax.annotation.Nonnull Set namespaces) { + this.namespaces = namespaces; + return this; + } + + public ListNamespacesResponse addNamespacesItem(String namespacesItem) { + if (this.namespaces == null) { + this.namespaces = new LinkedHashSet<>(); + } + this.namespaces.add(namespacesItem); + return this; + } + + /** + * The list of names of the child namespaces relative to the parent namespace `id` in + * the request. + * + * @return namespaces + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAMESPACES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Set getNamespaces() { + return namespaces; + } + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_NAMESPACES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNamespaces(@javax.annotation.Nonnull Set namespaces) { + this.namespaces = namespaces; + } + + public ListNamespacesResponse pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + /** Return true if this ListNamespacesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListNamespacesResponse listNamespacesResponse = (ListNamespacesResponse) o; + return Objects.equals(this.namespaces, listNamespacesResponse.namespaces) + && Objects.equals(this.pageToken, listNamespacesResponse.pageToken); + } + + @Override + public int hashCode() { + return Objects.hash(namespaces, pageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListNamespacesResponse {\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `namespaces` to the URL query string + if (getNamespaces() != null) { + int i = 0; + for (String _item : getNamespaces()) { + joiner.add( + String.format( + "%snamespaces%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(_item)))); + } + i++; + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableIndicesRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableIndicesRequest.java new file mode 100644 index 000000000..94851f2d6 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableIndicesRequest.java @@ -0,0 +1,368 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListTableIndicesRequest */ +@JsonPropertyOrder({ + ListTableIndicesRequest.JSON_PROPERTY_IDENTITY, + ListTableIndicesRequest.JSON_PROPERTY_CONTEXT, + ListTableIndicesRequest.JSON_PROPERTY_ID, + ListTableIndicesRequest.JSON_PROPERTY_VERSION, + ListTableIndicesRequest.JSON_PROPERTY_PAGE_TOKEN, + ListTableIndicesRequest.JSON_PROPERTY_LIMIT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTableIndicesRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + @javax.annotation.Nullable private Integer limit; + + public ListTableIndicesRequest() {} + + public ListTableIndicesRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public ListTableIndicesRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public ListTableIndicesRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public ListTableIndicesRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public ListTableIndicesRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The namespace identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public ListTableIndicesRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Optional table version to list indexes from minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public ListTableIndicesRequest pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + public ListTableIndicesRequest limit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + return this; + } + + /** + * An inclusive upper bound of the number of results that a caller will receive. + * + * @return limit + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + } + + /** Return true if this ListTableIndicesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTableIndicesRequest listTableIndicesRequest = (ListTableIndicesRequest) o; + return Objects.equals(this.identity, listTableIndicesRequest.identity) + && Objects.equals(this.context, listTableIndicesRequest.context) + && Objects.equals(this.id, listTableIndicesRequest.id) + && Objects.equals(this.version, listTableIndicesRequest.version) + && Objects.equals(this.pageToken, listTableIndicesRequest.pageToken) + && Objects.equals(this.limit, listTableIndicesRequest.limit); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, version, pageToken, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTableIndicesRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + // add `limit` to the URL query string + if (getLimit() != null) { + joiner.add( + String.format( + "%slimit%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableIndicesResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableIndicesResponse.java new file mode 100644 index 000000000..d32e78657 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableIndicesResponse.java @@ -0,0 +1,205 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListTableIndicesResponse */ +@JsonPropertyOrder({ + ListTableIndicesResponse.JSON_PROPERTY_INDEXES, + ListTableIndicesResponse.JSON_PROPERTY_PAGE_TOKEN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTableIndicesResponse { + public static final String JSON_PROPERTY_INDEXES = "indexes"; + @javax.annotation.Nonnull private List indexes = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public ListTableIndicesResponse() {} + + public ListTableIndicesResponse indexes(@javax.annotation.Nonnull List indexes) { + this.indexes = indexes; + return this; + } + + public ListTableIndicesResponse addIndexesItem(IndexContent indexesItem) { + if (this.indexes == null) { + this.indexes = new ArrayList<>(); + } + this.indexes.add(indexesItem); + return this; + } + + /** + * List of indexes on the table + * + * @return indexes + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INDEXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIndexes() { + return indexes; + } + + @JsonProperty(JSON_PROPERTY_INDEXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndexes(@javax.annotation.Nonnull List indexes) { + this.indexes = indexes; + } + + public ListTableIndicesResponse pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + /** Return true if this ListTableIndicesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTableIndicesResponse listTableIndicesResponse = (ListTableIndicesResponse) o; + return Objects.equals(this.indexes, listTableIndicesResponse.indexes) + && Objects.equals(this.pageToken, listTableIndicesResponse.pageToken); + } + + @Override + public int hashCode() { + return Objects.hash(indexes, pageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTableIndicesResponse {\n"); + sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `indexes` to the URL query string + if (getIndexes() != null) { + for (int i = 0; i < getIndexes().size(); i++) { + if (getIndexes().get(i) != null) { + joiner.add( + getIndexes() + .get(i) + .toUrlQueryString( + String.format( + "%sindexes%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableTagsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableTagsRequest.java new file mode 100644 index 000000000..a522780e8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableTagsRequest.java @@ -0,0 +1,331 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListTableTagsRequest */ +@JsonPropertyOrder({ + ListTableTagsRequest.JSON_PROPERTY_IDENTITY, + ListTableTagsRequest.JSON_PROPERTY_CONTEXT, + ListTableTagsRequest.JSON_PROPERTY_ID, + ListTableTagsRequest.JSON_PROPERTY_PAGE_TOKEN, + ListTableTagsRequest.JSON_PROPERTY_LIMIT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTableTagsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + @javax.annotation.Nullable private Integer limit; + + public ListTableTagsRequest() {} + + public ListTableTagsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public ListTableTagsRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public ListTableTagsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public ListTableTagsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public ListTableTagsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public ListTableTagsRequest pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + public ListTableTagsRequest limit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + return this; + } + + /** + * An inclusive upper bound of the number of results that a caller will receive. + * + * @return limit + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + } + + /** Return true if this ListTableTagsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTableTagsRequest listTableTagsRequest = (ListTableTagsRequest) o; + return Objects.equals(this.identity, listTableTagsRequest.identity) + && Objects.equals(this.context, listTableTagsRequest.context) + && Objects.equals(this.id, listTableTagsRequest.id) + && Objects.equals(this.pageToken, listTableTagsRequest.pageToken) + && Objects.equals(this.limit, listTableTagsRequest.limit); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, pageToken, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTableTagsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + // add `limit` to the URL query string + if (getLimit() != null) { + joiner.add( + String.format( + "%slimit%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableTagsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableTagsResponse.java new file mode 100644 index 000000000..0ce6c1b87 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableTagsResponse.java @@ -0,0 +1,205 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Response containing table tags */ +@JsonPropertyOrder({ + ListTableTagsResponse.JSON_PROPERTY_TAGS, + ListTableTagsResponse.JSON_PROPERTY_PAGE_TOKEN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTableTagsResponse { + public static final String JSON_PROPERTY_TAGS = "tags"; + @javax.annotation.Nonnull private Map tags = new HashMap<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public ListTableTagsResponse() {} + + public ListTableTagsResponse tags(@javax.annotation.Nonnull Map tags) { + this.tags = tags; + return this; + } + + public ListTableTagsResponse putTagsItem(String key, TagContents tagsItem) { + if (this.tags == null) { + this.tags = new HashMap<>(); + } + this.tags.put(key, tagsItem); + return this; + } + + /** + * Map of tag names to their contents + * + * @return tags + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTags(@javax.annotation.Nonnull Map tags) { + this.tags = tags; + } + + public ListTableTagsResponse pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + /** Return true if this ListTableTagsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTableTagsResponse listTableTagsResponse = (ListTableTagsResponse) o; + return Objects.equals(this.tags, listTableTagsResponse.tags) + && Objects.equals(this.pageToken, listTableTagsResponse.pageToken); + } + + @Override + public int hashCode() { + return Objects.hash(tags, pageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTableTagsResponse {\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `tags` to the URL query string + if (getTags() != null) { + for (String _key : getTags().keySet()) { + if (getTags().get(_key) != null) { + joiner.add( + getTags() + .get(_key) + .toUrlQueryString( + String.format( + "%stags%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableVersionsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableVersionsRequest.java new file mode 100644 index 000000000..4cbc0e608 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableVersionsRequest.java @@ -0,0 +1,369 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListTableVersionsRequest */ +@JsonPropertyOrder({ + ListTableVersionsRequest.JSON_PROPERTY_IDENTITY, + ListTableVersionsRequest.JSON_PROPERTY_CONTEXT, + ListTableVersionsRequest.JSON_PROPERTY_ID, + ListTableVersionsRequest.JSON_PROPERTY_PAGE_TOKEN, + ListTableVersionsRequest.JSON_PROPERTY_LIMIT, + ListTableVersionsRequest.JSON_PROPERTY_DESCENDING +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTableVersionsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + @javax.annotation.Nullable private Integer limit; + + public static final String JSON_PROPERTY_DESCENDING = "descending"; + @javax.annotation.Nullable private Boolean descending; + + public ListTableVersionsRequest() {} + + public ListTableVersionsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public ListTableVersionsRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public ListTableVersionsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public ListTableVersionsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public ListTableVersionsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public ListTableVersionsRequest pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + public ListTableVersionsRequest limit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + return this; + } + + /** + * An inclusive upper bound of the number of results that a caller will receive. + * + * @return limit + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + } + + public ListTableVersionsRequest descending(@javax.annotation.Nullable Boolean descending) { + this.descending = descending; + return this; + } + + /** + * When true, versions are guaranteed to be returned in descending order (latest to oldest). When + * false or not specified, the ordering is implementation-defined. + * + * @return descending + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCENDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDescending() { + return descending; + } + + @JsonProperty(JSON_PROPERTY_DESCENDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescending(@javax.annotation.Nullable Boolean descending) { + this.descending = descending; + } + + /** Return true if this ListTableVersionsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTableVersionsRequest listTableVersionsRequest = (ListTableVersionsRequest) o; + return Objects.equals(this.identity, listTableVersionsRequest.identity) + && Objects.equals(this.context, listTableVersionsRequest.context) + && Objects.equals(this.id, listTableVersionsRequest.id) + && Objects.equals(this.pageToken, listTableVersionsRequest.pageToken) + && Objects.equals(this.limit, listTableVersionsRequest.limit) + && Objects.equals(this.descending, listTableVersionsRequest.descending); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, pageToken, limit, descending); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTableVersionsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" descending: ").append(toIndentedString(descending)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + // add `limit` to the URL query string + if (getLimit() != null) { + joiner.add( + String.format( + "%slimit%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + // add `descending` to the URL query string + if (getDescending() != null) { + joiner.add( + String.format( + "%sdescending%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDescending())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableVersionsResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableVersionsResponse.java new file mode 100644 index 000000000..65c3b4f30 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTableVersionsResponse.java @@ -0,0 +1,206 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListTableVersionsResponse */ +@JsonPropertyOrder({ + ListTableVersionsResponse.JSON_PROPERTY_VERSIONS, + ListTableVersionsResponse.JSON_PROPERTY_PAGE_TOKEN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTableVersionsResponse { + public static final String JSON_PROPERTY_VERSIONS = "versions"; + @javax.annotation.Nonnull private List versions = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public ListTableVersionsResponse() {} + + public ListTableVersionsResponse versions(@javax.annotation.Nonnull List versions) { + this.versions = versions; + return this; + } + + public ListTableVersionsResponse addVersionsItem(TableVersion versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList<>(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * List of table versions. When `descending=true`, guaranteed to be ordered from + * latest to oldest. Otherwise, ordering is implementation-defined. + * + * @return versions + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getVersions() { + return versions; + } + + @JsonProperty(JSON_PROPERTY_VERSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersions(@javax.annotation.Nonnull List versions) { + this.versions = versions; + } + + public ListTableVersionsResponse pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + /** Return true if this ListTableVersionsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTableVersionsResponse listTableVersionsResponse = (ListTableVersionsResponse) o; + return Objects.equals(this.versions, listTableVersionsResponse.versions) + && Objects.equals(this.pageToken, listTableVersionsResponse.pageToken); + } + + @Override + public int hashCode() { + return Objects.hash(versions, pageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTableVersionsResponse {\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `versions` to the URL query string + if (getVersions() != null) { + for (int i = 0; i < getVersions().size(); i++) { + if (getVersions().get(i) != null) { + joiner.add( + getVersions() + .get(i) + .toUrlQueryString( + String.format( + "%sversions%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTablesRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTablesRequest.java new file mode 100644 index 000000000..37b229b09 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTablesRequest.java @@ -0,0 +1,331 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** ListTablesRequest */ +@JsonPropertyOrder({ + ListTablesRequest.JSON_PROPERTY_IDENTITY, + ListTablesRequest.JSON_PROPERTY_CONTEXT, + ListTablesRequest.JSON_PROPERTY_ID, + ListTablesRequest.JSON_PROPERTY_PAGE_TOKEN, + ListTablesRequest.JSON_PROPERTY_LIMIT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTablesRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + @javax.annotation.Nullable private Integer limit; + + public ListTablesRequest() {} + + public ListTablesRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public ListTablesRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public ListTablesRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public ListTablesRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public ListTablesRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public ListTablesRequest pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + public ListTablesRequest limit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + return this; + } + + /** + * An inclusive upper bound of the number of results that a caller will receive. + * + * @return limit + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimit(@javax.annotation.Nullable Integer limit) { + this.limit = limit; + } + + /** Return true if this ListTablesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTablesRequest listTablesRequest = (ListTablesRequest) o; + return Objects.equals(this.identity, listTablesRequest.identity) + && Objects.equals(this.context, listTablesRequest.context) + && Objects.equals(this.id, listTablesRequest.id) + && Objects.equals(this.pageToken, listTablesRequest.pageToken) + && Objects.equals(this.limit, listTablesRequest.limit); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, pageToken, limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTablesRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + // add `limit` to the URL query string + if (getLimit() != null) { + joiner.add( + String.format( + "%slimit%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLimit())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTablesResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTablesResponse.java new file mode 100644 index 000000000..cd457355e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/ListTablesResponse.java @@ -0,0 +1,207 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +import java.util.LinkedHashSet; +import java.util.Objects; +import java.util.Set; +import java.util.StringJoiner; + +/** ListTablesResponse */ +@JsonPropertyOrder({ + ListTablesResponse.JSON_PROPERTY_TABLES, + ListTablesResponse.JSON_PROPERTY_PAGE_TOKEN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ListTablesResponse { + public static final String JSON_PROPERTY_TABLES = "tables"; + @javax.annotation.Nonnull private Set tables = new LinkedHashSet<>(); + + public static final String JSON_PROPERTY_PAGE_TOKEN = "page_token"; + @javax.annotation.Nullable private String pageToken; + + public ListTablesResponse() {} + + public ListTablesResponse tables(@javax.annotation.Nonnull Set tables) { + this.tables = tables; + return this; + } + + public ListTablesResponse addTablesItem(String tablesItem) { + if (this.tables == null) { + this.tables = new LinkedHashSet<>(); + } + this.tables.add(tablesItem); + return this; + } + + /** + * The list of names of all the tables under the connected namespace implementation. This should + * recursively list all the tables in all child namespaces. Each string in the list is the full + * identifier in string form. + * + * @return tables + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TABLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Set getTables() { + return tables; + } + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_TABLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTables(@javax.annotation.Nonnull Set tables) { + this.tables = tables; + } + + public ListTablesResponse pageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an + * initial request of a list operation, if the implementation cannot return all items in one + * response, or if there are more items than the page limit specified in the request, the + * implementation must return a page token in the response, indicating there are more results + * available. After the initial request, the value of the page token from each response must be + * used as the page token value for the next request. Caller must interpret either + * `null`, missing value or empty string value of the page token from the + * implementation's response as the end of the listing results. + * + * @return pageToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageToken() { + return pageToken; + } + + @JsonProperty(JSON_PROPERTY_PAGE_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageToken(@javax.annotation.Nullable String pageToken) { + this.pageToken = pageToken; + } + + /** Return true if this ListTablesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTablesResponse listTablesResponse = (ListTablesResponse) o; + return Objects.equals(this.tables, listTablesResponse.tables) + && Objects.equals(this.pageToken, listTablesResponse.pageToken); + } + + @Override + public int hashCode() { + return Objects.hash(tables, pageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTablesResponse {\n"); + sb.append(" tables: ").append(toIndentedString(tables)).append("\n"); + sb.append(" pageToken: ").append(toIndentedString(pageToken)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `tables` to the URL query string + if (getTables() != null) { + int i = 0; + for (String _item : getTables()) { + joiner.add( + String.format( + "%stables%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(_item)))); + } + i++; + } + + // add `page_token` to the URL query string + if (getPageToken() != null) { + joiner.add( + String.format( + "%spage_token%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageToken())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MatchQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MatchQuery.java new file mode 100644 index 000000000..c4f6026e8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MatchQuery.java @@ -0,0 +1,363 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** MatchQuery */ +@JsonPropertyOrder({ + MatchQuery.JSON_PROPERTY_BOOST, + MatchQuery.JSON_PROPERTY_COLUMN, + MatchQuery.JSON_PROPERTY_FUZZINESS, + MatchQuery.JSON_PROPERTY_MAX_EXPANSIONS, + MatchQuery.JSON_PROPERTY_OPERATOR, + MatchQuery.JSON_PROPERTY_PREFIX_LENGTH, + MatchQuery.JSON_PROPERTY_TERMS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MatchQuery { + public static final String JSON_PROPERTY_BOOST = "boost"; + @javax.annotation.Nullable private Float boost; + + public static final String JSON_PROPERTY_COLUMN = "column"; + @javax.annotation.Nullable private String column; + + public static final String JSON_PROPERTY_FUZZINESS = "fuzziness"; + @javax.annotation.Nullable private Integer fuzziness; + + public static final String JSON_PROPERTY_MAX_EXPANSIONS = "max_expansions"; + @javax.annotation.Nullable private Integer maxExpansions; + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + @javax.annotation.Nullable private String operator; + + public static final String JSON_PROPERTY_PREFIX_LENGTH = "prefix_length"; + @javax.annotation.Nullable private Integer prefixLength; + + public static final String JSON_PROPERTY_TERMS = "terms"; + @javax.annotation.Nonnull private String terms; + + public MatchQuery() {} + + public MatchQuery boost(@javax.annotation.Nullable Float boost) { + this.boost = boost; + return this; + } + + /** + * Get boost + * + * @return boost + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getBoost() { + return boost; + } + + @JsonProperty(JSON_PROPERTY_BOOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBoost(@javax.annotation.Nullable Float boost) { + this.boost = boost; + } + + public MatchQuery column(@javax.annotation.Nullable String column) { + this.column = column; + return this; + } + + /** + * Get column + * + * @return column + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColumn() { + return column; + } + + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumn(@javax.annotation.Nullable String column) { + this.column = column; + } + + public MatchQuery fuzziness(@javax.annotation.Nullable Integer fuzziness) { + this.fuzziness = fuzziness; + return this; + } + + /** + * Get fuzziness minimum: 0 + * + * @return fuzziness + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FUZZINESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFuzziness() { + return fuzziness; + } + + @JsonProperty(JSON_PROPERTY_FUZZINESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFuzziness(@javax.annotation.Nullable Integer fuzziness) { + this.fuzziness = fuzziness; + } + + public MatchQuery maxExpansions(@javax.annotation.Nullable Integer maxExpansions) { + this.maxExpansions = maxExpansions; + return this; + } + + /** + * The maximum number of terms to expand for fuzzy matching. Default to 50. minimum: 0 + * + * @return maxExpansions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_EXPANSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxExpansions() { + return maxExpansions; + } + + @JsonProperty(JSON_PROPERTY_MAX_EXPANSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxExpansions(@javax.annotation.Nullable Integer maxExpansions) { + this.maxExpansions = maxExpansions; + } + + public MatchQuery operator(@javax.annotation.Nullable String operator) { + this.operator = operator; + return this; + } + + /** + * The operator to use for combining terms. Case insensitive, supports both PascalCase and + * snake_case. Valid values are: - And: All terms must match. - Or: At least one term must match. + * + * @return operator + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperator() { + return operator; + } + + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperator(@javax.annotation.Nullable String operator) { + this.operator = operator; + } + + public MatchQuery prefixLength(@javax.annotation.Nullable Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * The number of beginning characters being unchanged for fuzzy matching. Default to 0. minimum: 0 + * + * @return prefixLength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixLength() { + return prefixLength; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixLength(@javax.annotation.Nullable Integer prefixLength) { + this.prefixLength = prefixLength; + } + + public MatchQuery terms(@javax.annotation.Nonnull String terms) { + this.terms = terms; + return this; + } + + /** + * Get terms + * + * @return terms + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TERMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTerms() { + return terms; + } + + @JsonProperty(JSON_PROPERTY_TERMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTerms(@javax.annotation.Nonnull String terms) { + this.terms = terms; + } + + /** Return true if this MatchQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MatchQuery matchQuery = (MatchQuery) o; + return Objects.equals(this.boost, matchQuery.boost) + && Objects.equals(this.column, matchQuery.column) + && Objects.equals(this.fuzziness, matchQuery.fuzziness) + && Objects.equals(this.maxExpansions, matchQuery.maxExpansions) + && Objects.equals(this.operator, matchQuery.operator) + && Objects.equals(this.prefixLength, matchQuery.prefixLength) + && Objects.equals(this.terms, matchQuery.terms); + } + + @Override + public int hashCode() { + return Objects.hash(boost, column, fuzziness, maxExpansions, operator, prefixLength, terms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MatchQuery {\n"); + sb.append(" boost: ").append(toIndentedString(boost)).append("\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" fuzziness: ").append(toIndentedString(fuzziness)).append("\n"); + sb.append(" maxExpansions: ").append(toIndentedString(maxExpansions)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).append("\n"); + sb.append(" terms: ").append(toIndentedString(terms)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `boost` to the URL query string + if (getBoost() != null) { + joiner.add( + String.format( + "%sboost%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBoost())))); + } + + // add `column` to the URL query string + if (getColumn() != null) { + joiner.add( + String.format( + "%scolumn%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getColumn())))); + } + + // add `fuzziness` to the URL query string + if (getFuzziness() != null) { + joiner.add( + String.format( + "%sfuzziness%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFuzziness())))); + } + + // add `max_expansions` to the URL query string + if (getMaxExpansions() != null) { + joiner.add( + String.format( + "%smax_expansions%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMaxExpansions())))); + } + + // add `operator` to the URL query string + if (getOperator() != null) { + joiner.add( + String.format( + "%soperator%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOperator())))); + } + + // add `prefix_length` to the URL query string + if (getPrefixLength() != null) { + joiner.add( + String.format( + "%sprefix_length%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPrefixLength())))); + } + + // add `terms` to the URL query string + if (getTerms() != null) { + joiner.add( + String.format( + "%sterms%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTerms())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MergeInsertIntoTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MergeInsertIntoTableRequest.java new file mode 100644 index 000000000..e5bb4ffa3 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MergeInsertIntoTableRequest.java @@ -0,0 +1,598 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Request for merging or inserting records into a table, excluding the Arrow IPC stream. */ +@JsonPropertyOrder({ + MergeInsertIntoTableRequest.JSON_PROPERTY_IDENTITY, + MergeInsertIntoTableRequest.JSON_PROPERTY_CONTEXT, + MergeInsertIntoTableRequest.JSON_PROPERTY_ID, + MergeInsertIntoTableRequest.JSON_PROPERTY_ON, + MergeInsertIntoTableRequest.JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL, + MergeInsertIntoTableRequest.JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL_FILT, + MergeInsertIntoTableRequest.JSON_PROPERTY_WHEN_NOT_MATCHED_INSERT_ALL, + MergeInsertIntoTableRequest.JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE, + MergeInsertIntoTableRequest.JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE_FILT, + MergeInsertIntoTableRequest.JSON_PROPERTY_TIMEOUT, + MergeInsertIntoTableRequest.JSON_PROPERTY_USE_INDEX +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MergeInsertIntoTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_ON = "on"; + @javax.annotation.Nullable private String on; + + public static final String JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL = "when_matched_update_all"; + @javax.annotation.Nullable private Boolean whenMatchedUpdateAll = false; + + public static final String JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL_FILT = + "when_matched_update_all_filt"; + @javax.annotation.Nullable private String whenMatchedUpdateAllFilt; + + public static final String JSON_PROPERTY_WHEN_NOT_MATCHED_INSERT_ALL = + "when_not_matched_insert_all"; + @javax.annotation.Nullable private Boolean whenNotMatchedInsertAll = false; + + public static final String JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE = + "when_not_matched_by_source_delete"; + @javax.annotation.Nullable private Boolean whenNotMatchedBySourceDelete = false; + + public static final String JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE_FILT = + "when_not_matched_by_source_delete_filt"; + @javax.annotation.Nullable private String whenNotMatchedBySourceDeleteFilt; + + public static final String JSON_PROPERTY_TIMEOUT = "timeout"; + @javax.annotation.Nullable private String timeout; + + public static final String JSON_PROPERTY_USE_INDEX = "use_index"; + @javax.annotation.Nullable private Boolean useIndex = false; + + public MergeInsertIntoTableRequest() {} + + public MergeInsertIntoTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public MergeInsertIntoTableRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public MergeInsertIntoTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public MergeInsertIntoTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public MergeInsertIntoTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public MergeInsertIntoTableRequest on(@javax.annotation.Nullable String on) { + this.on = on; + return this; + } + + /** + * Column name to use for matching rows (required) + * + * @return on + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOn() { + return on; + } + + @JsonProperty(JSON_PROPERTY_ON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOn(@javax.annotation.Nullable String on) { + this.on = on; + } + + public MergeInsertIntoTableRequest whenMatchedUpdateAll( + @javax.annotation.Nullable Boolean whenMatchedUpdateAll) { + this.whenMatchedUpdateAll = whenMatchedUpdateAll; + return this; + } + + /** + * Update all columns when rows match + * + * @return whenMatchedUpdateAll + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWhenMatchedUpdateAll() { + return whenMatchedUpdateAll; + } + + @JsonProperty(JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhenMatchedUpdateAll(@javax.annotation.Nullable Boolean whenMatchedUpdateAll) { + this.whenMatchedUpdateAll = whenMatchedUpdateAll; + } + + public MergeInsertIntoTableRequest whenMatchedUpdateAllFilt( + @javax.annotation.Nullable String whenMatchedUpdateAllFilt) { + this.whenMatchedUpdateAllFilt = whenMatchedUpdateAllFilt; + return this; + } + + /** + * The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to + * true + * + * @return whenMatchedUpdateAllFilt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL_FILT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWhenMatchedUpdateAllFilt() { + return whenMatchedUpdateAllFilt; + } + + @JsonProperty(JSON_PROPERTY_WHEN_MATCHED_UPDATE_ALL_FILT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhenMatchedUpdateAllFilt( + @javax.annotation.Nullable String whenMatchedUpdateAllFilt) { + this.whenMatchedUpdateAllFilt = whenMatchedUpdateAllFilt; + } + + public MergeInsertIntoTableRequest whenNotMatchedInsertAll( + @javax.annotation.Nullable Boolean whenNotMatchedInsertAll) { + this.whenNotMatchedInsertAll = whenNotMatchedInsertAll; + return this; + } + + /** + * Insert all columns when rows don't match + * + * @return whenNotMatchedInsertAll + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHEN_NOT_MATCHED_INSERT_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWhenNotMatchedInsertAll() { + return whenNotMatchedInsertAll; + } + + @JsonProperty(JSON_PROPERTY_WHEN_NOT_MATCHED_INSERT_ALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhenNotMatchedInsertAll( + @javax.annotation.Nullable Boolean whenNotMatchedInsertAll) { + this.whenNotMatchedInsertAll = whenNotMatchedInsertAll; + } + + public MergeInsertIntoTableRequest whenNotMatchedBySourceDelete( + @javax.annotation.Nullable Boolean whenNotMatchedBySourceDelete) { + this.whenNotMatchedBySourceDelete = whenNotMatchedBySourceDelete; + return this; + } + + /** + * Delete all rows from target table that don't match a row in the source table + * + * @return whenNotMatchedBySourceDelete + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWhenNotMatchedBySourceDelete() { + return whenNotMatchedBySourceDelete; + } + + @JsonProperty(JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhenNotMatchedBySourceDelete( + @javax.annotation.Nullable Boolean whenNotMatchedBySourceDelete) { + this.whenNotMatchedBySourceDelete = whenNotMatchedBySourceDelete; + } + + public MergeInsertIntoTableRequest whenNotMatchedBySourceDeleteFilt( + @javax.annotation.Nullable String whenNotMatchedBySourceDeleteFilt) { + this.whenNotMatchedBySourceDeleteFilt = whenNotMatchedBySourceDeleteFilt; + return this; + } + + /** + * Delete rows from the target table if there is no match AND the SQL expression evaluates to true + * + * @return whenNotMatchedBySourceDeleteFilt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE_FILT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWhenNotMatchedBySourceDeleteFilt() { + return whenNotMatchedBySourceDeleteFilt; + } + + @JsonProperty(JSON_PROPERTY_WHEN_NOT_MATCHED_BY_SOURCE_DELETE_FILT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhenNotMatchedBySourceDeleteFilt( + @javax.annotation.Nullable String whenNotMatchedBySourceDeleteFilt) { + this.whenNotMatchedBySourceDeleteFilt = whenNotMatchedBySourceDeleteFilt; + } + + public MergeInsertIntoTableRequest timeout(@javax.annotation.Nullable String timeout) { + this.timeout = timeout; + return this; + } + + /** + * Timeout for the operation (e.g., \"30s\", \"5m\") + * + * @return timeout + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimeout() { + return timeout; + } + + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeout(@javax.annotation.Nullable String timeout) { + this.timeout = timeout; + } + + public MergeInsertIntoTableRequest useIndex(@javax.annotation.Nullable Boolean useIndex) { + this.useIndex = useIndex; + return this; + } + + /** + * Whether to use index for matching rows + * + * @return useIndex + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseIndex() { + return useIndex; + } + + @JsonProperty(JSON_PROPERTY_USE_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseIndex(@javax.annotation.Nullable Boolean useIndex) { + this.useIndex = useIndex; + } + + /** Return true if this MergeInsertIntoTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeInsertIntoTableRequest mergeInsertIntoTableRequest = (MergeInsertIntoTableRequest) o; + return Objects.equals(this.identity, mergeInsertIntoTableRequest.identity) + && Objects.equals(this.context, mergeInsertIntoTableRequest.context) + && Objects.equals(this.id, mergeInsertIntoTableRequest.id) + && Objects.equals(this.on, mergeInsertIntoTableRequest.on) + && Objects.equals( + this.whenMatchedUpdateAll, mergeInsertIntoTableRequest.whenMatchedUpdateAll) + && Objects.equals( + this.whenMatchedUpdateAllFilt, mergeInsertIntoTableRequest.whenMatchedUpdateAllFilt) + && Objects.equals( + this.whenNotMatchedInsertAll, mergeInsertIntoTableRequest.whenNotMatchedInsertAll) + && Objects.equals( + this.whenNotMatchedBySourceDelete, + mergeInsertIntoTableRequest.whenNotMatchedBySourceDelete) + && Objects.equals( + this.whenNotMatchedBySourceDeleteFilt, + mergeInsertIntoTableRequest.whenNotMatchedBySourceDeleteFilt) + && Objects.equals(this.timeout, mergeInsertIntoTableRequest.timeout) + && Objects.equals(this.useIndex, mergeInsertIntoTableRequest.useIndex); + } + + @Override + public int hashCode() { + return Objects.hash( + identity, + context, + id, + on, + whenMatchedUpdateAll, + whenMatchedUpdateAllFilt, + whenNotMatchedInsertAll, + whenNotMatchedBySourceDelete, + whenNotMatchedBySourceDeleteFilt, + timeout, + useIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeInsertIntoTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" on: ").append(toIndentedString(on)).append("\n"); + sb.append(" whenMatchedUpdateAll: ") + .append(toIndentedString(whenMatchedUpdateAll)) + .append("\n"); + sb.append(" whenMatchedUpdateAllFilt: ") + .append(toIndentedString(whenMatchedUpdateAllFilt)) + .append("\n"); + sb.append(" whenNotMatchedInsertAll: ") + .append(toIndentedString(whenNotMatchedInsertAll)) + .append("\n"); + sb.append(" whenNotMatchedBySourceDelete: ") + .append(toIndentedString(whenNotMatchedBySourceDelete)) + .append("\n"); + sb.append(" whenNotMatchedBySourceDeleteFilt: ") + .append(toIndentedString(whenNotMatchedBySourceDeleteFilt)) + .append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" useIndex: ").append(toIndentedString(useIndex)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `on` to the URL query string + if (getOn() != null) { + joiner.add( + String.format( + "%son%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOn())))); + } + + // add `when_matched_update_all` to the URL query string + if (getWhenMatchedUpdateAll() != null) { + joiner.add( + String.format( + "%swhen_matched_update_all%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhenMatchedUpdateAll())))); + } + + // add `when_matched_update_all_filt` to the URL query string + if (getWhenMatchedUpdateAllFilt() != null) { + joiner.add( + String.format( + "%swhen_matched_update_all_filt%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhenMatchedUpdateAllFilt())))); + } + + // add `when_not_matched_insert_all` to the URL query string + if (getWhenNotMatchedInsertAll() != null) { + joiner.add( + String.format( + "%swhen_not_matched_insert_all%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhenNotMatchedInsertAll())))); + } + + // add `when_not_matched_by_source_delete` to the URL query string + if (getWhenNotMatchedBySourceDelete() != null) { + joiner.add( + String.format( + "%swhen_not_matched_by_source_delete%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhenNotMatchedBySourceDelete())))); + } + + // add `when_not_matched_by_source_delete_filt` to the URL query string + if (getWhenNotMatchedBySourceDeleteFilt() != null) { + joiner.add( + String.format( + "%swhen_not_matched_by_source_delete_filt%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getWhenNotMatchedBySourceDeleteFilt())))); + } + + // add `timeout` to the URL query string + if (getTimeout() != null) { + joiner.add( + String.format( + "%stimeout%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimeout())))); + } + + // add `use_index` to the URL query string + if (getUseIndex() != null) { + joiner.add( + String.format( + "%suse_index%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUseIndex())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MergeInsertIntoTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MergeInsertIntoTableResponse.java new file mode 100644 index 000000000..7bd9dc18b --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MergeInsertIntoTableResponse.java @@ -0,0 +1,292 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response from merge insert operation */ +@JsonPropertyOrder({ + MergeInsertIntoTableResponse.JSON_PROPERTY_TRANSACTION_ID, + MergeInsertIntoTableResponse.JSON_PROPERTY_NUM_UPDATED_ROWS, + MergeInsertIntoTableResponse.JSON_PROPERTY_NUM_INSERTED_ROWS, + MergeInsertIntoTableResponse.JSON_PROPERTY_NUM_DELETED_ROWS, + MergeInsertIntoTableResponse.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MergeInsertIntoTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_NUM_UPDATED_ROWS = "num_updated_rows"; + @javax.annotation.Nullable private Long numUpdatedRows; + + public static final String JSON_PROPERTY_NUM_INSERTED_ROWS = "num_inserted_rows"; + @javax.annotation.Nullable private Long numInsertedRows; + + public static final String JSON_PROPERTY_NUM_DELETED_ROWS = "num_deleted_rows"; + @javax.annotation.Nullable private Long numDeletedRows; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public MergeInsertIntoTableResponse() {} + + public MergeInsertIntoTableResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public MergeInsertIntoTableResponse numUpdatedRows( + @javax.annotation.Nullable Long numUpdatedRows) { + this.numUpdatedRows = numUpdatedRows; + return this; + } + + /** + * Number of rows updated minimum: 0 + * + * @return numUpdatedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_UPDATED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumUpdatedRows() { + return numUpdatedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_UPDATED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumUpdatedRows(@javax.annotation.Nullable Long numUpdatedRows) { + this.numUpdatedRows = numUpdatedRows; + } + + public MergeInsertIntoTableResponse numInsertedRows( + @javax.annotation.Nullable Long numInsertedRows) { + this.numInsertedRows = numInsertedRows; + return this; + } + + /** + * Number of rows inserted minimum: 0 + * + * @return numInsertedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_INSERTED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumInsertedRows() { + return numInsertedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_INSERTED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumInsertedRows(@javax.annotation.Nullable Long numInsertedRows) { + this.numInsertedRows = numInsertedRows; + } + + public MergeInsertIntoTableResponse numDeletedRows( + @javax.annotation.Nullable Long numDeletedRows) { + this.numDeletedRows = numDeletedRows; + return this; + } + + /** + * Number of rows deleted (typically 0 for merge insert) minimum: 0 + * + * @return numDeletedRows + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_DELETED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumDeletedRows() { + return numDeletedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_DELETED_ROWS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumDeletedRows(@javax.annotation.Nullable Long numDeletedRows) { + this.numDeletedRows = numDeletedRows; + } + + public MergeInsertIntoTableResponse version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * The commit version associated with the operation minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + /** Return true if this MergeInsertIntoTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeInsertIntoTableResponse mergeInsertIntoTableResponse = (MergeInsertIntoTableResponse) o; + return Objects.equals(this.transactionId, mergeInsertIntoTableResponse.transactionId) + && Objects.equals(this.numUpdatedRows, mergeInsertIntoTableResponse.numUpdatedRows) + && Objects.equals(this.numInsertedRows, mergeInsertIntoTableResponse.numInsertedRows) + && Objects.equals(this.numDeletedRows, mergeInsertIntoTableResponse.numDeletedRows) + && Objects.equals(this.version, mergeInsertIntoTableResponse.version); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, numUpdatedRows, numInsertedRows, numDeletedRows, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeInsertIntoTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" numUpdatedRows: ").append(toIndentedString(numUpdatedRows)).append("\n"); + sb.append(" numInsertedRows: ").append(toIndentedString(numInsertedRows)).append("\n"); + sb.append(" numDeletedRows: ").append(toIndentedString(numDeletedRows)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `num_updated_rows` to the URL query string + if (getNumUpdatedRows() != null) { + joiner.add( + String.format( + "%snum_updated_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumUpdatedRows())))); + } + + // add `num_inserted_rows` to the URL query string + if (getNumInsertedRows() != null) { + joiner.add( + String.format( + "%snum_inserted_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumInsertedRows())))); + } + + // add `num_deleted_rows` to the URL query string + if (getNumDeletedRows() != null) { + joiner.add( + String.format( + "%snum_deleted_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumDeletedRows())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MultiMatchQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MultiMatchQuery.java new file mode 100644 index 000000000..ade063415 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/MultiMatchQuery.java @@ -0,0 +1,157 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** MultiMatchQuery */ +@JsonPropertyOrder({MultiMatchQuery.JSON_PROPERTY_MATCH_QUERIES}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class MultiMatchQuery { + public static final String JSON_PROPERTY_MATCH_QUERIES = "match_queries"; + @javax.annotation.Nonnull private List matchQueries = new ArrayList<>(); + + public MultiMatchQuery() {} + + public MultiMatchQuery matchQueries(@javax.annotation.Nonnull List matchQueries) { + this.matchQueries = matchQueries; + return this; + } + + public MultiMatchQuery addMatchQueriesItem(MatchQuery matchQueriesItem) { + if (this.matchQueries == null) { + this.matchQueries = new ArrayList<>(); + } + this.matchQueries.add(matchQueriesItem); + return this; + } + + /** + * Get matchQueries + * + * @return matchQueries + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MATCH_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMatchQueries() { + return matchQueries; + } + + @JsonProperty(JSON_PROPERTY_MATCH_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMatchQueries(@javax.annotation.Nonnull List matchQueries) { + this.matchQueries = matchQueries; + } + + /** Return true if this MultiMatchQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiMatchQuery multiMatchQuery = (MultiMatchQuery) o; + return Objects.equals(this.matchQueries, multiMatchQuery.matchQueries); + } + + @Override + public int hashCode() { + return Objects.hash(matchQueries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MultiMatchQuery {\n"); + sb.append(" matchQueries: ").append(toIndentedString(matchQueries)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `match_queries` to the URL query string + if (getMatchQueries() != null) { + for (int i = 0; i < getMatchQueries().size(); i++) { + if (getMatchQueries().get(i) != null) { + joiner.add( + getMatchQueries() + .get(i) + .toUrlQueryString( + String.format( + "%smatch_queries%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/NamespaceExistsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/NamespaceExistsRequest.java new file mode 100644 index 000000000..58b5774e7 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/NamespaceExistsRequest.java @@ -0,0 +1,250 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** NamespaceExistsRequest */ +@JsonPropertyOrder({ + NamespaceExistsRequest.JSON_PROPERTY_IDENTITY, + NamespaceExistsRequest.JSON_PROPERTY_CONTEXT, + NamespaceExistsRequest.JSON_PROPERTY_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NamespaceExistsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public NamespaceExistsRequest() {} + + public NamespaceExistsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public NamespaceExistsRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public NamespaceExistsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public NamespaceExistsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public NamespaceExistsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + /** Return true if this NamespaceExistsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NamespaceExistsRequest namespaceExistsRequest = (NamespaceExistsRequest) o; + return Objects.equals(this.identity, namespaceExistsRequest.identity) + && Objects.equals(this.context, namespaceExistsRequest.context) + && Objects.equals(this.id, namespaceExistsRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NamespaceExistsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/NewColumnTransform.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/NewColumnTransform.java new file mode 100644 index 000000000..23e0507bf --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/NewColumnTransform.java @@ -0,0 +1,212 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** NewColumnTransform */ +@JsonPropertyOrder({ + NewColumnTransform.JSON_PROPERTY_NAME, + NewColumnTransform.JSON_PROPERTY_EXPRESSION, + NewColumnTransform.JSON_PROPERTY_VIRTUAL_COLUMN +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewColumnTransform { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull private String name; + + public static final String JSON_PROPERTY_EXPRESSION = "expression"; + @javax.annotation.Nullable private String expression; + + public static final String JSON_PROPERTY_VIRTUAL_COLUMN = "virtual_column"; + @javax.annotation.Nullable private AddVirtualColumnEntry virtualColumn; + + public NewColumnTransform() {} + + public NewColumnTransform name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the new column + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + public NewColumnTransform expression(@javax.annotation.Nullable String expression) { + this.expression = expression; + return this; + } + + /** + * SQL expression to compute the column value (optional if virtual_column is specified) + * + * @return expression + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpression() { + return expression; + } + + @JsonProperty(JSON_PROPERTY_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpression(@javax.annotation.Nullable String expression) { + this.expression = expression; + } + + public NewColumnTransform virtualColumn( + @javax.annotation.Nullable AddVirtualColumnEntry virtualColumn) { + this.virtualColumn = virtualColumn; + return this; + } + + /** + * Virtual column definition (optional if expression is specified) + * + * @return virtualColumn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIRTUAL_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AddVirtualColumnEntry getVirtualColumn() { + return virtualColumn; + } + + @JsonProperty(JSON_PROPERTY_VIRTUAL_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualColumn(@javax.annotation.Nullable AddVirtualColumnEntry virtualColumn) { + this.virtualColumn = virtualColumn; + } + + /** Return true if this NewColumnTransform object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewColumnTransform newColumnTransform = (NewColumnTransform) o; + return Objects.equals(this.name, newColumnTransform.name) + && Objects.equals(this.expression, newColumnTransform.expression) + && Objects.equals(this.virtualColumn, newColumnTransform.virtualColumn); + } + + @Override + public int hashCode() { + return Objects.hash(name, expression, virtualColumn); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewColumnTransform {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" expression: ").append(toIndentedString(expression)).append("\n"); + sb.append(" virtualColumn: ").append(toIndentedString(virtualColumn)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `expression` to the URL query string + if (getExpression() != null) { + joiner.add( + String.format( + "%sexpression%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpression())))); + } + + // add `virtual_column` to the URL query string + if (getVirtualColumn() != null) { + joiner.add(getVirtualColumn().toUrlQueryString(prefix + "virtual_column" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionField.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionField.java new file mode 100644 index 000000000..4327dd12a --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionField.java @@ -0,0 +1,300 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** Partition field definition */ +@JsonPropertyOrder({ + PartitionField.JSON_PROPERTY_FIELD_ID, + PartitionField.JSON_PROPERTY_SOURCE_IDS, + PartitionField.JSON_PROPERTY_TRANSFORM, + PartitionField.JSON_PROPERTY_EXPRESSION, + PartitionField.JSON_PROPERTY_RESULT_TYPE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PartitionField { + public static final String JSON_PROPERTY_FIELD_ID = "field_id"; + @javax.annotation.Nonnull private String fieldId; + + public static final String JSON_PROPERTY_SOURCE_IDS = "source_ids"; + @javax.annotation.Nonnull private List sourceIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_TRANSFORM = "transform"; + @javax.annotation.Nullable private PartitionTransform transform; + + public static final String JSON_PROPERTY_EXPRESSION = "expression"; + @javax.annotation.Nullable private String expression; + + public static final String JSON_PROPERTY_RESULT_TYPE = "result_type"; + @javax.annotation.Nonnull private JsonArrowDataType resultType; + + public PartitionField() {} + + public PartitionField fieldId(@javax.annotation.Nonnull String fieldId) { + this.fieldId = fieldId; + return this; + } + + /** + * Unique identifier for this partition field (must not be renamed) + * + * @return fieldId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFieldId() { + return fieldId; + } + + @JsonProperty(JSON_PROPERTY_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFieldId(@javax.annotation.Nonnull String fieldId) { + this.fieldId = fieldId; + } + + public PartitionField sourceIds(@javax.annotation.Nonnull List sourceIds) { + this.sourceIds = sourceIds; + return this; + } + + public PartitionField addSourceIdsItem(Integer sourceIdsItem) { + if (this.sourceIds == null) { + this.sourceIds = new ArrayList<>(); + } + this.sourceIds.add(sourceIdsItem); + return this; + } + + /** + * Field IDs of the source columns in the schema + * + * @return sourceIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SOURCE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSourceIds() { + return sourceIds; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSourceIds(@javax.annotation.Nonnull List sourceIds) { + this.sourceIds = sourceIds; + } + + public PartitionField transform(@javax.annotation.Nullable PartitionTransform transform) { + this.transform = transform; + return this; + } + + /** + * Well-known partition transform. Exactly one of transform or expression must be specified. + * + * @return transform + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PartitionTransform getTransform() { + return transform; + } + + @JsonProperty(JSON_PROPERTY_TRANSFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransform(@javax.annotation.Nullable PartitionTransform transform) { + this.transform = transform; + } + + public PartitionField expression(@javax.annotation.Nullable String expression) { + this.expression = expression; + return this; + } + + /** + * DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform + * or expression must be specified. + * + * @return expression + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpression() { + return expression; + } + + @JsonProperty(JSON_PROPERTY_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpression(@javax.annotation.Nullable String expression) { + this.expression = expression; + } + + public PartitionField resultType(@javax.annotation.Nonnull JsonArrowDataType resultType) { + this.resultType = resultType; + return this; + } + + /** + * The output type of the partition value (JsonArrowDataType format) + * + * @return resultType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RESULT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JsonArrowDataType getResultType() { + return resultType; + } + + @JsonProperty(JSON_PROPERTY_RESULT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setResultType(@javax.annotation.Nonnull JsonArrowDataType resultType) { + this.resultType = resultType; + } + + /** Return true if this PartitionField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartitionField partitionField = (PartitionField) o; + return Objects.equals(this.fieldId, partitionField.fieldId) + && Objects.equals(this.sourceIds, partitionField.sourceIds) + && Objects.equals(this.transform, partitionField.transform) + && Objects.equals(this.expression, partitionField.expression) + && Objects.equals(this.resultType, partitionField.resultType); + } + + @Override + public int hashCode() { + return Objects.hash(fieldId, sourceIds, transform, expression, resultType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartitionField {\n"); + sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); + sb.append(" sourceIds: ").append(toIndentedString(sourceIds)).append("\n"); + sb.append(" transform: ").append(toIndentedString(transform)).append("\n"); + sb.append(" expression: ").append(toIndentedString(expression)).append("\n"); + sb.append(" resultType: ").append(toIndentedString(resultType)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `field_id` to the URL query string + if (getFieldId() != null) { + joiner.add( + String.format( + "%sfield_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFieldId())))); + } + + // add `source_ids` to the URL query string + if (getSourceIds() != null) { + for (int i = 0; i < getSourceIds().size(); i++) { + joiner.add( + String.format( + "%ssource_ids%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSourceIds().get(i))))); + } + } + + // add `transform` to the URL query string + if (getTransform() != null) { + joiner.add(getTransform().toUrlQueryString(prefix + "transform" + suffix)); + } + + // add `expression` to the URL query string + if (getExpression() != null) { + joiner.add( + String.format( + "%sexpression%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getExpression())))); + } + + // add `result_type` to the URL query string + if (getResultType() != null) { + joiner.add(getResultType().toUrlQueryString(prefix + "result_type" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionSpec.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionSpec.java new file mode 100644 index 000000000..995c2f4d3 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionSpec.java @@ -0,0 +1,194 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** Partition spec definition */ +@JsonPropertyOrder({PartitionSpec.JSON_PROPERTY_ID, PartitionSpec.JSON_PROPERTY_FIELDS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PartitionSpec { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull private Integer id; + + public static final String JSON_PROPERTY_FIELDS = "fields"; + @javax.annotation.Nonnull private List fields = new ArrayList<>(); + + public PartitionSpec() {} + + public PartitionSpec id(@javax.annotation.Nonnull Integer id) { + this.id = id; + return this; + } + + /** + * The spec version ID + * + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull Integer id) { + this.id = id; + } + + public PartitionSpec fields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + return this; + } + + public PartitionSpec addFieldsItem(PartitionField fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Array of partition field definitions + * + * @return fields + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFields() { + return fields; + } + + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + } + + /** Return true if this PartitionSpec object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartitionSpec partitionSpec = (PartitionSpec) o; + return Objects.equals(this.id, partitionSpec.id) + && Objects.equals(this.fields, partitionSpec.fields); + } + + @Override + public int hashCode() { + return Objects.hash(id, fields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartitionSpec {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `fields` to the URL query string + if (getFields() != null) { + for (int i = 0; i < getFields().size(); i++) { + if (getFields().get(i) != null) { + joiner.add( + getFields() + .get(i) + .toUrlQueryString( + String.format( + "%sfields%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionTransform.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionTransform.java new file mode 100644 index 000000000..c691c510e --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PartitionTransform.java @@ -0,0 +1,214 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Well-known partition transform */ +@JsonPropertyOrder({ + PartitionTransform.JSON_PROPERTY_TYPE, + PartitionTransform.JSON_PROPERTY_NUM_BUCKETS, + PartitionTransform.JSON_PROPERTY_WIDTH +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PartitionTransform { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull private String type; + + public static final String JSON_PROPERTY_NUM_BUCKETS = "num_buckets"; + @javax.annotation.Nullable private Integer numBuckets; + + public static final String JSON_PROPERTY_WIDTH = "width"; + @javax.annotation.Nullable private Integer width; + + public PartitionTransform() {} + + public PartitionTransform type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate) + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public PartitionTransform numBuckets(@javax.annotation.Nullable Integer numBuckets) { + this.numBuckets = numBuckets; + return this; + } + + /** + * Number of buckets for bucket transforms + * + * @return numBuckets + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_BUCKETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumBuckets() { + return numBuckets; + } + + @JsonProperty(JSON_PROPERTY_NUM_BUCKETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumBuckets(@javax.annotation.Nullable Integer numBuckets) { + this.numBuckets = numBuckets; + } + + public PartitionTransform width(@javax.annotation.Nullable Integer width) { + this.width = width; + return this; + } + + /** + * Truncation width for truncate transforms + * + * @return width + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@javax.annotation.Nullable Integer width) { + this.width = width; + } + + /** Return true if this PartitionTransform object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartitionTransform partitionTransform = (PartitionTransform) o; + return Objects.equals(this.type, partitionTransform.type) + && Objects.equals(this.numBuckets, partitionTransform.numBuckets) + && Objects.equals(this.width, partitionTransform.width); + } + + @Override + public int hashCode() { + return Objects.hash(type, numBuckets, width); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PartitionTransform {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" numBuckets: ").append(toIndentedString(numBuckets)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + joiner.add( + String.format( + "%stype%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `num_buckets` to the URL query string + if (getNumBuckets() != null) { + joiner.add( + String.format( + "%snum_buckets%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumBuckets())))); + } + + // add `width` to the URL query string + if (getWidth() != null) { + joiner.add( + String.format( + "%swidth%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PhraseQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PhraseQuery.java new file mode 100644 index 000000000..83d460ae5 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/PhraseQuery.java @@ -0,0 +1,214 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** PhraseQuery */ +@JsonPropertyOrder({ + PhraseQuery.JSON_PROPERTY_COLUMN, + PhraseQuery.JSON_PROPERTY_SLOP, + PhraseQuery.JSON_PROPERTY_TERMS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PhraseQuery { + public static final String JSON_PROPERTY_COLUMN = "column"; + @javax.annotation.Nullable private String column; + + public static final String JSON_PROPERTY_SLOP = "slop"; + @javax.annotation.Nullable private Integer slop; + + public static final String JSON_PROPERTY_TERMS = "terms"; + @javax.annotation.Nonnull private String terms; + + public PhraseQuery() {} + + public PhraseQuery column(@javax.annotation.Nullable String column) { + this.column = column; + return this; + } + + /** + * Get column + * + * @return column + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColumn() { + return column; + } + + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumn(@javax.annotation.Nullable String column) { + this.column = column; + } + + public PhraseQuery slop(@javax.annotation.Nullable Integer slop) { + this.slop = slop; + return this; + } + + /** + * Get slop minimum: 0 + * + * @return slop + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLOP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSlop() { + return slop; + } + + @JsonProperty(JSON_PROPERTY_SLOP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSlop(@javax.annotation.Nullable Integer slop) { + this.slop = slop; + } + + public PhraseQuery terms(@javax.annotation.Nonnull String terms) { + this.terms = terms; + return this; + } + + /** + * Get terms + * + * @return terms + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TERMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTerms() { + return terms; + } + + @JsonProperty(JSON_PROPERTY_TERMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTerms(@javax.annotation.Nonnull String terms) { + this.terms = terms; + } + + /** Return true if this PhraseQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhraseQuery phraseQuery = (PhraseQuery) o; + return Objects.equals(this.column, phraseQuery.column) + && Objects.equals(this.slop, phraseQuery.slop) + && Objects.equals(this.terms, phraseQuery.terms); + } + + @Override + public int hashCode() { + return Objects.hash(column, slop, terms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhraseQuery {\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" slop: ").append(toIndentedString(slop)).append("\n"); + sb.append(" terms: ").append(toIndentedString(terms)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `column` to the URL query string + if (getColumn() != null) { + joiner.add( + String.format( + "%scolumn%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getColumn())))); + } + + // add `slop` to the URL query string + if (getSlop() != null) { + joiner.add( + String.format( + "%sslop%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSlop())))); + } + + // add `terms` to the URL query string + if (getTerms() != null) { + joiner.add( + String.format( + "%sterms%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTerms())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequest.java new file mode 100644 index 000000000..b04dcb62f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequest.java @@ -0,0 +1,930 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** QueryTableRequest */ +@JsonPropertyOrder({ + QueryTableRequest.JSON_PROPERTY_IDENTITY, + QueryTableRequest.JSON_PROPERTY_CONTEXT, + QueryTableRequest.JSON_PROPERTY_ID, + QueryTableRequest.JSON_PROPERTY_BYPASS_VECTOR_INDEX, + QueryTableRequest.JSON_PROPERTY_COLUMNS, + QueryTableRequest.JSON_PROPERTY_DISTANCE_TYPE, + QueryTableRequest.JSON_PROPERTY_EF, + QueryTableRequest.JSON_PROPERTY_FAST_SEARCH, + QueryTableRequest.JSON_PROPERTY_FILTER, + QueryTableRequest.JSON_PROPERTY_FULL_TEXT_QUERY, + QueryTableRequest.JSON_PROPERTY_K, + QueryTableRequest.JSON_PROPERTY_LOWER_BOUND, + QueryTableRequest.JSON_PROPERTY_NPROBES, + QueryTableRequest.JSON_PROPERTY_OFFSET, + QueryTableRequest.JSON_PROPERTY_PREFILTER, + QueryTableRequest.JSON_PROPERTY_REFINE_FACTOR, + QueryTableRequest.JSON_PROPERTY_UPPER_BOUND, + QueryTableRequest.JSON_PROPERTY_VECTOR, + QueryTableRequest.JSON_PROPERTY_VECTOR_COLUMN, + QueryTableRequest.JSON_PROPERTY_VERSION, + QueryTableRequest.JSON_PROPERTY_WITH_ROW_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_BYPASS_VECTOR_INDEX = "bypass_vector_index"; + @javax.annotation.Nullable private Boolean bypassVectorIndex; + + public static final String JSON_PROPERTY_COLUMNS = "columns"; + @javax.annotation.Nullable private QueryTableRequestColumns columns; + + public static final String JSON_PROPERTY_DISTANCE_TYPE = "distance_type"; + @javax.annotation.Nullable private String distanceType; + + public static final String JSON_PROPERTY_EF = "ef"; + @javax.annotation.Nullable private Integer ef; + + public static final String JSON_PROPERTY_FAST_SEARCH = "fast_search"; + @javax.annotation.Nullable private Boolean fastSearch; + + public static final String JSON_PROPERTY_FILTER = "filter"; + @javax.annotation.Nullable private String filter; + + public static final String JSON_PROPERTY_FULL_TEXT_QUERY = "full_text_query"; + @javax.annotation.Nullable private QueryTableRequestFullTextQuery fullTextQuery; + + public static final String JSON_PROPERTY_K = "k"; + @javax.annotation.Nonnull private Integer k; + + public static final String JSON_PROPERTY_LOWER_BOUND = "lower_bound"; + @javax.annotation.Nullable private Float lowerBound; + + public static final String JSON_PROPERTY_NPROBES = "nprobes"; + @javax.annotation.Nullable private Integer nprobes; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + @javax.annotation.Nullable private Integer offset; + + public static final String JSON_PROPERTY_PREFILTER = "prefilter"; + @javax.annotation.Nullable private Boolean prefilter; + + public static final String JSON_PROPERTY_REFINE_FACTOR = "refine_factor"; + @javax.annotation.Nullable private Integer refineFactor; + + public static final String JSON_PROPERTY_UPPER_BOUND = "upper_bound"; + @javax.annotation.Nullable private Float upperBound; + + public static final String JSON_PROPERTY_VECTOR = "vector"; + @javax.annotation.Nonnull private QueryTableRequestVector vector; + + public static final String JSON_PROPERTY_VECTOR_COLUMN = "vector_column"; + @javax.annotation.Nullable private String vectorColumn; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public static final String JSON_PROPERTY_WITH_ROW_ID = "with_row_id"; + @javax.annotation.Nullable private Boolean withRowId; + + public QueryTableRequest() {} + + public QueryTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public QueryTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public QueryTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public QueryTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public QueryTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public QueryTableRequest bypassVectorIndex(@javax.annotation.Nullable Boolean bypassVectorIndex) { + this.bypassVectorIndex = bypassVectorIndex; + return this; + } + + /** + * Whether to bypass vector index + * + * @return bypassVectorIndex + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BYPASS_VECTOR_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBypassVectorIndex() { + return bypassVectorIndex; + } + + @JsonProperty(JSON_PROPERTY_BYPASS_VECTOR_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBypassVectorIndex(@javax.annotation.Nullable Boolean bypassVectorIndex) { + this.bypassVectorIndex = bypassVectorIndex; + } + + public QueryTableRequest columns(@javax.annotation.Nullable QueryTableRequestColumns columns) { + this.columns = columns; + return this; + } + + /** + * Get columns + * + * @return columns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public QueryTableRequestColumns getColumns() { + return columns; + } + + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumns(@javax.annotation.Nullable QueryTableRequestColumns columns) { + this.columns = columns; + } + + public QueryTableRequest distanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + return this; + } + + /** + * Distance metric to use + * + * @return distanceType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDistanceType() { + return distanceType; + } + + @JsonProperty(JSON_PROPERTY_DISTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDistanceType(@javax.annotation.Nullable String distanceType) { + this.distanceType = distanceType; + } + + public QueryTableRequest ef(@javax.annotation.Nullable Integer ef) { + this.ef = ef; + return this; + } + + /** + * Search effort parameter for HNSW index minimum: 0 + * + * @return ef + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEf() { + return ef; + } + + @JsonProperty(JSON_PROPERTY_EF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEf(@javax.annotation.Nullable Integer ef) { + this.ef = ef; + } + + public QueryTableRequest fastSearch(@javax.annotation.Nullable Boolean fastSearch) { + this.fastSearch = fastSearch; + return this; + } + + /** + * Whether to use fast search + * + * @return fastSearch + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAST_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFastSearch() { + return fastSearch; + } + + @JsonProperty(JSON_PROPERTY_FAST_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFastSearch(@javax.annotation.Nullable Boolean fastSearch) { + this.fastSearch = fastSearch; + } + + public QueryTableRequest filter(@javax.annotation.Nullable String filter) { + this.filter = filter; + return this; + } + + /** + * Optional SQL filter expression + * + * @return filter + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilter() { + return filter; + } + + @JsonProperty(JSON_PROPERTY_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilter(@javax.annotation.Nullable String filter) { + this.filter = filter; + } + + public QueryTableRequest fullTextQuery( + @javax.annotation.Nullable QueryTableRequestFullTextQuery fullTextQuery) { + this.fullTextQuery = fullTextQuery; + return this; + } + + /** + * Get fullTextQuery + * + * @return fullTextQuery + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FULL_TEXT_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public QueryTableRequestFullTextQuery getFullTextQuery() { + return fullTextQuery; + } + + @JsonProperty(JSON_PROPERTY_FULL_TEXT_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFullTextQuery( + @javax.annotation.Nullable QueryTableRequestFullTextQuery fullTextQuery) { + this.fullTextQuery = fullTextQuery; + } + + public QueryTableRequest k(@javax.annotation.Nonnull Integer k) { + this.k = k; + return this; + } + + /** + * Number of results to return minimum: 0 + * + * @return k + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_K) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getK() { + return k; + } + + @JsonProperty(JSON_PROPERTY_K) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setK(@javax.annotation.Nonnull Integer k) { + this.k = k; + } + + public QueryTableRequest lowerBound(@javax.annotation.Nullable Float lowerBound) { + this.lowerBound = lowerBound; + return this; + } + + /** + * Lower bound for search + * + * @return lowerBound + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOWER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getLowerBound() { + return lowerBound; + } + + @JsonProperty(JSON_PROPERTY_LOWER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLowerBound(@javax.annotation.Nullable Float lowerBound) { + this.lowerBound = lowerBound; + } + + public QueryTableRequest nprobes(@javax.annotation.Nullable Integer nprobes) { + this.nprobes = nprobes; + return this; + } + + /** + * Number of probes for IVF index minimum: 0 + * + * @return nprobes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NPROBES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNprobes() { + return nprobes; + } + + @JsonProperty(JSON_PROPERTY_NPROBES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNprobes(@javax.annotation.Nullable Integer nprobes) { + this.nprobes = nprobes; + } + + public QueryTableRequest offset(@javax.annotation.Nullable Integer offset) { + this.offset = offset; + return this; + } + + /** + * Number of results to skip minimum: 0 + * + * @return offset + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOffset() { + return offset; + } + + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOffset(@javax.annotation.Nullable Integer offset) { + this.offset = offset; + } + + public QueryTableRequest prefilter(@javax.annotation.Nullable Boolean prefilter) { + this.prefilter = prefilter; + return this; + } + + /** + * Whether to apply filtering before vector search + * + * @return prefilter + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefilter() { + return prefilter; + } + + @JsonProperty(JSON_PROPERTY_PREFILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefilter(@javax.annotation.Nullable Boolean prefilter) { + this.prefilter = prefilter; + } + + public QueryTableRequest refineFactor(@javax.annotation.Nullable Integer refineFactor) { + this.refineFactor = refineFactor; + return this; + } + + /** + * Refine factor for search minimum: 0 + * + * @return refineFactor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REFINE_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRefineFactor() { + return refineFactor; + } + + @JsonProperty(JSON_PROPERTY_REFINE_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefineFactor(@javax.annotation.Nullable Integer refineFactor) { + this.refineFactor = refineFactor; + } + + public QueryTableRequest upperBound(@javax.annotation.Nullable Float upperBound) { + this.upperBound = upperBound; + return this; + } + + /** + * Upper bound for search + * + * @return upperBound + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPPER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getUpperBound() { + return upperBound; + } + + @JsonProperty(JSON_PROPERTY_UPPER_BOUND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpperBound(@javax.annotation.Nullable Float upperBound) { + this.upperBound = upperBound; + } + + public QueryTableRequest vector(@javax.annotation.Nonnull QueryTableRequestVector vector) { + this.vector = vector; + return this; + } + + /** + * Get vector + * + * @return vector + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VECTOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public QueryTableRequestVector getVector() { + return vector; + } + + @JsonProperty(JSON_PROPERTY_VECTOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVector(@javax.annotation.Nonnull QueryTableRequestVector vector) { + this.vector = vector; + } + + public QueryTableRequest vectorColumn(@javax.annotation.Nullable String vectorColumn) { + this.vectorColumn = vectorColumn; + return this; + } + + /** + * Name of the vector column to search + * + * @return vectorColumn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VECTOR_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVectorColumn() { + return vectorColumn; + } + + @JsonProperty(JSON_PROPERTY_VECTOR_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVectorColumn(@javax.annotation.Nullable String vectorColumn) { + this.vectorColumn = vectorColumn; + } + + public QueryTableRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Table version to query minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + public QueryTableRequest withRowId(@javax.annotation.Nullable Boolean withRowId) { + this.withRowId = withRowId; + return this; + } + + /** + * If true, return the row id as a column called `_rowid` + * + * @return withRowId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITH_ROW_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWithRowId() { + return withRowId; + } + + @JsonProperty(JSON_PROPERTY_WITH_ROW_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWithRowId(@javax.annotation.Nullable Boolean withRowId) { + this.withRowId = withRowId; + } + + /** Return true if this QueryTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryTableRequest queryTableRequest = (QueryTableRequest) o; + return Objects.equals(this.identity, queryTableRequest.identity) + && Objects.equals(this.context, queryTableRequest.context) + && Objects.equals(this.id, queryTableRequest.id) + && Objects.equals(this.bypassVectorIndex, queryTableRequest.bypassVectorIndex) + && Objects.equals(this.columns, queryTableRequest.columns) + && Objects.equals(this.distanceType, queryTableRequest.distanceType) + && Objects.equals(this.ef, queryTableRequest.ef) + && Objects.equals(this.fastSearch, queryTableRequest.fastSearch) + && Objects.equals(this.filter, queryTableRequest.filter) + && Objects.equals(this.fullTextQuery, queryTableRequest.fullTextQuery) + && Objects.equals(this.k, queryTableRequest.k) + && Objects.equals(this.lowerBound, queryTableRequest.lowerBound) + && Objects.equals(this.nprobes, queryTableRequest.nprobes) + && Objects.equals(this.offset, queryTableRequest.offset) + && Objects.equals(this.prefilter, queryTableRequest.prefilter) + && Objects.equals(this.refineFactor, queryTableRequest.refineFactor) + && Objects.equals(this.upperBound, queryTableRequest.upperBound) + && Objects.equals(this.vector, queryTableRequest.vector) + && Objects.equals(this.vectorColumn, queryTableRequest.vectorColumn) + && Objects.equals(this.version, queryTableRequest.version) + && Objects.equals(this.withRowId, queryTableRequest.withRowId); + } + + @Override + public int hashCode() { + return Objects.hash( + identity, + context, + id, + bypassVectorIndex, + columns, + distanceType, + ef, + fastSearch, + filter, + fullTextQuery, + k, + lowerBound, + nprobes, + offset, + prefilter, + refineFactor, + upperBound, + vector, + vectorColumn, + version, + withRowId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" bypassVectorIndex: ").append(toIndentedString(bypassVectorIndex)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" distanceType: ").append(toIndentedString(distanceType)).append("\n"); + sb.append(" ef: ").append(toIndentedString(ef)).append("\n"); + sb.append(" fastSearch: ").append(toIndentedString(fastSearch)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append(" fullTextQuery: ").append(toIndentedString(fullTextQuery)).append("\n"); + sb.append(" k: ").append(toIndentedString(k)).append("\n"); + sb.append(" lowerBound: ").append(toIndentedString(lowerBound)).append("\n"); + sb.append(" nprobes: ").append(toIndentedString(nprobes)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" prefilter: ").append(toIndentedString(prefilter)).append("\n"); + sb.append(" refineFactor: ").append(toIndentedString(refineFactor)).append("\n"); + sb.append(" upperBound: ").append(toIndentedString(upperBound)).append("\n"); + sb.append(" vector: ").append(toIndentedString(vector)).append("\n"); + sb.append(" vectorColumn: ").append(toIndentedString(vectorColumn)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" withRowId: ").append(toIndentedString(withRowId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `bypass_vector_index` to the URL query string + if (getBypassVectorIndex() != null) { + joiner.add( + String.format( + "%sbypass_vector_index%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getBypassVectorIndex())))); + } + + // add `columns` to the URL query string + if (getColumns() != null) { + joiner.add(getColumns().toUrlQueryString(prefix + "columns" + suffix)); + } + + // add `distance_type` to the URL query string + if (getDistanceType() != null) { + joiner.add( + String.format( + "%sdistance_type%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDistanceType())))); + } + + // add `ef` to the URL query string + if (getEf() != null) { + joiner.add( + String.format( + "%sef%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEf())))); + } + + // add `fast_search` to the URL query string + if (getFastSearch() != null) { + joiner.add( + String.format( + "%sfast_search%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFastSearch())))); + } + + // add `filter` to the URL query string + if (getFilter() != null) { + joiner.add( + String.format( + "%sfilter%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFilter())))); + } + + // add `full_text_query` to the URL query string + if (getFullTextQuery() != null) { + joiner.add(getFullTextQuery().toUrlQueryString(prefix + "full_text_query" + suffix)); + } + + // add `k` to the URL query string + if (getK() != null) { + joiner.add( + String.format( + "%sk%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getK())))); + } + + // add `lower_bound` to the URL query string + if (getLowerBound() != null) { + joiner.add( + String.format( + "%slower_bound%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLowerBound())))); + } + + // add `nprobes` to the URL query string + if (getNprobes() != null) { + joiner.add( + String.format( + "%snprobes%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNprobes())))); + } + + // add `offset` to the URL query string + if (getOffset() != null) { + joiner.add( + String.format( + "%soffset%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOffset())))); + } + + // add `prefilter` to the URL query string + if (getPrefilter() != null) { + joiner.add( + String.format( + "%sprefilter%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPrefilter())))); + } + + // add `refine_factor` to the URL query string + if (getRefineFactor() != null) { + joiner.add( + String.format( + "%srefine_factor%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getRefineFactor())))); + } + + // add `upper_bound` to the URL query string + if (getUpperBound() != null) { + joiner.add( + String.format( + "%supper_bound%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpperBound())))); + } + + // add `vector` to the URL query string + if (getVector() != null) { + joiner.add(getVector().toUrlQueryString(prefix + "vector" + suffix)); + } + + // add `vector_column` to the URL query string + if (getVectorColumn() != null) { + joiner.add( + String.format( + "%svector_column%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVectorColumn())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `with_row_id` to the URL query string + if (getWithRowId() != null) { + joiner.add( + String.format( + "%swith_row_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWithRowId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestColumns.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestColumns.java new file mode 100644 index 000000000..8fd413a2b --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestColumns.java @@ -0,0 +1,213 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** Optional columns to return. Provide either column_names or column_aliases, not both. */ +@JsonPropertyOrder({ + QueryTableRequestColumns.JSON_PROPERTY_COLUMN_NAMES, + QueryTableRequestColumns.JSON_PROPERTY_COLUMN_ALIASES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryTableRequestColumns { + public static final String JSON_PROPERTY_COLUMN_NAMES = "column_names"; + @javax.annotation.Nullable private List columnNames = new ArrayList<>(); + + public static final String JSON_PROPERTY_COLUMN_ALIASES = "column_aliases"; + @javax.annotation.Nullable private Map columnAliases = new HashMap<>(); + + public QueryTableRequestColumns() {} + + public QueryTableRequestColumns columnNames(@javax.annotation.Nullable List columnNames) { + this.columnNames = columnNames; + return this; + } + + public QueryTableRequestColumns addColumnNamesItem(String columnNamesItem) { + if (this.columnNames == null) { + this.columnNames = new ArrayList<>(); + } + this.columnNames.add(columnNamesItem); + return this; + } + + /** + * List of column names to return + * + * @return columnNames + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getColumnNames() { + return columnNames; + } + + @JsonProperty(JSON_PROPERTY_COLUMN_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumnNames(@javax.annotation.Nullable List columnNames) { + this.columnNames = columnNames; + } + + public QueryTableRequestColumns columnAliases( + @javax.annotation.Nullable Map columnAliases) { + this.columnAliases = columnAliases; + return this; + } + + public QueryTableRequestColumns putColumnAliasesItem(String key, String columnAliasesItem) { + if (this.columnAliases == null) { + this.columnAliases = new HashMap<>(); + } + this.columnAliases.put(key, columnAliasesItem); + return this; + } + + /** + * Object mapping output aliases to source column names + * + * @return columnAliases + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN_ALIASES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getColumnAliases() { + return columnAliases; + } + + @JsonProperty(JSON_PROPERTY_COLUMN_ALIASES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumnAliases(@javax.annotation.Nullable Map columnAliases) { + this.columnAliases = columnAliases; + } + + /** Return true if this QueryTableRequest_columns object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryTableRequestColumns queryTableRequestColumns = (QueryTableRequestColumns) o; + return Objects.equals(this.columnNames, queryTableRequestColumns.columnNames) + && Objects.equals(this.columnAliases, queryTableRequestColumns.columnAliases); + } + + @Override + public int hashCode() { + return Objects.hash(columnNames, columnAliases); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryTableRequestColumns {\n"); + sb.append(" columnNames: ").append(toIndentedString(columnNames)).append("\n"); + sb.append(" columnAliases: ").append(toIndentedString(columnAliases)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `column_names` to the URL query string + if (getColumnNames() != null) { + for (int i = 0; i < getColumnNames().size(); i++) { + joiner.add( + String.format( + "%scolumn_names%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getColumnNames().get(i))))); + } + } + + // add `column_aliases` to the URL query string + if (getColumnAliases() != null) { + for (String _key : getColumnAliases().keySet()) { + joiner.add( + String.format( + "%scolumn_aliases%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getColumnAliases().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getColumnAliases().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestFullTextQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestFullTextQuery.java new file mode 100644 index 000000000..5f52aa135 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestFullTextQuery.java @@ -0,0 +1,172 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Optional full-text search query. Provide either string_query or structured_query, not both. */ +@JsonPropertyOrder({ + QueryTableRequestFullTextQuery.JSON_PROPERTY_STRING_QUERY, + QueryTableRequestFullTextQuery.JSON_PROPERTY_STRUCTURED_QUERY +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryTableRequestFullTextQuery { + public static final String JSON_PROPERTY_STRING_QUERY = "string_query"; + @javax.annotation.Nullable private StringFtsQuery stringQuery; + + public static final String JSON_PROPERTY_STRUCTURED_QUERY = "structured_query"; + @javax.annotation.Nullable private StructuredFtsQuery structuredQuery; + + public QueryTableRequestFullTextQuery() {} + + public QueryTableRequestFullTextQuery stringQuery( + @javax.annotation.Nullable StringFtsQuery stringQuery) { + this.stringQuery = stringQuery; + return this; + } + + /** + * Get stringQuery + * + * @return stringQuery + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StringFtsQuery getStringQuery() { + return stringQuery; + } + + @JsonProperty(JSON_PROPERTY_STRING_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStringQuery(@javax.annotation.Nullable StringFtsQuery stringQuery) { + this.stringQuery = stringQuery; + } + + public QueryTableRequestFullTextQuery structuredQuery( + @javax.annotation.Nullable StructuredFtsQuery structuredQuery) { + this.structuredQuery = structuredQuery; + return this; + } + + /** + * Get structuredQuery + * + * @return structuredQuery + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRUCTURED_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StructuredFtsQuery getStructuredQuery() { + return structuredQuery; + } + + @JsonProperty(JSON_PROPERTY_STRUCTURED_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStructuredQuery(@javax.annotation.Nullable StructuredFtsQuery structuredQuery) { + this.structuredQuery = structuredQuery; + } + + /** Return true if this QueryTableRequest_full_text_query object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryTableRequestFullTextQuery queryTableRequestFullTextQuery = + (QueryTableRequestFullTextQuery) o; + return Objects.equals(this.stringQuery, queryTableRequestFullTextQuery.stringQuery) + && Objects.equals(this.structuredQuery, queryTableRequestFullTextQuery.structuredQuery); + } + + @Override + public int hashCode() { + return Objects.hash(stringQuery, structuredQuery); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryTableRequestFullTextQuery {\n"); + sb.append(" stringQuery: ").append(toIndentedString(stringQuery)).append("\n"); + sb.append(" structuredQuery: ").append(toIndentedString(structuredQuery)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `string_query` to the URL query string + if (getStringQuery() != null) { + joiner.add(getStringQuery().toUrlQueryString(prefix + "string_query" + suffix)); + } + + // add `structured_query` to the URL query string + if (getStructuredQuery() != null) { + joiner.add(getStructuredQuery().toUrlQueryString(prefix + "structured_query" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestVector.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestVector.java new file mode 100644 index 000000000..86c76c15c --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/QueryTableRequestVector.java @@ -0,0 +1,212 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both. + */ +@JsonPropertyOrder({ + QueryTableRequestVector.JSON_PROPERTY_SINGLE_VECTOR, + QueryTableRequestVector.JSON_PROPERTY_MULTI_VECTOR +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryTableRequestVector { + public static final String JSON_PROPERTY_SINGLE_VECTOR = "single_vector"; + @javax.annotation.Nullable private List singleVector = new ArrayList<>(); + + public static final String JSON_PROPERTY_MULTI_VECTOR = "multi_vector"; + @javax.annotation.Nullable private List> multiVector = new ArrayList<>(); + + public QueryTableRequestVector() {} + + public QueryTableRequestVector singleVector(@javax.annotation.Nullable List singleVector) { + this.singleVector = singleVector; + return this; + } + + public QueryTableRequestVector addSingleVectorItem(Float singleVectorItem) { + if (this.singleVector == null) { + this.singleVector = new ArrayList<>(); + } + this.singleVector.add(singleVectorItem); + return this; + } + + /** + * Single query vector + * + * @return singleVector + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SINGLE_VECTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSingleVector() { + return singleVector; + } + + @JsonProperty(JSON_PROPERTY_SINGLE_VECTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSingleVector(@javax.annotation.Nullable List singleVector) { + this.singleVector = singleVector; + } + + public QueryTableRequestVector multiVector( + @javax.annotation.Nullable List> multiVector) { + this.multiVector = multiVector; + return this; + } + + public QueryTableRequestVector addMultiVectorItem(List multiVectorItem) { + if (this.multiVector == null) { + this.multiVector = new ArrayList<>(); + } + this.multiVector.add(multiVectorItem); + return this; + } + + /** + * Multiple query vectors for batch search + * + * @return multiVector + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MULTI_VECTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getMultiVector() { + return multiVector; + } + + @JsonProperty(JSON_PROPERTY_MULTI_VECTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMultiVector(@javax.annotation.Nullable List> multiVector) { + this.multiVector = multiVector; + } + + /** Return true if this QueryTableRequest_vector object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryTableRequestVector queryTableRequestVector = (QueryTableRequestVector) o; + return Objects.equals(this.singleVector, queryTableRequestVector.singleVector) + && Objects.equals(this.multiVector, queryTableRequestVector.multiVector); + } + + @Override + public int hashCode() { + return Objects.hash(singleVector, multiVector); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryTableRequestVector {\n"); + sb.append(" singleVector: ").append(toIndentedString(singleVector)).append("\n"); + sb.append(" multiVector: ").append(toIndentedString(multiVector)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `single_vector` to the URL query string + if (getSingleVector() != null) { + for (int i = 0; i < getSingleVector().size(); i++) { + joiner.add( + String.format( + "%ssingle_vector%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getSingleVector().get(i))))); + } + } + + // add `multi_vector` to the URL query string + if (getMultiVector() != null) { + for (int i = 0; i < getMultiVector().size(); i++) { + joiner.add( + String.format( + "%smulti_vector%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getMultiVector().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RegisterTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RegisterTableRequest.java new file mode 100644 index 000000000..dace5acbc --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RegisterTableRequest.java @@ -0,0 +1,381 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** RegisterTableRequest */ +@JsonPropertyOrder({ + RegisterTableRequest.JSON_PROPERTY_IDENTITY, + RegisterTableRequest.JSON_PROPERTY_CONTEXT, + RegisterTableRequest.JSON_PROPERTY_ID, + RegisterTableRequest.JSON_PROPERTY_LOCATION, + RegisterTableRequest.JSON_PROPERTY_MODE, + RegisterTableRequest.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RegisterTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nonnull private String location; + + public static final String JSON_PROPERTY_MODE = "mode"; + @javax.annotation.Nullable private String mode; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public RegisterTableRequest() {} + + public RegisterTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public RegisterTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public RegisterTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public RegisterTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public RegisterTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public RegisterTableRequest location(@javax.annotation.Nonnull String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLocation(@javax.annotation.Nonnull String location) { + this.location = location; + } + + public RegisterTableRequest mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * There are two modes when trying to register a table, to differentiate the behavior when a table + * of the same name already exists. Case insensitive, supports both PascalCase and snake_case. + * Valid values are: * Create (default): the operation fails with 409. * Overwrite: the existing + * table registration is replaced with the new registration. + * + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMode() { + return mode; + } + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + public RegisterTableRequest properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public RegisterTableRequest putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the table, if supported by the implementation. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this RegisterTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegisterTableRequest registerTableRequest = (RegisterTableRequest) o; + return Objects.equals(this.identity, registerTableRequest.identity) + && Objects.equals(this.context, registerTableRequest.context) + && Objects.equals(this.id, registerTableRequest.id) + && Objects.equals(this.location, registerTableRequest.location) + && Objects.equals(this.mode, registerTableRequest.mode) + && Objects.equals(this.properties, registerTableRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, location, mode, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegisterTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add( + String.format( + "%smode%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMode())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RegisterTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RegisterTableResponse.java new file mode 100644 index 000000000..03931e6b4 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RegisterTableResponse.java @@ -0,0 +1,234 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** RegisterTableResponse */ +@JsonPropertyOrder({ + RegisterTableResponse.JSON_PROPERTY_TRANSACTION_ID, + RegisterTableResponse.JSON_PROPERTY_LOCATION, + RegisterTableResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RegisterTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_LOCATION = "location"; + @javax.annotation.Nullable private String location; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public RegisterTableResponse() {} + + public RegisterTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public RegisterTableResponse location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * + * @return location + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocation() { + return location; + } + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + public RegisterTableResponse properties( + @javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public RegisterTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise, it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this RegisterTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegisterTableResponse registerTableResponse = (RegisterTableResponse) o; + return Objects.equals(this.transactionId, registerTableResponse.transactionId) + && Objects.equals(this.location, registerTableResponse.location) + && Objects.equals(this.properties, registerTableResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, location, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegisterTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add( + String.format( + "%slocation%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RenameTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RenameTableRequest.java new file mode 100644 index 000000000..2f2002722 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RenameTableRequest.java @@ -0,0 +1,340 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** RenameTableRequest */ +@JsonPropertyOrder({ + RenameTableRequest.JSON_PROPERTY_IDENTITY, + RenameTableRequest.JSON_PROPERTY_CONTEXT, + RenameTableRequest.JSON_PROPERTY_ID, + RenameTableRequest.JSON_PROPERTY_NEW_TABLE_NAME, + RenameTableRequest.JSON_PROPERTY_NEW_NAMESPACE_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RenameTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_NEW_TABLE_NAME = "new_table_name"; + @javax.annotation.Nonnull private String newTableName; + + public static final String JSON_PROPERTY_NEW_NAMESPACE_ID = "new_namespace_id"; + @javax.annotation.Nullable private List newNamespaceId = new ArrayList<>(); + + public RenameTableRequest() {} + + public RenameTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public RenameTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public RenameTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public RenameTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public RenameTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public RenameTableRequest newTableName(@javax.annotation.Nonnull String newTableName) { + this.newTableName = newTableName; + return this; + } + + /** + * New name for the table + * + * @return newTableName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NEW_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNewTableName() { + return newTableName; + } + + @JsonProperty(JSON_PROPERTY_NEW_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNewTableName(@javax.annotation.Nonnull String newTableName) { + this.newTableName = newTableName; + } + + public RenameTableRequest newNamespaceId(@javax.annotation.Nullable List newNamespaceId) { + this.newNamespaceId = newNamespaceId; + return this; + } + + public RenameTableRequest addNewNamespaceIdItem(String newNamespaceIdItem) { + if (this.newNamespaceId == null) { + this.newNamespaceId = new ArrayList<>(); + } + this.newNamespaceId.add(newNamespaceIdItem); + return this; + } + + /** + * New namespace identifier to move the table to (optional, if not specified the table stays in + * the same namespace) + * + * @return newNamespaceId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEW_NAMESPACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNewNamespaceId() { + return newNamespaceId; + } + + @JsonProperty(JSON_PROPERTY_NEW_NAMESPACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewNamespaceId(@javax.annotation.Nullable List newNamespaceId) { + this.newNamespaceId = newNamespaceId; + } + + /** Return true if this RenameTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RenameTableRequest renameTableRequest = (RenameTableRequest) o; + return Objects.equals(this.identity, renameTableRequest.identity) + && Objects.equals(this.context, renameTableRequest.context) + && Objects.equals(this.id, renameTableRequest.id) + && Objects.equals(this.newTableName, renameTableRequest.newTableName) + && Objects.equals(this.newNamespaceId, renameTableRequest.newNamespaceId); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, newTableName, newNamespaceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RenameTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" newTableName: ").append(toIndentedString(newTableName)).append("\n"); + sb.append(" newNamespaceId: ").append(toIndentedString(newNamespaceId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `new_table_name` to the URL query string + if (getNewTableName() != null) { + joiner.add( + String.format( + "%snew_table_name%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNewTableName())))); + } + + // add `new_namespace_id` to the URL query string + if (getNewNamespaceId() != null) { + for (int i = 0; i < getNewNamespaceId().size(); i++) { + joiner.add( + String.format( + "%snew_namespace_id%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getNewNamespaceId().get(i))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RenameTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RenameTableResponse.java new file mode 100644 index 000000000..fb079b20c --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RenameTableResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** RenameTableResponse */ +@JsonPropertyOrder({RenameTableResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RenameTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public RenameTableResponse() {} + + public RenameTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this RenameTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RenameTableResponse renameTableResponse = (RenameTableResponse) o; + return Objects.equals(this.transactionId, renameTableResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RenameTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RestoreTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RestoreTableRequest.java new file mode 100644 index 000000000..af9772d3f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RestoreTableRequest.java @@ -0,0 +1,287 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** RestoreTableRequest */ +@JsonPropertyOrder({ + RestoreTableRequest.JSON_PROPERTY_IDENTITY, + RestoreTableRequest.JSON_PROPERTY_CONTEXT, + RestoreTableRequest.JSON_PROPERTY_ID, + RestoreTableRequest.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RestoreTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public RestoreTableRequest() {} + + public RestoreTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public RestoreTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public RestoreTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public RestoreTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public RestoreTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public RestoreTableRequest version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version to restore to minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this RestoreTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreTableRequest restoreTableRequest = (RestoreTableRequest) o; + return Objects.equals(this.identity, restoreTableRequest.identity) + && Objects.equals(this.context, restoreTableRequest.context) + && Objects.equals(this.id, restoreTableRequest.id) + && Objects.equals(this.version, restoreTableRequest.version); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RestoreTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RestoreTableResponse.java new file mode 100644 index 000000000..c60998cd9 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/RestoreTableResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for restore table operation */ +@JsonPropertyOrder({RestoreTableResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RestoreTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public RestoreTableResponse() {} + + public RestoreTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this RestoreTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreTableResponse restoreTableResponse = (RestoreTableResponse) o; + return Objects.equals(this.transactionId, restoreTableResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/StringFtsQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/StringFtsQuery.java new file mode 100644 index 000000000..12b7153f8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/StringFtsQuery.java @@ -0,0 +1,191 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** StringFtsQuery */ +@JsonPropertyOrder({StringFtsQuery.JSON_PROPERTY_COLUMNS, StringFtsQuery.JSON_PROPERTY_QUERY}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class StringFtsQuery { + public static final String JSON_PROPERTY_COLUMNS = "columns"; + @javax.annotation.Nullable private List columns = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + @javax.annotation.Nonnull private String query; + + public StringFtsQuery() {} + + public StringFtsQuery columns(@javax.annotation.Nullable List columns) { + this.columns = columns; + return this; + } + + public StringFtsQuery addColumnsItem(String columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + return this; + } + + /** + * Get columns + * + * @return columns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getColumns() { + return columns; + } + + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColumns(@javax.annotation.Nullable List columns) { + this.columns = columns; + } + + public StringFtsQuery query(@javax.annotation.Nonnull String query) { + this.query = query; + return this; + } + + /** + * Get query + * + * @return query + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuery(@javax.annotation.Nonnull String query) { + this.query = query; + } + + /** Return true if this StringFtsQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StringFtsQuery stringFtsQuery = (StringFtsQuery) o; + return Objects.equals(this.columns, stringFtsQuery.columns) + && Objects.equals(this.query, stringFtsQuery.query); + } + + @Override + public int hashCode() { + return Objects.hash(columns, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringFtsQuery {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `columns` to the URL query string + if (getColumns() != null) { + for (int i = 0; i < getColumns().size(); i++) { + joiner.add( + String.format( + "%scolumns%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getColumns().get(i))))); + } + } + + // add `query` to the URL query string + if (getQuery() != null) { + joiner.add( + String.format( + "%squery%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQuery())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/StructuredFtsQuery.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/StructuredFtsQuery.java new file mode 100644 index 000000000..5af195c7f --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/StructuredFtsQuery.java @@ -0,0 +1,133 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** StructuredFtsQuery */ +@JsonPropertyOrder({StructuredFtsQuery.JSON_PROPERTY_QUERY}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class StructuredFtsQuery { + public static final String JSON_PROPERTY_QUERY = "query"; + @javax.annotation.Nonnull private FtsQuery query; + + public StructuredFtsQuery() {} + + public StructuredFtsQuery query(@javax.annotation.Nonnull FtsQuery query) { + this.query = query; + return this; + } + + /** + * Get query + * + * @return query + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FtsQuery getQuery() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuery(@javax.annotation.Nonnull FtsQuery query) { + this.query = query; + } + + /** Return true if this StructuredFtsQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StructuredFtsQuery structuredFtsQuery = (StructuredFtsQuery) o; + return Objects.equals(this.query, structuredFtsQuery.query); + } + + @Override + public int hashCode() { + return Objects.hash(query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StructuredFtsQuery {\n"); + sb.append(" query: ").append(toIndentedString(query)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `query` to the URL query string + if (getQuery() != null) { + joiner.add(getQuery().toUrlQueryString(prefix + "query" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableBasicStats.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableBasicStats.java new file mode 100644 index 000000000..96ea36fe8 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableBasicStats.java @@ -0,0 +1,177 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** TableBasicStats */ +@JsonPropertyOrder({ + TableBasicStats.JSON_PROPERTY_NUM_DELETED_ROWS, + TableBasicStats.JSON_PROPERTY_NUM_FRAGMENTS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TableBasicStats { + public static final String JSON_PROPERTY_NUM_DELETED_ROWS = "num_deleted_rows"; + @javax.annotation.Nonnull private Integer numDeletedRows; + + public static final String JSON_PROPERTY_NUM_FRAGMENTS = "num_fragments"; + @javax.annotation.Nonnull private Integer numFragments; + + public TableBasicStats() {} + + public TableBasicStats numDeletedRows(@javax.annotation.Nonnull Integer numDeletedRows) { + this.numDeletedRows = numDeletedRows; + return this; + } + + /** + * Number of deleted rows in the table minimum: 0 + * + * @return numDeletedRows + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUM_DELETED_ROWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getNumDeletedRows() { + return numDeletedRows; + } + + @JsonProperty(JSON_PROPERTY_NUM_DELETED_ROWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumDeletedRows(@javax.annotation.Nonnull Integer numDeletedRows) { + this.numDeletedRows = numDeletedRows; + } + + public TableBasicStats numFragments(@javax.annotation.Nonnull Integer numFragments) { + this.numFragments = numFragments; + return this; + } + + /** + * Number of fragments in the table minimum: 0 + * + * @return numFragments + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUM_FRAGMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getNumFragments() { + return numFragments; + } + + @JsonProperty(JSON_PROPERTY_NUM_FRAGMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumFragments(@javax.annotation.Nonnull Integer numFragments) { + this.numFragments = numFragments; + } + + /** Return true if this TableBasicStats object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableBasicStats tableBasicStats = (TableBasicStats) o; + return Objects.equals(this.numDeletedRows, tableBasicStats.numDeletedRows) + && Objects.equals(this.numFragments, tableBasicStats.numFragments); + } + + @Override + public int hashCode() { + return Objects.hash(numDeletedRows, numFragments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableBasicStats {\n"); + sb.append(" numDeletedRows: ").append(toIndentedString(numDeletedRows)).append("\n"); + sb.append(" numFragments: ").append(toIndentedString(numFragments)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `num_deleted_rows` to the URL query string + if (getNumDeletedRows() != null) { + joiner.add( + String.format( + "%snum_deleted_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumDeletedRows())))); + } + + // add `num_fragments` to the URL query string + if (getNumFragments() != null) { + joiner.add( + String.format( + "%snum_fragments%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumFragments())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableExistsRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableExistsRequest.java new file mode 100644 index 000000000..b64f160d7 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableExistsRequest.java @@ -0,0 +1,288 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** TableExistsRequest */ +@JsonPropertyOrder({ + TableExistsRequest.JSON_PROPERTY_IDENTITY, + TableExistsRequest.JSON_PROPERTY_CONTEXT, + TableExistsRequest.JSON_PROPERTY_ID, + TableExistsRequest.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TableExistsRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nullable private Long version; + + public TableExistsRequest() {} + + public TableExistsRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public TableExistsRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public TableExistsRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public TableExistsRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public TableExistsRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public TableExistsRequest version(@javax.annotation.Nullable Long version) { + this.version = version; + return this; + } + + /** + * Version of the table to check existence. If not specified, server should resolve it to the + * latest version. minimum: 0 + * + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@javax.annotation.Nullable Long version) { + this.version = version; + } + + /** Return true if this TableExistsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableExistsRequest tableExistsRequest = (TableExistsRequest) o; + return Objects.equals(this.identity, tableExistsRequest.identity) + && Objects.equals(this.context, tableExistsRequest.context) + && Objects.equals(this.id, tableExistsRequest.id) + && Objects.equals(this.version, tableExistsRequest.version); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableExistsRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableVersion.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableVersion.java new file mode 100644 index 000000000..5d7f1ae47 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TableVersion.java @@ -0,0 +1,343 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** TableVersion */ +@JsonPropertyOrder({ + TableVersion.JSON_PROPERTY_VERSION, + TableVersion.JSON_PROPERTY_MANIFEST_PATH, + TableVersion.JSON_PROPERTY_MANIFEST_SIZE, + TableVersion.JSON_PROPERTY_E_TAG, + TableVersion.JSON_PROPERTY_TIMESTAMP_MILLIS, + TableVersion.JSON_PROPERTY_METADATA +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TableVersion { + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public static final String JSON_PROPERTY_MANIFEST_PATH = "manifest_path"; + @javax.annotation.Nonnull private String manifestPath; + + public static final String JSON_PROPERTY_MANIFEST_SIZE = "manifest_size"; + @javax.annotation.Nullable private Long manifestSize; + + public static final String JSON_PROPERTY_E_TAG = "e_tag"; + @javax.annotation.Nullable private String eTag; + + public static final String JSON_PROPERTY_TIMESTAMP_MILLIS = "timestamp_millis"; + @javax.annotation.Nullable private Long timestampMillis; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public TableVersion() {} + + public TableVersion version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version number minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + public TableVersion manifestPath(@javax.annotation.Nonnull String manifestPath) { + this.manifestPath = manifestPath; + return this; + } + + /** + * Path to the manifest file for this version. + * + * @return manifestPath + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MANIFEST_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getManifestPath() { + return manifestPath; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setManifestPath(@javax.annotation.Nonnull String manifestPath) { + this.manifestPath = manifestPath; + } + + public TableVersion manifestSize(@javax.annotation.Nullable Long manifestSize) { + this.manifestSize = manifestSize; + return this; + } + + /** + * Size of the manifest file in bytes minimum: 0 + * + * @return manifestSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getManifestSize() { + return manifestSize; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManifestSize(@javax.annotation.Nullable Long manifestSize) { + this.manifestSize = manifestSize; + } + + public TableVersion eTag(@javax.annotation.Nullable String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Optional ETag for optimistic concurrency control. Useful for S3 and similar object stores. + * + * @return eTag + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_E_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String geteTag() { + return eTag; + } + + @JsonProperty(JSON_PROPERTY_E_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void seteTag(@javax.annotation.Nullable String eTag) { + this.eTag = eTag; + } + + public TableVersion timestampMillis(@javax.annotation.Nullable Long timestampMillis) { + this.timestampMillis = timestampMillis; + return this; + } + + /** + * Timestamp when the version was created, in milliseconds since epoch (Unix time) + * + * @return timestampMillis + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP_MILLIS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimestampMillis() { + return timestampMillis; + } + + @JsonProperty(JSON_PROPERTY_TIMESTAMP_MILLIS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestampMillis(@javax.annotation.Nullable Long timestampMillis) { + this.timestampMillis = timestampMillis; + } + + public TableVersion metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public TableVersion putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Optional key-value pairs of metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + /** Return true if this TableVersion object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableVersion tableVersion = (TableVersion) o; + return Objects.equals(this.version, tableVersion.version) + && Objects.equals(this.manifestPath, tableVersion.manifestPath) + && Objects.equals(this.manifestSize, tableVersion.manifestSize) + && Objects.equals(this.eTag, tableVersion.eTag) + && Objects.equals(this.timestampMillis, tableVersion.timestampMillis) + && Objects.equals(this.metadata, tableVersion.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(version, manifestPath, manifestSize, eTag, timestampMillis, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableVersion {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" manifestPath: ").append(toIndentedString(manifestPath)).append("\n"); + sb.append(" manifestSize: ").append(toIndentedString(manifestSize)).append("\n"); + sb.append(" eTag: ").append(toIndentedString(eTag)).append("\n"); + sb.append(" timestampMillis: ").append(toIndentedString(timestampMillis)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `manifest_path` to the URL query string + if (getManifestPath() != null) { + joiner.add( + String.format( + "%smanifest_path%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestPath())))); + } + + // add `manifest_size` to the URL query string + if (getManifestSize() != null) { + joiner.add( + String.format( + "%smanifest_size%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestSize())))); + } + + // add `e_tag` to the URL query string + if (geteTag() != null) { + joiner.add( + String.format( + "%se_tag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(geteTag())))); + } + + // add `timestamp_millis` to the URL query string + if (getTimestampMillis() != null) { + joiner.add( + String.format( + "%stimestamp_millis%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimestampMillis())))); + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TagContents.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TagContents.java new file mode 100644 index 000000000..2b6f0ba35 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/TagContents.java @@ -0,0 +1,214 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** TagContents */ +@JsonPropertyOrder({ + TagContents.JSON_PROPERTY_BRANCH, + TagContents.JSON_PROPERTY_VERSION, + TagContents.JSON_PROPERTY_MANIFEST_SIZE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TagContents { + public static final String JSON_PROPERTY_BRANCH = "branch"; + @javax.annotation.Nullable private String branch; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public static final String JSON_PROPERTY_MANIFEST_SIZE = "manifestSize"; + @javax.annotation.Nonnull private Long manifestSize; + + public TagContents() {} + + public TagContents branch(@javax.annotation.Nullable String branch) { + this.branch = branch; + return this; + } + + /** + * Branch name that the tag was created on (if any) + * + * @return branch + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BRANCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBranch() { + return branch; + } + + @JsonProperty(JSON_PROPERTY_BRANCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBranch(@javax.annotation.Nullable String branch) { + this.branch = branch; + } + + public TagContents version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * Version number that the tag points to minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + public TagContents manifestSize(@javax.annotation.Nonnull Long manifestSize) { + this.manifestSize = manifestSize; + return this; + } + + /** + * Size of the manifest file in bytes minimum: 0 + * + * @return manifestSize + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getManifestSize() { + return manifestSize; + } + + @JsonProperty(JSON_PROPERTY_MANIFEST_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setManifestSize(@javax.annotation.Nonnull Long manifestSize) { + this.manifestSize = manifestSize; + } + + /** Return true if this TagContents object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TagContents tagContents = (TagContents) o; + return Objects.equals(this.branch, tagContents.branch) + && Objects.equals(this.version, tagContents.version) + && Objects.equals(this.manifestSize, tagContents.manifestSize); + } + + @Override + public int hashCode() { + return Objects.hash(branch, version, manifestSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TagContents {\n"); + sb.append(" branch: ").append(toIndentedString(branch)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" manifestSize: ").append(toIndentedString(manifestSize)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `branch` to the URL query string + if (getBranch() != null) { + joiner.add( + String.format( + "%sbranch%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBranch())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `manifestSize` to the URL query string + if (getManifestSize() != null) { + joiner.add( + String.format( + "%smanifestSize%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getManifestSize())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableRequest.java new file mode 100644 index 000000000..66d87bf37 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableRequest.java @@ -0,0 +1,395 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Each update consists of a column name and an SQL expression that will be evaluated against the + * current row's value. Optionally, a predicate can be provided to filter which rows to update. + */ +@JsonPropertyOrder({ + UpdateTableRequest.JSON_PROPERTY_IDENTITY, + UpdateTableRequest.JSON_PROPERTY_CONTEXT, + UpdateTableRequest.JSON_PROPERTY_ID, + UpdateTableRequest.JSON_PROPERTY_PREDICATE, + UpdateTableRequest.JSON_PROPERTY_UPDATES, + UpdateTableRequest.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UpdateTableRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_PREDICATE = "predicate"; + @javax.annotation.Nullable private String predicate; + + public static final String JSON_PROPERTY_UPDATES = "updates"; + @javax.annotation.Nonnull private List> updates = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public UpdateTableRequest() {} + + public UpdateTableRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public UpdateTableRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public UpdateTableRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public UpdateTableRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public UpdateTableRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public UpdateTableRequest predicate(@javax.annotation.Nullable String predicate) { + this.predicate = predicate; + return this; + } + + /** + * Optional SQL predicate to filter rows for update + * + * @return predicate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREDICATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPredicate() { + return predicate; + } + + @JsonProperty(JSON_PROPERTY_PREDICATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPredicate(@javax.annotation.Nullable String predicate) { + this.predicate = predicate; + } + + public UpdateTableRequest updates(@javax.annotation.Nonnull List> updates) { + this.updates = updates; + return this; + } + + public UpdateTableRequest addUpdatesItem(List updatesItem) { + if (this.updates == null) { + this.updates = new ArrayList<>(); + } + this.updates.add(updatesItem); + return this; + } + + /** + * List of column updates as [column_name, expression] pairs + * + * @return updates + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List> getUpdates() { + return updates; + } + + @JsonProperty(JSON_PROPERTY_UPDATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUpdates(@javax.annotation.Nonnull List> updates) { + this.updates = updates; + } + + public UpdateTableRequest properties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public UpdateTableRequest putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Properties stored on the table, if supported by the implementation. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this UpdateTableRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTableRequest updateTableRequest = (UpdateTableRequest) o; + return Objects.equals(this.identity, updateTableRequest.identity) + && Objects.equals(this.context, updateTableRequest.context) + && Objects.equals(this.id, updateTableRequest.id) + && Objects.equals(this.predicate, updateTableRequest.predicate) + && Objects.equals(this.updates, updateTableRequest.updates) + && Objects.equals(this.properties, updateTableRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, predicate, updates, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTableRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" predicate: ").append(toIndentedString(predicate)).append("\n"); + sb.append(" updates: ").append(toIndentedString(updates)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `predicate` to the URL query string + if (getPredicate() != null) { + joiner.add( + String.format( + "%spredicate%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPredicate())))); + } + + // add `updates` to the URL query string + if (getUpdates() != null) { + for (int i = 0; i < getUpdates().size(); i++) { + joiner.add( + String.format( + "%supdates%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getUpdates().get(i))))); + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableResponse.java new file mode 100644 index 000000000..89749e3fb --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableResponse.java @@ -0,0 +1,270 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** UpdateTableResponse */ +@JsonPropertyOrder({ + UpdateTableResponse.JSON_PROPERTY_TRANSACTION_ID, + UpdateTableResponse.JSON_PROPERTY_UPDATED_ROWS, + UpdateTableResponse.JSON_PROPERTY_VERSION, + UpdateTableResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UpdateTableResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public static final String JSON_PROPERTY_UPDATED_ROWS = "updated_rows"; + @javax.annotation.Nonnull private Long updatedRows; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public UpdateTableResponse() {} + + public UpdateTableResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + public UpdateTableResponse updatedRows(@javax.annotation.Nonnull Long updatedRows) { + this.updatedRows = updatedRows; + return this; + } + + /** + * Number of rows updated minimum: 0 + * + * @return updatedRows + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UPDATED_ROWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getUpdatedRows() { + return updatedRows; + } + + @JsonProperty(JSON_PROPERTY_UPDATED_ROWS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUpdatedRows(@javax.annotation.Nonnull Long updatedRows) { + this.updatedRows = updatedRows; + } + + public UpdateTableResponse version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * The commit version associated with the operation minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + public UpdateTableResponse properties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + return this; + } + + public UpdateTableResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * If the implementation does not support table properties, it should return null for this field. + * Otherwise, it should return the properties. + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + /** Return true if this UpdateTableResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTableResponse updateTableResponse = (UpdateTableResponse) o; + return Objects.equals(this.transactionId, updateTableResponse.transactionId) + && Objects.equals(this.updatedRows, updateTableResponse.updatedRows) + && Objects.equals(this.version, updateTableResponse.version) + && Objects.equals(this.properties, updateTableResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId, updatedRows, version, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTableResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" updatedRows: ").append(toIndentedString(updatedRows)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + // add `updated_rows` to the URL query string + if (getUpdatedRows() != null) { + joiner.add( + String.format( + "%supdated_rows%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUpdatedRows())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableSchemaMetadataRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableSchemaMetadataRequest.java new file mode 100644 index 000000000..829ac63c2 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableSchemaMetadataRequest.java @@ -0,0 +1,306 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** UpdateTableSchemaMetadataRequest */ +@JsonPropertyOrder({ + UpdateTableSchemaMetadataRequest.JSON_PROPERTY_IDENTITY, + UpdateTableSchemaMetadataRequest.JSON_PROPERTY_CONTEXT, + UpdateTableSchemaMetadataRequest.JSON_PROPERTY_ID, + UpdateTableSchemaMetadataRequest.JSON_PROPERTY_METADATA +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UpdateTableSchemaMetadataRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public UpdateTableSchemaMetadataRequest() {} + + public UpdateTableSchemaMetadataRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public UpdateTableSchemaMetadataRequest context( + @javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public UpdateTableSchemaMetadataRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public UpdateTableSchemaMetadataRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public UpdateTableSchemaMetadataRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * The table identifier + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public UpdateTableSchemaMetadataRequest metadata( + @javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public UpdateTableSchemaMetadataRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Schema metadata key-value pairs to set + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + /** Return true if this UpdateTableSchemaMetadataRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTableSchemaMetadataRequest updateTableSchemaMetadataRequest = + (UpdateTableSchemaMetadataRequest) o; + return Objects.equals(this.identity, updateTableSchemaMetadataRequest.identity) + && Objects.equals(this.context, updateTableSchemaMetadataRequest.context) + && Objects.equals(this.id, updateTableSchemaMetadataRequest.id) + && Objects.equals(this.metadata, updateTableSchemaMetadataRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTableSchemaMetadataRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableSchemaMetadataResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableSchemaMetadataResponse.java new file mode 100644 index 000000000..0dc045976 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableSchemaMetadataResponse.java @@ -0,0 +1,198 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** UpdateTableSchemaMetadataResponse */ +@JsonPropertyOrder({ + UpdateTableSchemaMetadataResponse.JSON_PROPERTY_METADATA, + UpdateTableSchemaMetadataResponse.JSON_PROPERTY_TRANSACTION_ID +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UpdateTableSchemaMetadataResponse { + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable private Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public UpdateTableSchemaMetadataResponse() {} + + public UpdateTableSchemaMetadataResponse metadata( + @javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public UpdateTableSchemaMetadataResponse putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * The updated schema metadata + * + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + public UpdateTableSchemaMetadataResponse transactionId( + @javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this UpdateTableSchemaMetadataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTableSchemaMetadataResponse updateTableSchemaMetadataResponse = + (UpdateTableSchemaMetadataResponse) o; + return Objects.equals(this.metadata, updateTableSchemaMetadataResponse.metadata) + && Objects.equals(this.transactionId, updateTableSchemaMetadataResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTableSchemaMetadataResponse {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `metadata` to the URL query string + if (getMetadata() != null) { + for (String _key : getMetadata().keySet()) { + joiner.add( + String.format( + "%smetadata%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getMetadata().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getMetadata().get(_key))))); + } + } + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableTagRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableTagRequest.java new file mode 100644 index 000000000..76c74ba32 --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableTagRequest.java @@ -0,0 +1,324 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** UpdateTableTagRequest */ +@JsonPropertyOrder({ + UpdateTableTagRequest.JSON_PROPERTY_IDENTITY, + UpdateTableTagRequest.JSON_PROPERTY_CONTEXT, + UpdateTableTagRequest.JSON_PROPERTY_ID, + UpdateTableTagRequest.JSON_PROPERTY_TAG, + UpdateTableTagRequest.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UpdateTableTagRequest { + public static final String JSON_PROPERTY_IDENTITY = "identity"; + @javax.annotation.Nullable private Identity identity; + + public static final String JSON_PROPERTY_CONTEXT = "context"; + @javax.annotation.Nullable private Map context = new HashMap<>(); + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable private List id = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAG = "tag"; + @javax.annotation.Nonnull private String tag; + + public static final String JSON_PROPERTY_VERSION = "version"; + @javax.annotation.Nonnull private Long version; + + public UpdateTableTagRequest() {} + + public UpdateTableTagRequest identity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get identity + * + * @return identity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Identity getIdentity() { + return identity; + } + + @JsonProperty(JSON_PROPERTY_IDENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentity(@javax.annotation.Nullable Identity identity) { + this.identity = identity; + } + + public UpdateTableTagRequest context(@javax.annotation.Nullable Map context) { + this.context = context; + return this; + } + + public UpdateTableTagRequest putContextItem(String key, String contextItem) { + if (this.context == null) { + this.context = new HashMap<>(); + } + this.context.put(key, contextItem); + return this; + } + + /** + * Arbitrary context for a request as key-value pairs. How to use the context is custom to the + * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using + * the naming convention `x-lance-ctx-<key>: <value>`. For example, a + * context entry `{\"trace_id\": \"abc123\"}` would be sent as the + * header `x-lance-ctx-trace_id: abc123`. + * + * @return context + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getContext() { + return context; + } + + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContext(@javax.annotation.Nullable Map context) { + this.context = context; + } + + public UpdateTableTagRequest id(@javax.annotation.Nullable List id) { + this.id = id; + return this; + } + + public UpdateTableTagRequest addIdItem(String idItem) { + if (this.id == null) { + this.id = new ArrayList<>(); + } + this.id.add(idItem); + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable List id) { + this.id = id; + } + + public UpdateTableTagRequest tag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + return this; + } + + /** + * Name of the tag to update + * + * @return tag + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTag() { + return tag; + } + + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTag(@javax.annotation.Nonnull String tag) { + this.tag = tag; + } + + public UpdateTableTagRequest version(@javax.annotation.Nonnull Long version) { + this.version = version; + return this; + } + + /** + * New version number for the tag to point to minimum: 0 + * + * @return version + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVersion(@javax.annotation.Nonnull Long version) { + this.version = version; + } + + /** Return true if this UpdateTableTagRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTableTagRequest updateTableTagRequest = (UpdateTableTagRequest) o; + return Objects.equals(this.identity, updateTableTagRequest.identity) + && Objects.equals(this.context, updateTableTagRequest.context) + && Objects.equals(this.id, updateTableTagRequest.id) + && Objects.equals(this.tag, updateTableTagRequest.tag) + && Objects.equals(this.version, updateTableTagRequest.version); + } + + @Override + public int hashCode() { + return Objects.hash(identity, context, id, tag, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTableTagRequest {\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `identity` to the URL query string + if (getIdentity() != null) { + joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); + } + + // add `context` to the URL query string + if (getContext() != null) { + for (String _key : getContext().keySet()) { + joiner.add( + String.format( + "%scontext%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getContext().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); + } + } + + // add `id` to the URL query string + if (getId() != null) { + for (int i = 0; i < getId().size(); i++) { + joiner.add( + String.format( + "%sid%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); + } + } + + // add `tag` to the URL query string + if (getTag() != null) { + joiner.add( + String.format( + "%stag%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTag())))); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add( + String.format( + "%sversion%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableTagResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableTagResponse.java new file mode 100644 index 000000000..069530f1b --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/UpdateTableTagResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** Response for update tag operation */ +@JsonPropertyOrder({UpdateTableTagResponse.JSON_PROPERTY_TRANSACTION_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UpdateTableTagResponse { + public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; + @javax.annotation.Nullable private String transactionId; + + public UpdateTableTagResponse() {} + + public UpdateTableTagResponse transactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Optional transaction identifier + * + * @return transactionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionId() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionId(@javax.annotation.Nullable String transactionId) { + this.transactionId = transactionId; + } + + /** Return true if this UpdateTableTagResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTableTagResponse updateTableTagResponse = (UpdateTableTagResponse) o; + return Objects.equals(this.transactionId, updateTableTagResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTableTagResponse {\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transaction_id` to the URL query string + if (getTransactionId() != null) { + joiner.add( + String.format( + "%stransaction_id%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/VersionRange.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/VersionRange.java new file mode 100644 index 000000000..b5c3f8ede --- /dev/null +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/VersionRange.java @@ -0,0 +1,181 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.model; + +import org.lance.namespace.client.async.ApiClient; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.Objects; +import java.util.StringJoiner; + +/** + * A range of versions to delete (start inclusive, end exclusive). Special values: - + * `start_version: 0` with `end_version: -1` means ALL versions + */ +@JsonPropertyOrder({ + VersionRange.JSON_PROPERTY_START_VERSION, + VersionRange.JSON_PROPERTY_END_VERSION +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class VersionRange { + public static final String JSON_PROPERTY_START_VERSION = "start_version"; + @javax.annotation.Nonnull private Long startVersion; + + public static final String JSON_PROPERTY_END_VERSION = "end_version"; + @javax.annotation.Nonnull private Long endVersion; + + public VersionRange() {} + + public VersionRange startVersion(@javax.annotation.Nonnull Long startVersion) { + this.startVersion = startVersion; + return this; + } + + /** + * Start version of the range (inclusive). Use 0 to start from the first version. + * + * @return startVersion + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_START_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getStartVersion() { + return startVersion; + } + + @JsonProperty(JSON_PROPERTY_START_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartVersion(@javax.annotation.Nonnull Long startVersion) { + this.startVersion = startVersion; + } + + public VersionRange endVersion(@javax.annotation.Nonnull Long endVersion) { + this.endVersion = endVersion; + return this; + } + + /** + * End version of the range (exclusive). Use -1 to indicate all versions up to and including the + * latest. + * + * @return endVersion + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_END_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEndVersion() { + return endVersion; + } + + @JsonProperty(JSON_PROPERTY_END_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndVersion(@javax.annotation.Nonnull Long endVersion) { + this.endVersion = endVersion; + } + + /** Return true if this VersionRange object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionRange versionRange = (VersionRange) o; + return Objects.equals(this.startVersion, versionRange.startVersion) + && Objects.equals(this.endVersion, versionRange.endVersion); + } + + @Override + public int hashCode() { + return Objects.hash(startVersion, endVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionRange {\n"); + sb.append(" startVersion: ").append(toIndentedString(startVersion)).append("\n"); + sb.append(" endVersion: ").append(toIndentedString(endVersion)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `start_version` to the URL query string + if (getStartVersion() != null) { + joiner.add( + String.format( + "%sstart_version%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStartVersion())))); + } + + // add `end_version` to the URL query string + if (getEndVersion() != null) { + joiner.add( + String.format( + "%send_version%s=%s", + prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndVersion())))); + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-core-async/pom.xml b/java/lance-namespace-core-async/pom.xml new file mode 100644 index 000000000..04bf484ee --- /dev/null +++ b/java/lance-namespace-core-async/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + + org.lance + lance-namespace-root + 0.5.2 + + + lance-namespace-core-async + jar + + lance-namespace-core-async + Lance Namespace async interface with CompletableFuture support + + + + + org.lance + lance-namespace-async-client + ${project.version} + + + + + org.apache.arrow + arrow-memory-core + ${arrow.version} + + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.apache.arrow + arrow-memory-netty + ${arrow.version} + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 11 + 11 + 11 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + + diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java new file mode 100644 index 000000000..e1817c2e6 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java @@ -0,0 +1,759 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async; + +import org.lance.namespace.async.errors.UnsupportedOperationException; +import org.lance.namespace.model.*; + +import org.apache.arrow.memory.BufferAllocator; + +import java.lang.reflect.Constructor; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Async interface for LanceDB namespace operations. + * + *

A namespace provides hierarchical organization for tables and supports various storage + * backends (local filesystem, S3, Azure, GCS) with optional credential vending for cloud providers. + * + *

This is the async version of LanceNamespace, where all operations return {@link + * CompletableFuture} for non-blocking execution. + * + *

Implementations of this interface can provide different storage backends. Native + * implementations (DirectoryNamespace, RestNamespace) are provided by the lance package. External + * libraries can implement this interface to provide integration with catalog systems like AWS Glue, + * Hive Metastore, or Databricks Unity Catalog. + * + *

Most methods have default implementations that return failed futures with {@link + * org.lance.namespace.async.errors.UnsupportedOperationException}. Implementations should override + * the methods they support. + * + *

Use {@link #connect(String, Map, BufferAllocator)} to create namespace instances, and {@link + * #registerNamespaceImpl(String, String)} to register external implementations. + * + *

Error Handling

+ * + *

All operations return CompletableFuture that may complete exceptionally with exceptions from + * the {@link org.lance.namespace.async.errors} package. Common errors include: + * + *

    + *
  • {@link org.lance.namespace.async.errors.UnsupportedOperationException} - operation not + * supported + *
  • {@link org.lance.namespace.async.errors.InvalidInputException} - invalid request parameters + *
  • {@link org.lance.namespace.async.errors.PermissionDeniedException} - insufficient + * permissions + *
  • {@link org.lance.namespace.async.errors.UnauthenticatedException} - invalid credentials + *
  • {@link org.lance.namespace.async.errors.ServiceUnavailableException} - service unavailable + *
  • {@link org.lance.namespace.async.errors.InternalException} - unexpected internal error + *
+ * + *

See individual method documentation for operation-specific errors. + */ +public interface LanceNamespaceAsync { + + // ========== Static Registry and Factory Methods ========== + + /** Native implementations (provided by lance package). */ + Map NATIVE_IMPLS = + Collections.unmodifiableMap( + new HashMap() { + { + put("dir", "org.lance.namespace.async.DirectoryNamespaceAsync"); + put("rest", "org.lance.namespace.async.RestNamespaceAsync"); + } + }); + + /** Plugin registry for external implementations. Thread-safe for concurrent access. */ + Map REGISTERED_IMPLS = new ConcurrentHashMap<>(); + + /** + * Register a namespace implementation with a short name. + * + *

External libraries can use this to register their implementations, allowing users to use + * short names like "glue" instead of full class paths. + * + * @param name Short name for the implementation (e.g., "glue", "hive2", "unity") + * @param className Full class name (e.g., "org.lance.namespace.async.glue.GlueNamespaceAsync") + */ + static void registerNamespaceImpl(String name, String className) { + REGISTERED_IMPLS.put(name, className); + } + + /** + * Unregister a previously registered namespace implementation. + * + * @param name Short name of the implementation to unregister + * @return true if an implementation was removed, false if it wasn't registered + */ + static boolean unregisterNamespaceImpl(String name) { + return REGISTERED_IMPLS.remove(name) != null; + } + + /** + * Check if an implementation is registered with the given name. + * + * @param name Short name or class name to check + * @return true if the implementation is available + */ + static boolean isRegistered(String name) { + return NATIVE_IMPLS.containsKey(name) || REGISTERED_IMPLS.containsKey(name); + } + + /** + * Connect to a Lance namespace implementation. + * + *

This factory method creates namespace instances based on implementation aliases or full + * class names. It provides a unified way to instantiate different namespace backends. + * + * @param impl Implementation alias or full class name. Built-in aliases: "dir" for + * DirectoryNamespaceAsync, "rest" for RestNamespaceAsync (provided by lance package). + * External libraries can register additional aliases using {@link + * #registerNamespaceImpl(String, String)}. + * @param properties Configuration properties passed to the namespace + * @param allocator Arrow buffer allocator for memory management + * @return The connected namespace instance + * @throws IllegalArgumentException If the implementation class cannot be loaded or does not + * implement LanceNamespaceAsync interface + */ + static LanceNamespaceAsync connect( + String impl, Map properties, BufferAllocator allocator) { + String className = NATIVE_IMPLS.get(impl); + if (className == null) { + className = REGISTERED_IMPLS.get(impl); + } + if (className == null) { + className = impl; + } + + try { + Class clazz = Class.forName(className); + + if (!LanceNamespaceAsync.class.isAssignableFrom(clazz)) { + throw new IllegalArgumentException( + "Class " + className + " does not implement LanceNamespaceAsync interface"); + } + + @SuppressWarnings("unchecked") + Class namespaceClass = + (Class) clazz; + + Constructor constructor = namespaceClass.getConstructor(); + LanceNamespaceAsync namespace = constructor.newInstance(); + namespace.initialize(properties, allocator); + + return namespace; + } catch (ClassNotFoundException e) { + throw new IllegalArgumentException("Namespace implementation class not found: " + className); + } catch (NoSuchMethodException e) { + throw new IllegalArgumentException( + "Namespace implementation class " + className + " must have a no-arg constructor"); + } catch (Exception e) { + throw new IllegalArgumentException( + "Failed to construct namespace impl " + className + ": " + e.getMessage(), e); + } + } + + // ========== Instance Methods ========== + + /** + * Initialize the namespace with configuration properties. + * + * @param configProperties Configuration properties (e.g., root path, storage options) + * @param allocator Arrow buffer allocator for memory management + */ + void initialize(Map configProperties, BufferAllocator allocator); + + /** + * Return a human-readable unique identifier for this namespace instance. + * + *

This is used for equality comparison and caching. Two namespace instances with the same ID + * are considered equal and will share cached resources. + * + * @return A human-readable unique identifier string + */ + String namespaceId(); + + // Namespace operations + + /** + * List namespaces. + * + * @param request The list namespaces request + * @return A CompletableFuture containing the list namespaces response + */ + default CompletableFuture listNamespaces(ListNamespacesRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: listNamespaces")); + } + + /** + * Describe a namespace. + * + * @param request The describe namespace request + * @return A CompletableFuture containing the describe namespace response + */ + default CompletableFuture describeNamespace( + DescribeNamespaceRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: describeNamespace")); + } + + /** + * Create a new namespace. + * + * @param request The create namespace request + * @return A CompletableFuture containing the create namespace response + */ + default CompletableFuture createNamespace( + CreateNamespaceRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createNamespace")); + } + + /** + * Drop a namespace. + * + * @param request The drop namespace request + * @return A CompletableFuture containing the drop namespace response + */ + default CompletableFuture dropNamespace(DropNamespaceRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: dropNamespace")); + } + + /** + * Check if a namespace exists. + * + * @param request The namespace exists request + * @return A CompletableFuture that completes successfully if namespace exists, or exceptionally + * if not + */ + default CompletableFuture namespaceExists(NamespaceExistsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: namespaceExists")); + } + + // Table operations + + /** + * List tables in a namespace. + * + * @param request The list tables request + * @return A CompletableFuture containing the list tables response + */ + default CompletableFuture listTables(ListTablesRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: listTables")); + } + + /** + * Describe a table. + * + * @param request The describe table request + * @return A CompletableFuture containing the describe table response + */ + default CompletableFuture describeTable(DescribeTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: describeTable")); + } + + /** + * Register a table. + * + * @param request The register table request + * @return A CompletableFuture containing the register table response + */ + default CompletableFuture registerTable(RegisterTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: registerTable")); + } + + /** + * Check if a table exists. + * + * @param request The table exists request + * @return A CompletableFuture that completes successfully if table exists, or exceptionally if + * not + */ + default CompletableFuture tableExists(TableExistsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: tableExists")); + } + + /** + * Drop a table. + * + * @param request The drop table request + * @return A CompletableFuture containing the drop table response + */ + default CompletableFuture dropTable(DropTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: dropTable")); + } + + /** + * Deregister a table. + * + * @param request The deregister table request + * @return A CompletableFuture containing the deregister table response + */ + default CompletableFuture deregisterTable( + DeregisterTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: deregisterTable")); + } + + /** + * Count rows in a table. + * + * @param request The count table rows request + * @return A CompletableFuture containing the row count + */ + default CompletableFuture countTableRows(CountTableRowsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: countTableRows")); + } + + // Data operations + + /** + * Create a new table with data from Arrow IPC stream. + * + * @param request The create table request + * @param requestData Arrow IPC stream data + * @return A CompletableFuture containing the create table response + */ + default CompletableFuture createTable( + CreateTableRequest request, byte[] requestData) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createTable")); + } + + /** + * Declare a table (metadata only operation). + * + * @param request The declare table request + * @return A CompletableFuture containing the declare table response + */ + default CompletableFuture declareTable(DeclareTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: declareTable")); + } + + /** + * Create an empty table (metadata only operation). + * + * @param request The create empty table request + * @return A CompletableFuture containing the create empty table response + * @deprecated Use {@link #declareTable(DeclareTableRequest)} instead. + */ + @Deprecated + default CompletableFuture createEmptyTable( + CreateEmptyTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createEmptyTable")); + } + + /** + * Insert data into a table. + * + * @param request The insert into table request + * @param requestData Arrow IPC stream data + * @return A CompletableFuture containing the insert into table response + */ + default CompletableFuture insertIntoTable( + InsertIntoTableRequest request, byte[] requestData) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: insertIntoTable")); + } + + /** + * Merge insert data into a table. + * + * @param request The merge insert into table request + * @param requestData Arrow IPC stream data + * @return A CompletableFuture containing the merge insert into table response + */ + default CompletableFuture mergeInsertIntoTable( + MergeInsertIntoTableRequest request, byte[] requestData) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: mergeInsertIntoTable")); + } + + /** + * Update a table. + * + * @param request The update table request + * @return A CompletableFuture containing the update table response + */ + default CompletableFuture updateTable(UpdateTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: updateTable")); + } + + /** + * Delete from a table. + * + * @param request The delete from table request + * @return A CompletableFuture containing the delete from table response + */ + default CompletableFuture deleteFromTable( + DeleteFromTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: deleteFromTable")); + } + + /** + * Query a table. + * + * @param request The query table request + * @return A CompletableFuture containing Arrow IPC stream data with query results + */ + default CompletableFuture queryTable(QueryTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: queryTable")); + } + + // Index operations + + /** + * Create a table index. + * + * @param request The create table index request + * @return A CompletableFuture containing the create table index response + */ + default CompletableFuture createTableIndex( + CreateTableIndexRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createTableIndex")); + } + + /** + * Create a scalar index on a table. + * + * @param request The create table index request + * @return A CompletableFuture containing the create table scalar index response + */ + default CompletableFuture createTableScalarIndex( + CreateTableIndexRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createTableScalarIndex")); + } + + /** + * List table indices. + * + * @param request The list table indices request + * @return A CompletableFuture containing the list table indices response + */ + default CompletableFuture listTableIndices( + ListTableIndicesRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: listTableIndices")); + } + + /** + * Describe table index statistics. + * + * @param request The describe table index stats request + * @param indexName The name of the index + * @return A CompletableFuture containing the describe table index stats response + */ + default CompletableFuture describeTableIndexStats( + DescribeTableIndexStatsRequest request, String indexName) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: describeTableIndexStats")); + } + + /** + * Drop a table index. + * + * @param request The drop table index request + * @param indexName The name of the index + * @return A CompletableFuture containing the drop table index response + */ + default CompletableFuture dropTableIndex( + DropTableIndexRequest request, String indexName) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: dropTableIndex")); + } + + // Table version and schema operations + + /** + * List all tables across all namespaces. + * + * @param request The list tables request + * @return A CompletableFuture containing the list tables response + */ + default CompletableFuture listAllTables(ListTablesRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: listAllTables")); + } + + /** + * Restore a table to a specific version. + * + * @param request The restore table request + * @return A CompletableFuture containing the restore table response + */ + default CompletableFuture restoreTable(RestoreTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: restoreTable")); + } + + /** + * Rename a table. + * + * @param request The rename table request + * @return A CompletableFuture containing the rename table response + */ + default CompletableFuture renameTable(RenameTableRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: renameTable")); + } + + /** + * List all versions of a table. + * + * @param request The list table versions request + * @return A CompletableFuture containing the list table versions response + */ + default CompletableFuture listTableVersions( + ListTableVersionsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: listTableVersions")); + } + + /** + * Create a new table version entry. + * + * @param request The create table version request + * @return A CompletableFuture containing the create table version response + */ + default CompletableFuture createTableVersion( + CreateTableVersionRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createTableVersion")); + } + + /** + * Describe a specific table version. + * + * @param request The describe table version request containing the version number + * @return A CompletableFuture containing the describe table version response + */ + default CompletableFuture describeTableVersion( + DescribeTableVersionRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: describeTableVersion")); + } + + /** + * Delete table version metadata records. + * + * @param request The batch delete table versions request + * @return A CompletableFuture containing the batch delete table versions response + */ + default CompletableFuture batchDeleteTableVersions( + BatchDeleteTableVersionsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: batchDeleteTableVersions")); + } + + /** + * Atomically create new version entries for multiple tables. + * + * @param request The batch create table versions request + * @return A CompletableFuture containing the batch create table versions response + */ + default CompletableFuture batchCreateTableVersions( + BatchCreateTableVersionsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: batchCreateTableVersions")); + } + + /** + * Update table schema metadata. + * + * @param request The update table schema metadata request + * @return A CompletableFuture containing the update table schema metadata response + */ + default CompletableFuture updateTableSchemaMetadata( + UpdateTableSchemaMetadataRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: updateTableSchemaMetadata")); + } + + /** + * Get table statistics. + * + * @param request The get table stats request + * @return A CompletableFuture containing the get table stats response + */ + default CompletableFuture getTableStats(GetTableStatsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: getTableStats")); + } + + // Query plan operations + + /** + * Explain a table query plan. + * + * @param request The explain table query plan request + * @return A CompletableFuture containing the query plan explanation as a string + */ + default CompletableFuture explainTableQueryPlan(ExplainTableQueryPlanRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: explainTableQueryPlan")); + } + + /** + * Analyze a table query plan. + * + * @param request The analyze table query plan request + * @return A CompletableFuture containing the query plan analysis as a string + */ + default CompletableFuture analyzeTableQueryPlan(AnalyzeTableQueryPlanRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: analyzeTableQueryPlan")); + } + + // Column operations + + /** + * Add columns to a table. + * + * @param request The alter table add columns request + * @return A CompletableFuture containing the alter table add columns response + */ + default CompletableFuture alterTableAddColumns( + AlterTableAddColumnsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: alterTableAddColumns")); + } + + /** + * Alter columns in a table. + * + * @param request The alter table alter columns request + * @return A CompletableFuture containing the alter table alter columns response + */ + default CompletableFuture alterTableAlterColumns( + AlterTableAlterColumnsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: alterTableAlterColumns")); + } + + /** + * Drop columns from a table. + * + * @param request The alter table drop columns request + * @return A CompletableFuture containing the alter table drop columns response + */ + default CompletableFuture alterTableDropColumns( + AlterTableDropColumnsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: alterTableDropColumns")); + } + + // Tag operations + + /** + * List all tags for a table. + * + * @param request The list table tags request + * @return A CompletableFuture containing the list table tags response + */ + default CompletableFuture listTableTags(ListTableTagsRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: listTableTags")); + } + + /** + * Get the version for a specific tag. + * + * @param request The get table tag version request + * @return A CompletableFuture containing the get table tag version response + */ + default CompletableFuture getTableTagVersion( + GetTableTagVersionRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: getTableTagVersion")); + } + + /** + * Create a tag for a table. + * + * @param request The create table tag request + * @return A CompletableFuture containing the create table tag response + */ + default CompletableFuture createTableTag(CreateTableTagRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: createTableTag")); + } + + /** + * Delete a tag from a table. + * + * @param request The delete table tag request + * @return A CompletableFuture containing the delete table tag response + */ + default CompletableFuture deleteTableTag(DeleteTableTagRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: deleteTableTag")); + } + + /** + * Update a tag for a table. + * + * @param request The update table tag request + * @return A CompletableFuture containing the update table tag response + */ + default CompletableFuture updateTableTag(UpdateTableTagRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: updateTableTag")); + } + + // Transaction operations + + /** + * Describe a transaction. + * + * @param request The describe transaction request + * @return A CompletableFuture containing the describe transaction response + */ + default CompletableFuture describeTransaction( + DescribeTransactionRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: describeTransaction")); + } + + /** + * Alter a transaction. + * + * @param request The alter transaction request + * @return A CompletableFuture containing the alter transaction response + */ + default CompletableFuture alterTransaction( + AlterTransactionRequest request) { + return CompletableFuture.failedFuture( + new UnsupportedOperationException("Not supported: alterTransaction")); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ConcurrentModificationException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ConcurrentModificationException.java new file mode 100644 index 000000000..a6e83cf9b --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ConcurrentModificationException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when an optimistic concurrency conflict occurs. */ +public class ConcurrentModificationException extends LanceNamespaceException { + public ConcurrentModificationException(String message) { + super(ErrorCode.CONCURRENT_MODIFICATION, message); + } + + public ConcurrentModificationException(String message, Throwable cause) { + super(ErrorCode.CONCURRENT_MODIFICATION, message, cause); + } + + public ConcurrentModificationException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.CONCURRENT_MODIFICATION, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ErrorCode.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ErrorCode.java new file mode 100644 index 000000000..d9447e271 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ErrorCode.java @@ -0,0 +1,85 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +/** + * Lance Namespace error codes. + * + *

These codes are globally unique across all Lance Namespace implementations. + */ +public enum ErrorCode { + UNSUPPORTED(0, "Operation not supported"), + NAMESPACE_NOT_FOUND(1, "Namespace not found"), + NAMESPACE_ALREADY_EXISTS(2, "Namespace already exists"), + NAMESPACE_NOT_EMPTY(3, "Namespace not empty"), + TABLE_NOT_FOUND(4, "Table not found"), + TABLE_ALREADY_EXISTS(5, "Table already exists"), + TABLE_INDEX_NOT_FOUND(6, "Table index not found"), + TABLE_INDEX_ALREADY_EXISTS(7, "Table index already exists"), + TABLE_TAG_NOT_FOUND(8, "Table tag not found"), + TABLE_TAG_ALREADY_EXISTS(9, "Table tag already exists"), + TRANSACTION_NOT_FOUND(10, "Transaction not found"), + TABLE_VERSION_NOT_FOUND(11, "Table version not found"), + TABLE_COLUMN_NOT_FOUND(12, "Table column not found"), + INVALID_INPUT(13, "Invalid input"), + CONCURRENT_MODIFICATION(14, "Concurrent modification"), + PERMISSION_DENIED(15, "Permission denied"), + UNAUTHENTICATED(16, "Unauthenticated"), + SERVICE_UNAVAILABLE(17, "Service unavailable"), + INTERNAL(18, "Internal error"), + INVALID_TABLE_STATE(19, "Invalid table state"), + TABLE_SCHEMA_VALIDATION_ERROR(20, "Table schema validation error"), + THROTTLING(21, "Request rate limit exceeded"); + + private final int code; + private final String description; + + ErrorCode(int code, String description) { + this.code = code; + this.description = description; + } + + /** + * Returns the numeric error code. + * + * @return the numeric error code + */ + public int getCode() { + return code; + } + + /** + * Returns a human-readable description of the error. + * + * @return the error description + */ + public String getDescription() { + return description; + } + + /** + * Returns the ErrorCode for a given numeric code. + * + * @param code the numeric error code + * @return the corresponding ErrorCode, or INTERNAL if not found + */ + public static ErrorCode fromCode(int code) { + for (ErrorCode ec : values()) { + if (ec.code == code) { + return ec; + } + } + return INTERNAL; + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ErrorFactory.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ErrorFactory.java new file mode 100644 index 000000000..11b0c410e --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ErrorFactory.java @@ -0,0 +1,99 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** + * Factory for creating LanceNamespaceException instances from error codes. + * + *

This class is useful for converting ErrorResponse objects received from the REST API into the + * appropriate exception types. + */ +public final class ErrorFactory { + private ErrorFactory() {} + + /** + * Creates an appropriate exception instance based on the error code. + * + * @param code the numeric error code + * @param message the error message + * @return the appropriate exception type for the error code + */ + public static LanceNamespaceException fromErrorCode(int code, String message) { + return fromErrorCode(code, message, null, null); + } + + /** + * Creates an appropriate exception instance based on the error code. + * + * @param code the numeric error code + * @param message the error message + * @param detail optional detailed explanation + * @param instance optional identifier for this specific error occurrence + * @return the appropriate exception type for the error code + */ + public static LanceNamespaceException fromErrorCode( + int code, String message, @Nullable String detail, @Nullable String instance) { + ErrorCode errorCode = ErrorCode.fromCode(code); + switch (errorCode) { + case UNSUPPORTED: + return new UnsupportedOperationException(message, detail, instance); + case NAMESPACE_NOT_FOUND: + return new NamespaceNotFoundException(message, detail, instance); + case NAMESPACE_ALREADY_EXISTS: + return new NamespaceAlreadyExistsException(message, detail, instance); + case NAMESPACE_NOT_EMPTY: + return new NamespaceNotEmptyException(message, detail, instance); + case TABLE_NOT_FOUND: + return new TableNotFoundException(message, detail, instance); + case TABLE_ALREADY_EXISTS: + return new TableAlreadyExistsException(message, detail, instance); + case TABLE_INDEX_NOT_FOUND: + return new TableIndexNotFoundException(message, detail, instance); + case TABLE_INDEX_ALREADY_EXISTS: + return new TableIndexAlreadyExistsException(message, detail, instance); + case TABLE_TAG_NOT_FOUND: + return new TableTagNotFoundException(message, detail, instance); + case TABLE_TAG_ALREADY_EXISTS: + return new TableTagAlreadyExistsException(message, detail, instance); + case TRANSACTION_NOT_FOUND: + return new TransactionNotFoundException(message, detail, instance); + case TABLE_VERSION_NOT_FOUND: + return new TableVersionNotFoundException(message, detail, instance); + case TABLE_COLUMN_NOT_FOUND: + return new TableColumnNotFoundException(message, detail, instance); + case INVALID_INPUT: + return new InvalidInputException(message, detail, instance); + case CONCURRENT_MODIFICATION: + return new ConcurrentModificationException(message, detail, instance); + case PERMISSION_DENIED: + return new PermissionDeniedException(message, detail, instance); + case UNAUTHENTICATED: + return new UnauthenticatedException(message, detail, instance); + case SERVICE_UNAVAILABLE: + return new ServiceUnavailableException(message, detail, instance); + case INTERNAL: + return new InternalException(message, detail, instance); + case INVALID_TABLE_STATE: + return new InvalidTableStateException(message, detail, instance); + case TABLE_SCHEMA_VALIDATION_ERROR: + return new TableSchemaValidationException(message, detail, instance); + case THROTTLING: + return new ThrottlingException(message, detail, instance); + default: + return new InternalException(message, detail, instance); + } + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InternalException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InternalException.java new file mode 100644 index 000000000..dcbdb9851 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InternalException.java @@ -0,0 +1,31 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown for unexpected internal errors. */ +public class InternalException extends LanceNamespaceException { + public InternalException(String message) { + super(ErrorCode.INTERNAL, message); + } + + public InternalException(String message, Throwable cause) { + super(ErrorCode.INTERNAL, message, cause); + } + + public InternalException(String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.INTERNAL, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InvalidInputException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InvalidInputException.java new file mode 100644 index 000000000..1b25c355a --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InvalidInputException.java @@ -0,0 +1,31 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the request contains invalid parameters. */ +public class InvalidInputException extends LanceNamespaceException { + public InvalidInputException(String message) { + super(ErrorCode.INVALID_INPUT, message); + } + + public InvalidInputException(String message, Throwable cause) { + super(ErrorCode.INVALID_INPUT, message, cause); + } + + public InvalidInputException(String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.INVALID_INPUT, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InvalidTableStateException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InvalidTableStateException.java new file mode 100644 index 000000000..b9a9ac61a --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/InvalidTableStateException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the table is in an invalid state for the operation. */ +public class InvalidTableStateException extends LanceNamespaceException { + public InvalidTableStateException(String message) { + super(ErrorCode.INVALID_TABLE_STATE, message); + } + + public InvalidTableStateException(String message, Throwable cause) { + super(ErrorCode.INVALID_TABLE_STATE, message, cause); + } + + public InvalidTableStateException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.INVALID_TABLE_STATE, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/LanceNamespaceException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/LanceNamespaceException.java new file mode 100644 index 000000000..bad1a2458 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/LanceNamespaceException.java @@ -0,0 +1,140 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** + * Base exception for all Lance Namespace errors. + * + *

All Lance Namespace operations may throw exceptions that extend this class. Each exception has + * an associated {@link ErrorCode} that uniquely identifies the error type. + */ +public class LanceNamespaceException extends RuntimeException { + private final ErrorCode errorCode; + @Nullable private final String detail; + @Nullable private final String instance; + + /** + * Constructs a new LanceNamespaceException with the specified error code and message. + * + * @param errorCode the error code identifying the error type + * @param message the error message + */ + public LanceNamespaceException(ErrorCode errorCode, String message) { + this(errorCode, message, null, null, null); + } + + /** + * Constructs a new LanceNamespaceException with the specified error code, message, and cause. + * + * @param errorCode the error code identifying the error type + * @param message the error message + * @param cause the cause of this exception + */ + public LanceNamespaceException(ErrorCode errorCode, String message, Throwable cause) { + this(errorCode, message, null, null, cause); + } + + /** + * Constructs a new LanceNamespaceException with full details. + * + * @param errorCode the error code identifying the error type + * @param message the error message + * @param detail optional detailed explanation + * @param instance optional identifier for this specific error occurrence + */ + public LanceNamespaceException( + ErrorCode errorCode, String message, @Nullable String detail, @Nullable String instance) { + this(errorCode, message, detail, instance, null); + } + + /** + * Constructs a new LanceNamespaceException with full details and a cause. + * + * @param errorCode the error code identifying the error type + * @param message the error message + * @param detail optional detailed explanation + * @param instance optional identifier for this specific error occurrence + * @param cause the cause of this exception + */ + public LanceNamespaceException( + ErrorCode errorCode, + String message, + @Nullable String detail, + @Nullable String instance, + @Nullable Throwable cause) { + super(message, cause); + this.errorCode = errorCode; + this.detail = detail; + this.instance = instance; + } + + /** + * Returns the error code identifying the error type. + * + * @return the error code + */ + public ErrorCode getErrorCode() { + return errorCode; + } + + /** + * Returns the numeric error code. + * + * @return the numeric error code + */ + public int getCode() { + return errorCode.getCode(); + } + + /** + * Returns the optional detailed explanation of the error. + * + * @return the detail string, or null if not set + */ + @Nullable + public String getDetail() { + return detail; + } + + /** + * Returns the optional identifier for this specific error occurrence. + * + * @return the instance string, or null if not set + */ + @Nullable + public String getInstance() { + return instance; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()) + .append("{code=") + .append(errorCode.getCode()) + .append(", message='") + .append(getMessage()) + .append("'"); + if (detail != null) { + sb.append(", detail='").append(detail).append("'"); + } + if (instance != null) { + sb.append(", instance='").append(instance).append("'"); + } + sb.append("}"); + return sb.toString(); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceAlreadyExistsException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceAlreadyExistsException.java new file mode 100644 index 000000000..116d8642b --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceAlreadyExistsException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when a namespace with the specified name already exists. */ +public class NamespaceAlreadyExistsException extends LanceNamespaceException { + public NamespaceAlreadyExistsException(String message) { + super(ErrorCode.NAMESPACE_ALREADY_EXISTS, message); + } + + public NamespaceAlreadyExistsException(String message, Throwable cause) { + super(ErrorCode.NAMESPACE_ALREADY_EXISTS, message, cause); + } + + public NamespaceAlreadyExistsException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.NAMESPACE_ALREADY_EXISTS, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceNotEmptyException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceNotEmptyException.java new file mode 100644 index 000000000..166abeb4c --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceNotEmptyException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when trying to drop a namespace that contains tables or child namespaces. */ +public class NamespaceNotEmptyException extends LanceNamespaceException { + public NamespaceNotEmptyException(String message) { + super(ErrorCode.NAMESPACE_NOT_EMPTY, message); + } + + public NamespaceNotEmptyException(String message, Throwable cause) { + super(ErrorCode.NAMESPACE_NOT_EMPTY, message, cause); + } + + public NamespaceNotEmptyException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.NAMESPACE_NOT_EMPTY, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceNotFoundException.java new file mode 100644 index 000000000..d318dc3f3 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/NamespaceNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified namespace does not exist. */ +public class NamespaceNotFoundException extends LanceNamespaceException { + public NamespaceNotFoundException(String message) { + super(ErrorCode.NAMESPACE_NOT_FOUND, message); + } + + public NamespaceNotFoundException(String message, Throwable cause) { + super(ErrorCode.NAMESPACE_NOT_FOUND, message, cause); + } + + public NamespaceNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.NAMESPACE_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/PermissionDeniedException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/PermissionDeniedException.java new file mode 100644 index 000000000..d51cb3380 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/PermissionDeniedException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the user lacks permission for the operation. */ +public class PermissionDeniedException extends LanceNamespaceException { + public PermissionDeniedException(String message) { + super(ErrorCode.PERMISSION_DENIED, message); + } + + public PermissionDeniedException(String message, Throwable cause) { + super(ErrorCode.PERMISSION_DENIED, message, cause); + } + + public PermissionDeniedException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.PERMISSION_DENIED, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ServiceUnavailableException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ServiceUnavailableException.java new file mode 100644 index 000000000..31ecc9bc7 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ServiceUnavailableException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the service is temporarily unavailable. */ +public class ServiceUnavailableException extends LanceNamespaceException { + public ServiceUnavailableException(String message) { + super(ErrorCode.SERVICE_UNAVAILABLE, message); + } + + public ServiceUnavailableException(String message, Throwable cause) { + super(ErrorCode.SERVICE_UNAVAILABLE, message, cause); + } + + public ServiceUnavailableException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.SERVICE_UNAVAILABLE, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableAlreadyExistsException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableAlreadyExistsException.java new file mode 100644 index 000000000..66cc094ef --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableAlreadyExistsException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when a table with the specified name already exists. */ +public class TableAlreadyExistsException extends LanceNamespaceException { + public TableAlreadyExistsException(String message) { + super(ErrorCode.TABLE_ALREADY_EXISTS, message); + } + + public TableAlreadyExistsException(String message, Throwable cause) { + super(ErrorCode.TABLE_ALREADY_EXISTS, message, cause); + } + + public TableAlreadyExistsException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_ALREADY_EXISTS, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableColumnNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableColumnNotFoundException.java new file mode 100644 index 000000000..ac7585d51 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableColumnNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified table column does not exist. */ +public class TableColumnNotFoundException extends LanceNamespaceException { + public TableColumnNotFoundException(String message) { + super(ErrorCode.TABLE_COLUMN_NOT_FOUND, message); + } + + public TableColumnNotFoundException(String message, Throwable cause) { + super(ErrorCode.TABLE_COLUMN_NOT_FOUND, message, cause); + } + + public TableColumnNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_COLUMN_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableIndexAlreadyExistsException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableIndexAlreadyExistsException.java new file mode 100644 index 000000000..4a68eb1fc --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableIndexAlreadyExistsException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when a table index with the specified name already exists. */ +public class TableIndexAlreadyExistsException extends LanceNamespaceException { + public TableIndexAlreadyExistsException(String message) { + super(ErrorCode.TABLE_INDEX_ALREADY_EXISTS, message); + } + + public TableIndexAlreadyExistsException(String message, Throwable cause) { + super(ErrorCode.TABLE_INDEX_ALREADY_EXISTS, message, cause); + } + + public TableIndexAlreadyExistsException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_INDEX_ALREADY_EXISTS, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableIndexNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableIndexNotFoundException.java new file mode 100644 index 000000000..71fbad9b5 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableIndexNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified table index does not exist. */ +public class TableIndexNotFoundException extends LanceNamespaceException { + public TableIndexNotFoundException(String message) { + super(ErrorCode.TABLE_INDEX_NOT_FOUND, message); + } + + public TableIndexNotFoundException(String message, Throwable cause) { + super(ErrorCode.TABLE_INDEX_NOT_FOUND, message, cause); + } + + public TableIndexNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_INDEX_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableNotFoundException.java new file mode 100644 index 000000000..c720c19c3 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified table does not exist. */ +public class TableNotFoundException extends LanceNamespaceException { + public TableNotFoundException(String message) { + super(ErrorCode.TABLE_NOT_FOUND, message); + } + + public TableNotFoundException(String message, Throwable cause) { + super(ErrorCode.TABLE_NOT_FOUND, message, cause); + } + + public TableNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableSchemaValidationException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableSchemaValidationException.java new file mode 100644 index 000000000..b115e7d61 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableSchemaValidationException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when table schema validation fails. */ +public class TableSchemaValidationException extends LanceNamespaceException { + public TableSchemaValidationException(String message) { + super(ErrorCode.TABLE_SCHEMA_VALIDATION_ERROR, message); + } + + public TableSchemaValidationException(String message, Throwable cause) { + super(ErrorCode.TABLE_SCHEMA_VALIDATION_ERROR, message, cause); + } + + public TableSchemaValidationException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_SCHEMA_VALIDATION_ERROR, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableTagAlreadyExistsException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableTagAlreadyExistsException.java new file mode 100644 index 000000000..157da18f7 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableTagAlreadyExistsException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when a table tag with the specified name already exists. */ +public class TableTagAlreadyExistsException extends LanceNamespaceException { + public TableTagAlreadyExistsException(String message) { + super(ErrorCode.TABLE_TAG_ALREADY_EXISTS, message); + } + + public TableTagAlreadyExistsException(String message, Throwable cause) { + super(ErrorCode.TABLE_TAG_ALREADY_EXISTS, message, cause); + } + + public TableTagAlreadyExistsException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_TAG_ALREADY_EXISTS, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableTagNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableTagNotFoundException.java new file mode 100644 index 000000000..f18ca84b4 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableTagNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified table tag does not exist. */ +public class TableTagNotFoundException extends LanceNamespaceException { + public TableTagNotFoundException(String message) { + super(ErrorCode.TABLE_TAG_NOT_FOUND, message); + } + + public TableTagNotFoundException(String message, Throwable cause) { + super(ErrorCode.TABLE_TAG_NOT_FOUND, message, cause); + } + + public TableTagNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_TAG_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableVersionNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableVersionNotFoundException.java new file mode 100644 index 000000000..b9930c01f --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TableVersionNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified table version does not exist. */ +public class TableVersionNotFoundException extends LanceNamespaceException { + public TableVersionNotFoundException(String message) { + super(ErrorCode.TABLE_VERSION_NOT_FOUND, message); + } + + public TableVersionNotFoundException(String message, Throwable cause) { + super(ErrorCode.TABLE_VERSION_NOT_FOUND, message, cause); + } + + public TableVersionNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TABLE_VERSION_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ThrottlingException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ThrottlingException.java new file mode 100644 index 000000000..1e950f3aa --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/ThrottlingException.java @@ -0,0 +1,31 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the request rate limit is exceeded. */ +public class ThrottlingException extends LanceNamespaceException { + public ThrottlingException(String message) { + super(ErrorCode.THROTTLING, message); + } + + public ThrottlingException(String message, Throwable cause) { + super(ErrorCode.THROTTLING, message, cause); + } + + public ThrottlingException(String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.THROTTLING, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TransactionNotFoundException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TransactionNotFoundException.java new file mode 100644 index 000000000..c5fc535b5 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/TransactionNotFoundException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when the specified transaction does not exist. */ +public class TransactionNotFoundException extends LanceNamespaceException { + public TransactionNotFoundException(String message) { + super(ErrorCode.TRANSACTION_NOT_FOUND, message); + } + + public TransactionNotFoundException(String message, Throwable cause) { + super(ErrorCode.TRANSACTION_NOT_FOUND, message, cause); + } + + public TransactionNotFoundException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.TRANSACTION_NOT_FOUND, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/UnauthenticatedException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/UnauthenticatedException.java new file mode 100644 index 000000000..3a3efe3b0 --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/UnauthenticatedException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when authentication credentials are missing or invalid. */ +public class UnauthenticatedException extends LanceNamespaceException { + public UnauthenticatedException(String message) { + super(ErrorCode.UNAUTHENTICATED, message); + } + + public UnauthenticatedException(String message, Throwable cause) { + super(ErrorCode.UNAUTHENTICATED, message, cause); + } + + public UnauthenticatedException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.UNAUTHENTICATED, message, detail, instance); + } +} diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/UnsupportedOperationException.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/UnsupportedOperationException.java new file mode 100644 index 000000000..d04b18acb --- /dev/null +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/errors/UnsupportedOperationException.java @@ -0,0 +1,32 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.namespace.async.errors; + +import javax.annotation.Nullable; + +/** Thrown when an operation is not supported by the backend. */ +public class UnsupportedOperationException extends LanceNamespaceException { + public UnsupportedOperationException(String message) { + super(ErrorCode.UNSUPPORTED, message); + } + + public UnsupportedOperationException(String message, Throwable cause) { + super(ErrorCode.UNSUPPORTED, message, cause); + } + + public UnsupportedOperationException( + String message, @Nullable String detail, @Nullable String instance) { + super(ErrorCode.UNSUPPORTED, message, detail, instance); + } +} diff --git a/java/pom.xml b/java/pom.xml index 85b0c7d30..065020b50 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -88,8 +88,10 @@ lance-namespace-apache-client + lance-namespace-async-client lance-namespace-springboot-server lance-namespace-core + lance-namespace-core-async