diff --git a/.licenserc.yaml b/.licenserc.yaml index cd362bc94d..f0e258631a 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -24,5 +24,7 @@ header: - 'LICENSE' - 'NOTICE' - '**/*.json' + # Files generated by openapi-generator + - 'crates/iceberg-rest-catalog-client/.openapi-generator' comment: on-failure diff --git a/crates/iceberg-rest-catalog-client/.gitignore b/crates/iceberg-rest-catalog-client/.gitignore new file mode 100644 index 0000000000..b58d74cf7e --- /dev/null +++ b/crates/iceberg-rest-catalog-client/.gitignore @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +/target/ +**/*.rs.bk +Cargo.lock + +.travis.yml +git_push.sh +rest-catalog-open-api.yaml \ No newline at end of file diff --git a/crates/iceberg-rest-catalog-client/.openapi-generator-ignore b/crates/iceberg-rest-catalog-client/.openapi-generator-ignore new file mode 100644 index 0000000000..9cb7dcbce2 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/.openapi-generator-ignore @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +.gitignore +README.md +git_push.sh +.travis.yml +Cargo.toml +src/lib.rs \ No newline at end of file diff --git a/crates/iceberg-rest-catalog-client/.openapi-generator/FILES b/crates/iceberg-rest-catalog-client/.openapi-generator/FILES new file mode 100644 index 0000000000..15fc5cb22c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/.openapi-generator/FILES @@ -0,0 +1,175 @@ +Cargo.toml +docs/AddPartitionSpecUpdate.md +docs/AddPartitionSpecUpdateAllOf.md +docs/AddSchemaUpdate.md +docs/AddSchemaUpdateAllOf.md +docs/AddSnapshotUpdate.md +docs/AddSnapshotUpdateAllOf.md +docs/AddSortOrderUpdate.md +docs/AddSortOrderUpdateAllOf.md +docs/AndOrExpression.md +docs/BaseUpdate.md +docs/CatalogApiApi.md +docs/CatalogConfig.md +docs/CommitReport.md +docs/CommitTableRequest.md +docs/CommitTableResponse.md +docs/ConfigurationApiApi.md +docs/CounterResult.md +docs/CreateNamespaceRequest.md +docs/CreateNamespaceResponse.md +docs/CreateTableRequest.md +docs/ErrorModel.md +docs/Expression.md +docs/GetNamespaceResponse.md +docs/IcebergErrorResponse.md +docs/ListNamespacesResponse.md +docs/ListTablesResponse.md +docs/ListType.md +docs/LiteralExpression.md +docs/LoadTableResult.md +docs/MapType.md +docs/MetadataLogInner.md +docs/MetricResult.md +docs/NotExpression.md +docs/NullOrder.md +docs/OAuth2ApiApi.md +docs/OAuthError.md +docs/OAuthTokenResponse.md +docs/PartitionField.md +docs/PartitionSpec.md +docs/RemovePropertiesUpdate.md +docs/RemovePropertiesUpdateAllOf.md +docs/RemoveSnapshotRefUpdate.md +docs/RemoveSnapshotsUpdate.md +docs/RemoveSnapshotsUpdateAllOf.md +docs/RenameTableRequest.md +docs/ReportMetricsRequest.md +docs/ScanReport.md +docs/Schema.md +docs/SchemaAllOf.md +docs/SetCurrentSchemaUpdate.md +docs/SetCurrentSchemaUpdateAllOf.md +docs/SetDefaultSortOrderUpdate.md +docs/SetDefaultSortOrderUpdateAllOf.md +docs/SetDefaultSpecUpdate.md +docs/SetDefaultSpecUpdateAllOf.md +docs/SetExpression.md +docs/SetLocationUpdate.md +docs/SetLocationUpdateAllOf.md +docs/SetPropertiesUpdate.md +docs/SetPropertiesUpdateAllOf.md +docs/SetSnapshotRefUpdate.md +docs/SetSnapshotRefUpdateAllOf.md +docs/Snapshot.md +docs/SnapshotLogInner.md +docs/SnapshotReference.md +docs/SnapshotSummary.md +docs/SortDirection.md +docs/SortField.md +docs/SortOrder.md +docs/StructField.md +docs/StructType.md +docs/TableIdentifier.md +docs/TableMetadata.md +docs/TableRequirement.md +docs/TableUpdate.md +docs/Term.md +docs/TimerResult.md +docs/TokenType.md +docs/TransformTerm.md +docs/Type.md +docs/UnaryExpression.md +docs/UpdateNamespacePropertiesRequest.md +docs/UpdateNamespacePropertiesResponse.md +docs/UpgradeFormatVersionUpdate.md +docs/UpgradeFormatVersionUpdateAllOf.md +src/apis/catalog_api_api.rs +src/apis/configuration.rs +src/apis/configuration_api_api.rs +src/apis/mod.rs +src/apis/o_auth2_api_api.rs +src/lib.rs +src/models/add_partition_spec_update.rs +src/models/add_partition_spec_update_all_of.rs +src/models/add_schema_update.rs +src/models/add_schema_update_all_of.rs +src/models/add_snapshot_update.rs +src/models/add_snapshot_update_all_of.rs +src/models/add_sort_order_update.rs +src/models/add_sort_order_update_all_of.rs +src/models/and_or_expression.rs +src/models/base_update.rs +src/models/catalog_config.rs +src/models/commit_report.rs +src/models/commit_table_request.rs +src/models/commit_table_response.rs +src/models/counter_result.rs +src/models/create_namespace_request.rs +src/models/create_namespace_response.rs +src/models/create_table_request.rs +src/models/error_model.rs +src/models/expression.rs +src/models/get_namespace_response.rs +src/models/iceberg_error_response.rs +src/models/list_namespaces_response.rs +src/models/list_tables_response.rs +src/models/list_type.rs +src/models/literal_expression.rs +src/models/load_table_result.rs +src/models/map_type.rs +src/models/metadata_log_inner.rs +src/models/metric_result.rs +src/models/mod.rs +src/models/model_type.rs +src/models/not_expression.rs +src/models/null_order.rs +src/models/o_auth_error.rs +src/models/o_auth_token_response.rs +src/models/partition_field.rs +src/models/partition_spec.rs +src/models/remove_properties_update.rs +src/models/remove_properties_update_all_of.rs +src/models/remove_snapshot_ref_update.rs +src/models/remove_snapshots_update.rs +src/models/remove_snapshots_update_all_of.rs +src/models/rename_table_request.rs +src/models/report_metrics_request.rs +src/models/scan_report.rs +src/models/schema.rs +src/models/schema_all_of.rs +src/models/set_current_schema_update.rs +src/models/set_current_schema_update_all_of.rs +src/models/set_default_sort_order_update.rs +src/models/set_default_sort_order_update_all_of.rs +src/models/set_default_spec_update.rs +src/models/set_default_spec_update_all_of.rs +src/models/set_expression.rs +src/models/set_location_update.rs +src/models/set_location_update_all_of.rs +src/models/set_properties_update.rs +src/models/set_properties_update_all_of.rs +src/models/set_snapshot_ref_update.rs +src/models/set_snapshot_ref_update_all_of.rs +src/models/snapshot.rs +src/models/snapshot_log_inner.rs +src/models/snapshot_reference.rs +src/models/snapshot_summary.rs +src/models/sort_direction.rs +src/models/sort_field.rs +src/models/sort_order.rs +src/models/struct_field.rs +src/models/struct_type.rs +src/models/table_identifier.rs +src/models/table_metadata.rs +src/models/table_requirement.rs +src/models/table_update.rs +src/models/term.rs +src/models/timer_result.rs +src/models/token_type.rs +src/models/transform_term.rs +src/models/unary_expression.rs +src/models/update_namespace_properties_request.rs +src/models/update_namespace_properties_response.rs +src/models/upgrade_format_version_update.rs +src/models/upgrade_format_version_update_all_of.rs diff --git a/crates/iceberg-rest-catalog-client/.openapi-generator/VERSION b/crates/iceberg-rest-catalog-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/crates/iceberg-rest-catalog-client/Cargo.toml b/crates/iceberg-rest-catalog-client/Cargo.toml new file mode 100644 index 0000000000..012edfec48 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/Cargo.toml @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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] +name = "icberg-rest-catalog-client" +version = "0.0.1" +authors = ["OpenAPI Generator team and contributors"] +description = "Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2." +license = "Apache 2.0" +edition = "2021" + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_with = "^2.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde"] } +[dependencies.reqwest] +version = "^0.11" +features = ["json", "multipart"] diff --git a/crates/iceberg-rest-catalog-client/README.md b/crates/iceberg-rest-catalog-client/README.md new file mode 100644 index 0000000000..3bb25c8018 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/README.md @@ -0,0 +1,59 @@ + + +# Rust API client for openapi + +Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Contributing + +### Generate Code + +To regenerate the client, run the following command: + +```shell +export API_VERSION=1.3.1 + +curl "https://raw.githubusercontent.com/apache/iceberg/apache-iceberg-${API_VERSION}/open-api/rest-catalog-open-api.yaml" -o rest-catalog-open-api.yaml +openapi-generator generate \ + -g rust \ + -i rest-catalog-open-api.yaml \ + -o . +``` + +NOTES: + +- `API_VERSION` should be the latest released version of iceberg. +- `PACKAGE_VERSION` should be changed based on need. +- `openapi-generator` doesn't respect `HTTPS_PROXY`, users behind a proxy should use `curl` to download specs locally instead. + +### Post-Generation Actions + +After generation, please take following actions to make sure code is compilable: + +- Code format: `cargo fmt` +- Fix licenses: `license-eye header fix` diff --git a/crates/iceberg-rest-catalog-client/docs/AddPartitionSpecUpdate.md b/crates/iceberg-rest-catalog-client/docs/AddPartitionSpecUpdate.md new file mode 100644 index 0000000000..6942dc74e2 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddPartitionSpecUpdate.md @@ -0,0 +1,31 @@ + + +# AddPartitionSpecUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**spec** | [**crate::models::PartitionSpec**](PartitionSpec.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddPartitionSpecUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/AddPartitionSpecUpdateAllOf.md new file mode 100644 index 0000000000..18d82fc675 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddPartitionSpecUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# AddPartitionSpecUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spec** | [**crate::models::PartitionSpec**](PartitionSpec.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddSchemaUpdate.md b/crates/iceberg-rest-catalog-client/docs/AddSchemaUpdate.md new file mode 100644 index 0000000000..83afa377e8 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddSchemaUpdate.md @@ -0,0 +1,31 @@ + + +# AddSchemaUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**schema** | [**crate::models::Schema**](Schema.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddSchemaUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/AddSchemaUpdateAllOf.md new file mode 100644 index 0000000000..09e33cf24b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddSchemaUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# AddSchemaUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**schema** | [**crate::models::Schema**](Schema.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddSnapshotUpdate.md b/crates/iceberg-rest-catalog-client/docs/AddSnapshotUpdate.md new file mode 100644 index 0000000000..c8759e04ba --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddSnapshotUpdate.md @@ -0,0 +1,31 @@ + + +# AddSnapshotUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**snapshot** | [**crate::models::Snapshot**](Snapshot.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddSnapshotUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/AddSnapshotUpdateAllOf.md new file mode 100644 index 0000000000..4855e2f747 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddSnapshotUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# AddSnapshotUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**snapshot** | [**crate::models::Snapshot**](Snapshot.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddSortOrderUpdate.md b/crates/iceberg-rest-catalog-client/docs/AddSortOrderUpdate.md new file mode 100644 index 0000000000..5df40080ba --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddSortOrderUpdate.md @@ -0,0 +1,31 @@ + + +# AddSortOrderUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**sort_order** | [**crate::models::SortOrder**](SortOrder.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AddSortOrderUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/AddSortOrderUpdateAllOf.md new file mode 100644 index 0000000000..2100611a7d --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AddSortOrderUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# AddSortOrderUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sort_order** | [**crate::models::SortOrder**](SortOrder.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/AndOrExpression.md b/crates/iceberg-rest-catalog-client/docs/AndOrExpression.md new file mode 100644 index 0000000000..c13f8f1310 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/AndOrExpression.md @@ -0,0 +1,32 @@ + + +# AndOrExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**left** | [**crate::models::Expression**](Expression.md) | | +**right** | [**crate::models::Expression**](Expression.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/BaseUpdate.md b/crates/iceberg-rest-catalog-client/docs/BaseUpdate.md new file mode 100644 index 0000000000..0fe13a9e64 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/BaseUpdate.md @@ -0,0 +1,30 @@ + + +# BaseUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CatalogApiApi.md b/crates/iceberg-rest-catalog-client/docs/CatalogApiApi.md new file mode 100644 index 0000000000..ef704327ea --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CatalogApiApi.md @@ -0,0 +1,450 @@ + + +# \CatalogApiApi + +All URIs are relative to *https://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_namespace**](CatalogApiApi.md#create_namespace) | **POST** /v1/{prefix}/namespaces | Create a namespace +[**create_table**](CatalogApiApi.md#create_table) | **POST** /v1/{prefix}/namespaces/{namespace}/tables | Create a table in the given namespace +[**drop_namespace**](CatalogApiApi.md#drop_namespace) | **DELETE** /v1/{prefix}/namespaces/{namespace} | Drop a namespace from the catalog. Namespace must be empty. +[**drop_table**](CatalogApiApi.md#drop_table) | **DELETE** /v1/{prefix}/namespaces/{namespace}/tables/{table} | Drop a table from the catalog +[**list_namespaces**](CatalogApiApi.md#list_namespaces) | **GET** /v1/{prefix}/namespaces | List namespaces, optionally providing a parent namespace to list underneath +[**list_tables**](CatalogApiApi.md#list_tables) | **GET** /v1/{prefix}/namespaces/{namespace}/tables | List all table identifiers underneath a given namespace +[**load_namespace_metadata**](CatalogApiApi.md#load_namespace_metadata) | **GET** /v1/{prefix}/namespaces/{namespace} | Load the metadata properties for a namespace +[**load_table**](CatalogApiApi.md#load_table) | **GET** /v1/{prefix}/namespaces/{namespace}/tables/{table} | Load a table from the catalog +[**rename_table**](CatalogApiApi.md#rename_table) | **POST** /v1/{prefix}/tables/rename | Rename a table from its current name to a new name +[**report_metrics**](CatalogApiApi.md#report_metrics) | **POST** /v1/{prefix}/namespaces/{namespace}/tables/{table}/metrics | Send a metrics report to this endpoint to be processed by the backend +[**table_exists**](CatalogApiApi.md#table_exists) | **HEAD** /v1/{prefix}/namespaces/{namespace}/tables/{table} | Check if a table exists +[**update_properties**](CatalogApiApi.md#update_properties) | **POST** /v1/{prefix}/namespaces/{namespace}/properties | Set or remove properties on a namespace +[**update_table**](CatalogApiApi.md#update_table) | **POST** /v1/{prefix}/namespaces/{namespace}/tables/{table} | Commit updates to a table + + + +## create_namespace + +> crate::models::CreateNamespaceResponse create_namespace(prefix, create_namespace_request) +Create a namespace + +Create a namespace, with an optional set of properties. The server might also add properties, such as `last_modified_time` etc. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**create_namespace_request** | Option<[**CreateNamespaceRequest**](CreateNamespaceRequest.md)> | | | + +### Return type + +[**crate::models::CreateNamespaceResponse**](CreateNamespaceResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_table + +> crate::models::LoadTableResult create_table(prefix, namespace, create_table_request) +Create a table in the given namespace + +Create a table or start a create transaction, like atomic CTAS. If `stage-create` is false, the table is created immediately. If `stage-create` is true, the table is not created, but table metadata is initialized and returned. The service should prepare as needed for a commit to the table commit endpoint to complete the create transaction. The client uses the returned metadata to begin a transaction. To commit the transaction, the client sends all create and subsequent changes to the table commit route. Changes from the table create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial table state. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**create_table_request** | Option<[**CreateTableRequest**](CreateTableRequest.md)> | | | + +### Return type + +[**crate::models::LoadTableResult**](LoadTableResult.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## drop_namespace + +> drop_namespace(prefix, namespace) +Drop a namespace from the catalog. Namespace must be empty. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## drop_table + +> drop_table(prefix, namespace, table, purge_requested) +Drop a table from the catalog + +Remove a table from the catalog + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**table** | **String** | A table name | [required] | +**purge_requested** | Option<**bool**> | Whether the user requested to purge the underlying table's data and metadata | |[default to false] + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_namespaces + +> crate::models::ListNamespacesResponse list_namespaces(prefix, parent) +List namespaces, optionally providing a parent namespace to list underneath + +List all namespaces at a certain level, optionally starting from a given parent namespace. For example, if table accounting.tax.paid exists, using 'SELECT NAMESPACE IN accounting' would translate into `GET /namespaces?parent=accounting` and must return a namespace, [\"accounting\", \"tax\"]. If `parent` is not provided, all top-level namespaces should be listed. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**parent** | Option<**String**> | An optional namespace, underneath which to list namespaces. If not provided or empty, all top-level namespaces should be listed. If parent is a multipart namespace, the parts must be separated by the unit separator (`0x1F`) byte. | | + +### Return type + +[**crate::models::ListNamespacesResponse**](ListNamespacesResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_tables + +> crate::models::ListTablesResponse list_tables(prefix, namespace) +List all table identifiers underneath a given namespace + +Return all table identifiers under this namespace + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | + +### Return type + +[**crate::models::ListTablesResponse**](ListTablesResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## load_namespace_metadata + +> crate::models::GetNamespaceResponse load_namespace_metadata(prefix, namespace) +Load the metadata properties for a namespace + +Return all stored metadata properties for a given namespace + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | + +### Return type + +[**crate::models::GetNamespaceResponse**](GetNamespaceResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## load_table + +> crate::models::LoadTableResult load_table(prefix, namespace, table, snapshots) +Load a table from the catalog + +Load a table from the catalog. The response contains both configuration and table metadata. The configuration, if non-empty is used as additional configuration for the table that overrides catalog configuration. For example, this configuration may change the FileIO implementation to be used for the table. The response also contains the table's full metadata, matching the table metadata JSON file. The catalog configuration may contain credentials that should be used for subsequent requests for the table. The configuration key \"token\" is used to pass an access token to be used as a bearer token for table requests. Otherwise, a token may be passed using a RFC 8693 token type as a configuration key. For example, \"urn:ietf:params:oauth:token-type:jwt=\". + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**table** | **String** | A table name | [required] | +**snapshots** | Option<**String**> | The snapshots to return in the body of the metadata. Setting the value to `all` would return the full set of snapshots currently valid for the table. Setting the value to `refs` would load all snapshots referenced by branches or tags. Default if no param is provided is `all`. | | + +### Return type + +[**crate::models::LoadTableResult**](LoadTableResult.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## rename_table + +> rename_table(prefix, rename_table_request) +Rename a table from its current name to a new name + +Rename a table from one identifier to another. It's valid to move a table across namespaces, but the server implementation is not required to support it. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**rename_table_request** | [**RenameTableRequest**](RenameTableRequest.md) | Current table identifier to rename and new table identifier to rename to | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## report_metrics + +> report_metrics(prefix, namespace, table, report_metrics_request) +Send a metrics report to this endpoint to be processed by the backend + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**table** | **String** | A table name | [required] | +**report_metrics_request** | [**ReportMetricsRequest**](ReportMetricsRequest.md) | The request containing the metrics report to be sent | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## table_exists + +> table_exists(prefix, namespace, table) +Check if a table exists + +Check if a table exists within a given namespace. This request does not return a response body. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**table** | **String** | A table name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_properties + +> crate::models::UpdateNamespacePropertiesResponse update_properties(prefix, namespace, update_namespace_properties_request) +Set or remove properties on a namespace + +Set and/or remove properties on a namespace. The request body specifies a list of properties to remove and a map of key value pairs to update. Properties that are not in the request are not modified or removed by this call. Server implementations are not required to support namespace properties. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**update_namespace_properties_request** | Option<[**UpdateNamespacePropertiesRequest**](UpdateNamespacePropertiesRequest.md)> | | | + +### Return type + +[**crate::models::UpdateNamespacePropertiesResponse**](UpdateNamespacePropertiesResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_table + +> crate::models::CommitTableResponse update_table(prefix, namespace, table, commit_table_request) +Commit updates to a table + +Commit updates to a table. Commits have two parts, requirements and updates. Requirements are assertions that will be validated before attempting to make and commit changes. For example, `assert-ref-snapshot-id` will check that a named ref's snapshot ID has a certain value. Updates are changes to make to table metadata. For example, after asserting that the current main ref is at the expected snapshot, a commit may add a new child snapshot and set the ref to the new snapshot id. Create table transactions that are started by createTable with `stage-create` set to true are committed using this route. Transactions should include all changes to the table, including table initialization, like AddSchemaUpdate and SetCurrentSchemaUpdate. The `assert-create` requirement is used to ensure that the table was not created concurrently. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**prefix** | **String** | An optional prefix in the path | [required] | +**namespace** | **String** | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. | [required] | +**table** | **String** | A table name | [required] | +**commit_table_request** | Option<[**CommitTableRequest**](CommitTableRequest.md)> | | | + +### Return type + +[**crate::models::CommitTableResponse**](CommitTableResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/iceberg-rest-catalog-client/docs/CatalogConfig.md b/crates/iceberg-rest-catalog-client/docs/CatalogConfig.md new file mode 100644 index 0000000000..edf4455c6a --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CatalogConfig.md @@ -0,0 +1,31 @@ + + +# CatalogConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overrides** | **::std::collections::HashMap** | Properties that should be used to override client configuration; applied after defaults and client configuration. | +**defaults** | **::std::collections::HashMap** | Properties that should be used as default configuration; applied before client configuration. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CommitReport.md b/crates/iceberg-rest-catalog-client/docs/CommitReport.md new file mode 100644 index 0000000000..d8d4b1a21d --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CommitReport.md @@ -0,0 +1,35 @@ + + +# CommitReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**table_name** | **String** | | +**snapshot_id** | **i64** | | +**sequence_number** | **i64** | | +**operation** | **String** | | +**metrics** | [**::std::collections::HashMap**](MetricResult.md) | | +**metadata** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CommitTableRequest.md b/crates/iceberg-rest-catalog-client/docs/CommitTableRequest.md new file mode 100644 index 0000000000..f6c2f136ff --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CommitTableRequest.md @@ -0,0 +1,31 @@ + + +# CommitTableRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requirements** | [**Vec**](TableRequirement.md) | | +**updates** | [**Vec**](TableUpdate.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CommitTableResponse.md b/crates/iceberg-rest-catalog-client/docs/CommitTableResponse.md new file mode 100644 index 0000000000..7dd8b153ed --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CommitTableResponse.md @@ -0,0 +1,31 @@ + + +# CommitTableResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata_location** | **String** | | +**metadata** | [**crate::models::TableMetadata**](TableMetadata.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ConfigurationApiApi.md b/crates/iceberg-rest-catalog-client/docs/ConfigurationApiApi.md new file mode 100644 index 0000000000..1cfbd81258 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ConfigurationApiApi.md @@ -0,0 +1,58 @@ + + +# \ConfigurationApiApi + +All URIs are relative to *https://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_config**](ConfigurationApiApi.md#get_config) | **GET** /v1/config | List all catalog configuration settings + + + +## get_config + +> crate::models::CatalogConfig get_config(warehouse) +List all catalog configuration settings + + All REST clients should first call this route to get catalog configuration properties from the server to configure the catalog and its HTTP client. Configuration from the server consists of two sets of key/value pairs. - defaults - properties that should be used as default configuration; applied before client configuration - overrides - properties that should be used to override client configuration; applied after defaults and client configuration Catalog configuration is constructed by setting the defaults, then client- provided configuration, and finally overrides. The final property set is then used to configure the catalog. For example, a default configuration property might set the size of the client pool, which can be replaced with a client-specific setting. An override might be used to set the warehouse location, which is stored on the server rather than in client configuration. Common catalog configuration settings are documented at https://iceberg.apache.org/configuration/#catalog-properties + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**warehouse** | Option<**String**> | Warehouse location or identifier to request from the service | | + +### Return type + +[**crate::models::CatalogConfig**](CatalogConfig.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/iceberg-rest-catalog-client/docs/CounterResult.md b/crates/iceberg-rest-catalog-client/docs/CounterResult.md new file mode 100644 index 0000000000..d1fb3a87e5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CounterResult.md @@ -0,0 +1,31 @@ + + +# CounterResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unit** | **String** | | +**value** | **i64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CreateNamespaceRequest.md b/crates/iceberg-rest-catalog-client/docs/CreateNamespaceRequest.md new file mode 100644 index 0000000000..e37b300416 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CreateNamespaceRequest.md @@ -0,0 +1,31 @@ + + +# CreateNamespaceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **Vec** | Reference to one or more levels of a namespace | +**properties** | Option<**::std::collections::HashMap**> | Configured string to string map of properties for the namespace | [optional][default to {}] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CreateNamespaceResponse.md b/crates/iceberg-rest-catalog-client/docs/CreateNamespaceResponse.md new file mode 100644 index 0000000000..5c8ac9b6bc --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CreateNamespaceResponse.md @@ -0,0 +1,31 @@ + + +# CreateNamespaceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **Vec** | Reference to one or more levels of a namespace | +**properties** | Option<**::std::collections::HashMap**> | Properties stored on the namespace, if supported by the server. | [optional][default to {}] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/CreateTableRequest.md b/crates/iceberg-rest-catalog-client/docs/CreateTableRequest.md new file mode 100644 index 0000000000..74f63f4787 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/CreateTableRequest.md @@ -0,0 +1,36 @@ + + +# CreateTableRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**location** | Option<**String**> | | [optional] +**schema** | [**crate::models::Schema**](Schema.md) | | +**partition_spec** | Option<[**crate::models::PartitionSpec**](PartitionSpec.md)> | | [optional] +**write_order** | Option<[**crate::models::SortOrder**](SortOrder.md)> | | [optional] +**stage_create** | Option<**bool**> | | [optional] +**properties** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ErrorModel.md b/crates/iceberg-rest-catalog-client/docs/ErrorModel.md new file mode 100644 index 0000000000..d8503a51c9 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ErrorModel.md @@ -0,0 +1,33 @@ + + +# ErrorModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | Human-readable error message | +**r#type** | **String** | Internal type definition of the error | +**code** | **i32** | HTTP response code | +**stack** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/Expression.md b/crates/iceberg-rest-catalog-client/docs/Expression.md new file mode 100644 index 0000000000..9de1254df1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/Expression.md @@ -0,0 +1,36 @@ + + +# Expression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**left** | [**crate::models::Expression**](Expression.md) | | +**right** | [**crate::models::Expression**](Expression.md) | | +**child** | [**crate::models::Expression**](Expression.md) | | +**term** | [**crate::models::Term**](Term.md) | | +**values** | [**Vec**](serde_json::Value.md) | | +**value** | [**serde_json::Value**](.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/GetNamespaceResponse.md b/crates/iceberg-rest-catalog-client/docs/GetNamespaceResponse.md new file mode 100644 index 0000000000..6563a31b11 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/GetNamespaceResponse.md @@ -0,0 +1,31 @@ + + +# GetNamespaceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **Vec** | Reference to one or more levels of a namespace | +**properties** | Option<**::std::collections::HashMap**> | 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][default to {}] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/IcebergErrorResponse.md b/crates/iceberg-rest-catalog-client/docs/IcebergErrorResponse.md new file mode 100644 index 0000000000..548f12d61a --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/IcebergErrorResponse.md @@ -0,0 +1,30 @@ + + +# IcebergErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<[**crate::models::ErrorModel**](ErrorModel.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ListNamespacesResponse.md b/crates/iceberg-rest-catalog-client/docs/ListNamespacesResponse.md new file mode 100644 index 0000000000..24d86a7c15 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ListNamespacesResponse.md @@ -0,0 +1,30 @@ + + +# ListNamespacesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespaces** | Option<[**Vec>**](array.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ListTablesResponse.md b/crates/iceberg-rest-catalog-client/docs/ListTablesResponse.md new file mode 100644 index 0000000000..9f0ffc6949 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ListTablesResponse.md @@ -0,0 +1,30 @@ + + +# ListTablesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifiers** | Option<[**Vec**](TableIdentifier.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ListType.md b/crates/iceberg-rest-catalog-client/docs/ListType.md new file mode 100644 index 0000000000..ef87ff7a4f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ListType.md @@ -0,0 +1,33 @@ + + +# ListType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**element_id** | **i32** | | +**element** | [**crate::models::Type**](Type.md) | | +**element_required** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/LiteralExpression.md b/crates/iceberg-rest-catalog-client/docs/LiteralExpression.md new file mode 100644 index 0000000000..824ac9459e --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/LiteralExpression.md @@ -0,0 +1,32 @@ + + +# LiteralExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**term** | [**crate::models::Term**](Term.md) | | +**value** | [**serde_json::Value**](.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/LoadTableResult.md b/crates/iceberg-rest-catalog-client/docs/LoadTableResult.md new file mode 100644 index 0000000000..6bf7b05c4f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/LoadTableResult.md @@ -0,0 +1,32 @@ + + +# LoadTableResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata_location** | Option<**String**> | May be null if the table is staged as part of a transaction | [optional] +**metadata** | [**crate::models::TableMetadata**](TableMetadata.md) | | +**config** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/MapType.md b/crates/iceberg-rest-catalog-client/docs/MapType.md new file mode 100644 index 0000000000..2fda944b74 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/MapType.md @@ -0,0 +1,35 @@ + + +# MapType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**key_id** | **i32** | | +**key** | [**crate::models::Type**](Type.md) | | +**value_id** | **i32** | | +**value** | [**crate::models::Type**](Type.md) | | +**value_required** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/MetadataLogInner.md b/crates/iceberg-rest-catalog-client/docs/MetadataLogInner.md new file mode 100644 index 0000000000..4610821715 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/MetadataLogInner.md @@ -0,0 +1,31 @@ + + +# MetadataLogInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata_file** | **String** | | +**timestamp_ms** | **i64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/MetricResult.md b/crates/iceberg-rest-catalog-client/docs/MetricResult.md new file mode 100644 index 0000000000..5842f0a964 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/MetricResult.md @@ -0,0 +1,34 @@ + + +# MetricResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unit** | **String** | | +**value** | **i64** | | +**time_unit** | **String** | | +**count** | **i64** | | +**total_duration** | **i64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/NotExpression.md b/crates/iceberg-rest-catalog-client/docs/NotExpression.md new file mode 100644 index 0000000000..79d0a8ea5a --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/NotExpression.md @@ -0,0 +1,31 @@ + + +# NotExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**child** | [**crate::models::Expression**](Expression.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/NullOrder.md b/crates/iceberg-rest-catalog-client/docs/NullOrder.md new file mode 100644 index 0000000000..1f47cb528d --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/NullOrder.md @@ -0,0 +1,29 @@ + + +# NullOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/OAuth2ApiApi.md b/crates/iceberg-rest-catalog-client/docs/OAuth2ApiApi.md new file mode 100644 index 0000000000..4a9d0288ba --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/OAuth2ApiApi.md @@ -0,0 +1,66 @@ + + +# \OAuth2ApiApi + +All URIs are relative to *https://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_token**](OAuth2ApiApi.md#get_token) | **POST** /v1/oauth/tokens | Get a token using an OAuth2 flow + + + +## get_token + +> crate::models::OAuthTokenResponse get_token(grant_type, client_id, client_secret, subject_token, subject_token_type, scope, requested_token_type, actor_token, actor_token_type) +Get a token using an OAuth2 flow + +Exchange credentials for a token using the OAuth2 client credentials flow or token exchange. This endpoint is used for three purposes - 1. To exchange client credentials (client ID and secret) for an access token This uses the client credentials flow. 2. To exchange a client token and an identity token for a more specific access token This uses the token exchange flow. 3. To exchange an access token for one with the same claims and a refreshed expiration period This uses the token exchange flow. For example, a catalog client may be configured with client credentials from the OAuth2 Authorization flow. This client would exchange its client ID and secret for an access token using the client credentials request with this endpoint (1). Subsequent requests would then use that access token. Some clients may also handle sessions that have additional user context. These clients would use the token exchange flow to exchange a user token (the \"subject\" token) from the session for a more specific access token for that user, using the catalog's access token as the \"actor\" token (2). The user ID token is the \"subject\" token and can be any token type allowed by the OAuth2 token exchange flow, including a unsecured JWT token with a sub claim. This request should use the catalog's bearer token in the \"Authorization\" header. Clients may also use the token exchange flow to refresh a token that is about to expire by sending a token exchange request (3). The request's \"subject\" token should be the expiring token. This request should use the subject token in the \"Authorization\" header. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**grant_type** | **String** | | [required] | +**client_id** | **String** | Client ID This can be sent in the request body, but OAuth2 recommends sending it in a Basic Authorization header. | [required] | +**client_secret** | **String** | Client secret This can be sent in the request body, but OAuth2 recommends sending it in a Basic Authorization header. | [required] | +**subject_token** | **String** | Subject token for token exchange request | [required] | +**subject_token_type** | [**crate::models::TokenType**](TokenType.md) | | [required] | +**scope** | Option<**String**> | | | +**requested_token_type** | Option<[**crate::models::TokenType**](TokenType.md)> | | | +**actor_token** | Option<**String**> | Actor token for token exchange request | | +**actor_token_type** | Option<[**crate::models::TokenType**](TokenType.md)> | | | + +### Return type + +[**crate::models::OAuthTokenResponse**](OAuthTokenResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/iceberg-rest-catalog-client/docs/OAuthError.md b/crates/iceberg-rest-catalog-client/docs/OAuthError.md new file mode 100644 index 0000000000..8b741eeca0 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/OAuthError.md @@ -0,0 +1,32 @@ + + +# OAuthError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **String** | | +**error_description** | Option<**String**> | | [optional] +**error_uri** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/OAuthTokenResponse.md b/crates/iceberg-rest-catalog-client/docs/OAuthTokenResponse.md new file mode 100644 index 0000000000..a484fbe781 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/OAuthTokenResponse.md @@ -0,0 +1,35 @@ + + +# OAuthTokenResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token** | **String** | The access token, for client credentials or token exchange | +**token_type** | **String** | Access token type for client credentials or token exchange See https://datatracker.ietf.org/doc/html/rfc6749#section-7.1 | +**expires_in** | Option<**i32**> | Lifetime of the access token in seconds for client credentials or token exchange | [optional] +**issued_token_type** | Option<[**crate::models::TokenType**](TokenType.md)> | | [optional] +**refresh_token** | Option<**String**> | Refresh token for client credentials or token exchange | [optional] +**scope** | Option<**String**> | Authorization scope for client credentials or token exchange | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/PartitionField.md b/crates/iceberg-rest-catalog-client/docs/PartitionField.md new file mode 100644 index 0000000000..ced7a54bba --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/PartitionField.md @@ -0,0 +1,33 @@ + + +# PartitionField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_id** | Option<**i32**> | | [optional] +**source_id** | **i32** | | +**name** | **String** | | +**transform** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/PartitionSpec.md b/crates/iceberg-rest-catalog-client/docs/PartitionSpec.md new file mode 100644 index 0000000000..2e75743136 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/PartitionSpec.md @@ -0,0 +1,31 @@ + + +# PartitionSpec + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spec_id** | Option<**i32**> | | [optional][readonly] +**fields** | [**Vec**](PartitionField.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/RemovePropertiesUpdate.md b/crates/iceberg-rest-catalog-client/docs/RemovePropertiesUpdate.md new file mode 100644 index 0000000000..806b16ad4d --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/RemovePropertiesUpdate.md @@ -0,0 +1,31 @@ + + +# RemovePropertiesUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**removals** | **Vec** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/RemovePropertiesUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/RemovePropertiesUpdateAllOf.md new file mode 100644 index 0000000000..94b86cc5ef --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/RemovePropertiesUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# RemovePropertiesUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**removals** | **Vec** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotRefUpdate.md b/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotRefUpdate.md new file mode 100644 index 0000000000..cf5cb5b743 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotRefUpdate.md @@ -0,0 +1,31 @@ + + +# RemoveSnapshotRefUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**ref_name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotsUpdate.md b/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotsUpdate.md new file mode 100644 index 0000000000..4334c3e7cc --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotsUpdate.md @@ -0,0 +1,31 @@ + + +# RemoveSnapshotsUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**snapshot_ids** | **Vec** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotsUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotsUpdateAllOf.md new file mode 100644 index 0000000000..7a9da70768 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/RemoveSnapshotsUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# RemoveSnapshotsUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**snapshot_ids** | **Vec** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/RenameTableRequest.md b/crates/iceberg-rest-catalog-client/docs/RenameTableRequest.md new file mode 100644 index 0000000000..59097af859 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/RenameTableRequest.md @@ -0,0 +1,31 @@ + + +# RenameTableRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | [**crate::models::TableIdentifier**](TableIdentifier.md) | | +**destination** | [**crate::models::TableIdentifier**](TableIdentifier.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ReportMetricsRequest.md b/crates/iceberg-rest-catalog-client/docs/ReportMetricsRequest.md new file mode 100644 index 0000000000..a02e2170f4 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ReportMetricsRequest.md @@ -0,0 +1,40 @@ + + +# ReportMetricsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report_type** | **String** | | +**table_name** | **String** | | +**snapshot_id** | **i64** | | +**filter** | [**crate::models::Expression**](Expression.md) | | +**schema_id** | **i32** | | +**projected_field_ids** | **Vec** | | +**projected_field_names** | **Vec** | | +**metrics** | [**::std::collections::HashMap**](MetricResult.md) | | +**metadata** | Option<**::std::collections::HashMap**> | | [optional] +**sequence_number** | **i64** | | +**operation** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/ScanReport.md b/crates/iceberg-rest-catalog-client/docs/ScanReport.md new file mode 100644 index 0000000000..66dc08a94c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/ScanReport.md @@ -0,0 +1,37 @@ + + +# ScanReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**table_name** | **String** | | +**snapshot_id** | **i64** | | +**filter** | [**crate::models::Expression**](Expression.md) | | +**schema_id** | **i32** | | +**projected_field_ids** | **Vec** | | +**projected_field_names** | **Vec** | | +**metrics** | [**::std::collections::HashMap**](MetricResult.md) | | +**metadata** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/Schema.md b/crates/iceberg-rest-catalog-client/docs/Schema.md new file mode 100644 index 0000000000..e4540743a9 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/Schema.md @@ -0,0 +1,33 @@ + + +# Schema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**fields** | [**Vec**](StructField.md) | | +**schema_id** | Option<**i32**> | | [optional][readonly] +**identifier_field_ids** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SchemaAllOf.md b/crates/iceberg-rest-catalog-client/docs/SchemaAllOf.md new file mode 100644 index 0000000000..ff04808f6f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SchemaAllOf.md @@ -0,0 +1,31 @@ + + +# SchemaAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**schema_id** | Option<**i32**> | | [optional][readonly] +**identifier_field_ids** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetCurrentSchemaUpdate.md b/crates/iceberg-rest-catalog-client/docs/SetCurrentSchemaUpdate.md new file mode 100644 index 0000000000..6b6bc27a21 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetCurrentSchemaUpdate.md @@ -0,0 +1,31 @@ + + +# SetCurrentSchemaUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**schema_id** | **i32** | Schema ID to set as current, or -1 to set last added schema | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetCurrentSchemaUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/SetCurrentSchemaUpdateAllOf.md new file mode 100644 index 0000000000..7982c5d713 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetCurrentSchemaUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# SetCurrentSchemaUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**schema_id** | **i32** | Schema ID to set as current, or -1 to set last added schema | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetDefaultSortOrderUpdate.md b/crates/iceberg-rest-catalog-client/docs/SetDefaultSortOrderUpdate.md new file mode 100644 index 0000000000..1665a5dc9b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetDefaultSortOrderUpdate.md @@ -0,0 +1,31 @@ + + +# SetDefaultSortOrderUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**sort_order_id** | **i32** | Sort order ID to set as the default, or -1 to set last added sort order | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetDefaultSortOrderUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/SetDefaultSortOrderUpdateAllOf.md new file mode 100644 index 0000000000..bb2800f723 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetDefaultSortOrderUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# SetDefaultSortOrderUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sort_order_id** | **i32** | Sort order ID to set as the default, or -1 to set last added sort order | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetDefaultSpecUpdate.md b/crates/iceberg-rest-catalog-client/docs/SetDefaultSpecUpdate.md new file mode 100644 index 0000000000..834ed62dde --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetDefaultSpecUpdate.md @@ -0,0 +1,31 @@ + + +# SetDefaultSpecUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**spec_id** | **i32** | Partition spec ID to set as the default, or -1 to set last added spec | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetDefaultSpecUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/SetDefaultSpecUpdateAllOf.md new file mode 100644 index 0000000000..ef8fd62bed --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetDefaultSpecUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# SetDefaultSpecUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spec_id** | **i32** | Partition spec ID to set as the default, or -1 to set last added spec | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetExpression.md b/crates/iceberg-rest-catalog-client/docs/SetExpression.md new file mode 100644 index 0000000000..09c704633b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetExpression.md @@ -0,0 +1,32 @@ + + +# SetExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**term** | [**crate::models::Term**](Term.md) | | +**values** | [**Vec**](serde_json::Value.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetLocationUpdate.md b/crates/iceberg-rest-catalog-client/docs/SetLocationUpdate.md new file mode 100644 index 0000000000..4da1482927 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetLocationUpdate.md @@ -0,0 +1,31 @@ + + +# SetLocationUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**location** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetLocationUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/SetLocationUpdateAllOf.md new file mode 100644 index 0000000000..b55fd01841 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetLocationUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# SetLocationUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetPropertiesUpdate.md b/crates/iceberg-rest-catalog-client/docs/SetPropertiesUpdate.md new file mode 100644 index 0000000000..8b0a1ba700 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetPropertiesUpdate.md @@ -0,0 +1,31 @@ + + +# SetPropertiesUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**updates** | **::std::collections::HashMap** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetPropertiesUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/SetPropertiesUpdateAllOf.md new file mode 100644 index 0000000000..a7f84a3cae --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetPropertiesUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# SetPropertiesUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updates** | **::std::collections::HashMap** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetSnapshotRefUpdate.md b/crates/iceberg-rest-catalog-client/docs/SetSnapshotRefUpdate.md new file mode 100644 index 0000000000..d2c4f825a7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetSnapshotRefUpdate.md @@ -0,0 +1,36 @@ + + +# SetSnapshotRefUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**r#type** | **String** | | +**snapshot_id** | **i64** | | +**max_ref_age_ms** | Option<**i64**> | | [optional] +**max_snapshot_age_ms** | Option<**i64**> | | [optional] +**min_snapshots_to_keep** | Option<**i32**> | | [optional] +**ref_name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SetSnapshotRefUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/SetSnapshotRefUpdateAllOf.md new file mode 100644 index 0000000000..181c90d539 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SetSnapshotRefUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# SetSnapshotRefUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ref_name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/Snapshot.md b/crates/iceberg-rest-catalog-client/docs/Snapshot.md new file mode 100644 index 0000000000..05f7fa08d3 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/Snapshot.md @@ -0,0 +1,36 @@ + + +# Snapshot + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**snapshot_id** | **i64** | | +**parent_snapshot_id** | Option<**i64**> | | [optional] +**sequence_number** | Option<**i64**> | | [optional] +**timestamp_ms** | **i64** | | +**manifest_list** | **String** | Location of the snapshot's manifest list file | +**summary** | [**crate::models::SnapshotSummary**](Snapshot_summary.md) | | +**schema_id** | Option<**i32**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SnapshotLogInner.md b/crates/iceberg-rest-catalog-client/docs/SnapshotLogInner.md new file mode 100644 index 0000000000..20cbe229d5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SnapshotLogInner.md @@ -0,0 +1,31 @@ + + +# SnapshotLogInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**snapshot_id** | **i64** | | +**timestamp_ms** | **i64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SnapshotReference.md b/crates/iceberg-rest-catalog-client/docs/SnapshotReference.md new file mode 100644 index 0000000000..56163b6d62 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SnapshotReference.md @@ -0,0 +1,34 @@ + + +# SnapshotReference + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**snapshot_id** | **i64** | | +**max_ref_age_ms** | Option<**i64**> | | [optional] +**max_snapshot_age_ms** | Option<**i64**> | | [optional] +**min_snapshots_to_keep** | Option<**i32**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SnapshotSummary.md b/crates/iceberg-rest-catalog-client/docs/SnapshotSummary.md new file mode 100644 index 0000000000..2f8371b830 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SnapshotSummary.md @@ -0,0 +1,31 @@ + + +# SnapshotSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**operation** | **String** | | +**additional_properties** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SortDirection.md b/crates/iceberg-rest-catalog-client/docs/SortDirection.md new file mode 100644 index 0000000000..acd562c8d1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SortDirection.md @@ -0,0 +1,29 @@ + + +# SortDirection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SortField.md b/crates/iceberg-rest-catalog-client/docs/SortField.md new file mode 100644 index 0000000000..4ad62b31d4 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SortField.md @@ -0,0 +1,33 @@ + + +# SortField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_id** | **i32** | | +**transform** | **String** | | +**direction** | [**crate::models::SortDirection**](SortDirection.md) | | +**null_order** | [**crate::models::NullOrder**](NullOrder.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/SortOrder.md b/crates/iceberg-rest-catalog-client/docs/SortOrder.md new file mode 100644 index 0000000000..bd98632adf --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/SortOrder.md @@ -0,0 +1,31 @@ + + +# SortOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **i32** | | [readonly] +**fields** | [**Vec**](SortField.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/StructField.md b/crates/iceberg-rest-catalog-client/docs/StructField.md new file mode 100644 index 0000000000..cc89fd0c78 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/StructField.md @@ -0,0 +1,34 @@ + + +# StructField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **i32** | | +**name** | **String** | | +**r#type** | [**crate::models::Type**](Type.md) | | +**required** | **bool** | | +**doc** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/StructType.md b/crates/iceberg-rest-catalog-client/docs/StructType.md new file mode 100644 index 0000000000..5285fc6e3b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/StructType.md @@ -0,0 +1,31 @@ + + +# StructType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**fields** | [**Vec**](StructField.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TableIdentifier.md b/crates/iceberg-rest-catalog-client/docs/TableIdentifier.md new file mode 100644 index 0000000000..70fe958ddb --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TableIdentifier.md @@ -0,0 +1,31 @@ + + +# TableIdentifier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **Vec** | Reference to one or more levels of a namespace | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TableMetadata.md b/crates/iceberg-rest-catalog-client/docs/TableMetadata.md new file mode 100644 index 0000000000..ef7f198bb5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TableMetadata.md @@ -0,0 +1,47 @@ + + +# TableMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**format_version** | **i32** | | +**table_uuid** | **String** | | +**location** | Option<**String**> | | [optional] +**last_updated_ms** | Option<**i64**> | | [optional] +**properties** | Option<**::std::collections::HashMap**> | | [optional] +**schemas** | Option<[**Vec**](Schema.md)> | | [optional] +**current_schema_id** | Option<**i32**> | | [optional] +**last_column_id** | Option<**i32**> | | [optional] +**partition_specs** | Option<[**Vec**](PartitionSpec.md)> | | [optional] +**default_spec_id** | Option<**i32**> | | [optional] +**last_partition_id** | Option<**i32**> | | [optional] +**sort_orders** | Option<[**Vec**](SortOrder.md)> | | [optional] +**default_sort_order_id** | Option<**i32**> | | [optional] +**snapshots** | Option<[**Vec**](Snapshot.md)> | | [optional] +**refs** | Option<[**::std::collections::HashMap**](SnapshotReference.md)> | | [optional] +**current_snapshot_id** | Option<**i64**> | | [optional] +**snapshot_log** | Option<[**Vec**](SnapshotLog_inner.md)> | | [optional] +**metadata_log** | Option<[**Vec**](MetadataLog_inner.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TableRequirement.md b/crates/iceberg-rest-catalog-client/docs/TableRequirement.md new file mode 100644 index 0000000000..130723070b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TableRequirement.md @@ -0,0 +1,38 @@ + + +# TableRequirement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requirement** | **String** | | +**r#ref** | Option<**String**> | | [optional] +**uuid** | Option<**String**> | | [optional] +**snapshot_id** | Option<**i64**> | | [optional] +**last_assigned_field_id** | Option<**i32**> | | [optional] +**current_schema_id** | Option<**i32**> | | [optional] +**last_assigned_partition_id** | Option<**i32**> | | [optional] +**default_spec_id** | Option<**i32**> | | [optional] +**default_sort_order_id** | Option<**i32**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TableUpdate.md b/crates/iceberg-rest-catalog-client/docs/TableUpdate.md new file mode 100644 index 0000000000..08b79fef4e --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TableUpdate.md @@ -0,0 +1,48 @@ + + +# TableUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**format_version** | **i32** | | +**schema** | [**crate::models::Schema**](Schema.md) | | +**schema_id** | **i32** | Schema ID to set as current, or -1 to set last added schema | +**spec** | [**crate::models::PartitionSpec**](PartitionSpec.md) | | +**spec_id** | **i32** | Partition spec ID to set as the default, or -1 to set last added spec | +**sort_order** | [**crate::models::SortOrder**](SortOrder.md) | | +**sort_order_id** | **i32** | Sort order ID to set as the default, or -1 to set last added sort order | +**snapshot** | [**crate::models::Snapshot**](Snapshot.md) | | +**r#type** | **String** | | +**snapshot_id** | **i64** | | +**max_ref_age_ms** | Option<**i64**> | | [optional] +**max_snapshot_age_ms** | Option<**i64**> | | [optional] +**min_snapshots_to_keep** | Option<**i32**> | | [optional] +**ref_name** | **String** | | +**snapshot_ids** | **Vec** | | +**location** | **String** | | +**updates** | **::std::collections::HashMap** | | +**removals** | **Vec** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/Term.md b/crates/iceberg-rest-catalog-client/docs/Term.md new file mode 100644 index 0000000000..f5de33714f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/Term.md @@ -0,0 +1,32 @@ + + +# Term + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**transform** | **String** | | +**term** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TimerResult.md b/crates/iceberg-rest-catalog-client/docs/TimerResult.md new file mode 100644 index 0000000000..5162197367 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TimerResult.md @@ -0,0 +1,32 @@ + + +# TimerResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time_unit** | **String** | | +**count** | **i64** | | +**total_duration** | **i64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TokenType.md b/crates/iceberg-rest-catalog-client/docs/TokenType.md new file mode 100644 index 0000000000..efa910d41b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TokenType.md @@ -0,0 +1,29 @@ + + +# TokenType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/TransformTerm.md b/crates/iceberg-rest-catalog-client/docs/TransformTerm.md new file mode 100644 index 0000000000..035a1f91d5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/TransformTerm.md @@ -0,0 +1,32 @@ + + +# TransformTerm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**transform** | **String** | | +**term** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/Type.md b/crates/iceberg-rest-catalog-client/docs/Type.md new file mode 100644 index 0000000000..61cd16b95f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/Type.md @@ -0,0 +1,39 @@ + + +# Type + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**fields** | [**Vec**](StructField.md) | | +**element_id** | **i32** | | +**element** | [**crate::models::Type**](Type.md) | | +**element_required** | **bool** | | +**key_id** | **i32** | | +**key** | [**crate::models::Type**](Type.md) | | +**value_id** | **i32** | | +**value** | [**crate::models::Type**](Type.md) | | +**value_required** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/UnaryExpression.md b/crates/iceberg-rest-catalog-client/docs/UnaryExpression.md new file mode 100644 index 0000000000..2fd67cfb17 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/UnaryExpression.md @@ -0,0 +1,32 @@ + + +# UnaryExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**term** | [**crate::models::Term**](Term.md) | | +**value** | [**serde_json::Value**](.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/UpdateNamespacePropertiesRequest.md b/crates/iceberg-rest-catalog-client/docs/UpdateNamespacePropertiesRequest.md new file mode 100644 index 0000000000..e53dcdca7c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/UpdateNamespacePropertiesRequest.md @@ -0,0 +1,31 @@ + + +# UpdateNamespacePropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**removals** | Option<**Vec**> | | [optional] +**updates** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/UpdateNamespacePropertiesResponse.md b/crates/iceberg-rest-catalog-client/docs/UpdateNamespacePropertiesResponse.md new file mode 100644 index 0000000000..c9a53fd658 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/UpdateNamespacePropertiesResponse.md @@ -0,0 +1,32 @@ + + +# UpdateNamespacePropertiesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updated** | **Vec** | List of property keys that were added or updated | +**removed** | **Vec** | List of properties that were removed | +**missing** | Option<**Vec**> | List of properties requested for removal that were not found in the namespace's properties. Represents a partial success response. Server's do not need to implement this. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/UpgradeFormatVersionUpdate.md b/crates/iceberg-rest-catalog-client/docs/UpgradeFormatVersionUpdate.md new file mode 100644 index 0000000000..abef37e085 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/UpgradeFormatVersionUpdate.md @@ -0,0 +1,31 @@ + + +# UpgradeFormatVersionUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**format_version** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/docs/UpgradeFormatVersionUpdateAllOf.md b/crates/iceberg-rest-catalog-client/docs/UpgradeFormatVersionUpdateAllOf.md new file mode 100644 index 0000000000..4644205a86 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/docs/UpgradeFormatVersionUpdateAllOf.md @@ -0,0 +1,30 @@ + + +# UpgradeFormatVersionUpdateAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**format_version** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/iceberg-rest-catalog-client/src/apis/catalog_api_api.rs b/crates/iceberg-rest-catalog-client/src/apis/catalog_api_api.rs new file mode 100644 index 0000000000..c0b902af02 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/apis/catalog_api_api.rs @@ -0,0 +1,901 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use reqwest; + +use super::{configuration, Error}; +use crate::apis::ResponseContent; + +/// struct for typed errors of method [`create_namespace`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateNamespaceError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status406(crate::models::ErrorModel), + Status409(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_table`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateTableError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status409(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`drop_namespace`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DropNamespaceError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`drop_table`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DropTableError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_namespaces`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListNamespacesError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_tables`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTablesError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`load_namespace_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LoadNamespaceMetadataError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`load_table`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LoadTableError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rename_table`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RenameTableError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status406(crate::models::ErrorModel), + Status409(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`report_metrics`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ReportMetricsError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`table_exists`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TableExistsError { + Status400(), + Status401(), + Status404(), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_properties`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdatePropertiesError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status406(crate::models::ErrorModel), + Status422(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_table`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTableError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status404(crate::models::ErrorModel), + Status409(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status500(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status502(crate::models::ErrorModel), + Status504(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// Create a namespace, with an optional set of properties. The server might also add properties, such as `last_modified_time` etc. +pub async fn create_namespace( + configuration: &configuration::Configuration, + prefix: &str, + create_namespace_request: Option, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_namespace_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Create a table or start a create transaction, like atomic CTAS. If `stage-create` is false, the table is created immediately. If `stage-create` is true, the table is not created, but table metadata is initialized and returned. The service should prepare as needed for a commit to the table commit endpoint to complete the create transaction. The client uses the returned metadata to begin a transaction. To commit the transaction, the client sends all create and subsequent changes to the table commit route. Changes from the table create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial table state. +pub async fn create_table( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + create_table_request: Option, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_table_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn drop_namespace( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Remove a table from the catalog +pub async fn drop_table( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + table: &str, + purge_requested: Option, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables/{table}", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace), + table = crate::apis::urlencode(table) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = purge_requested { + local_var_req_builder = + local_var_req_builder.query(&[("purgeRequested", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all namespaces at a certain level, optionally starting from a given parent namespace. For example, if table accounting.tax.paid exists, using 'SELECT NAMESPACE IN accounting' would translate into `GET /namespaces?parent=accounting` and must return a namespace, [\"accounting\", \"tax\"]. If `parent` is not provided, all top-level namespaces should be listed. +pub async fn list_namespaces( + configuration: &configuration::Configuration, + prefix: &str, + parent: Option<&str>, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = parent { + local_var_req_builder = + local_var_req_builder.query(&[("parent", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Return all table identifiers under this namespace +pub async fn list_tables( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Return all stored metadata properties for a given namespace +pub async fn load_namespace_metadata( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Load a table from the catalog. The response contains both configuration and table metadata. The configuration, if non-empty is used as additional configuration for the table that overrides catalog configuration. For example, this configuration may change the FileIO implementation to be used for the table. The response also contains the table's full metadata, matching the table metadata JSON file. The catalog configuration may contain credentials that should be used for subsequent requests for the table. The configuration key \"token\" is used to pass an access token to be used as a bearer token for table requests. Otherwise, a token may be passed using a RFC 8693 token type as a configuration key. For example, \"urn:ietf:params:oauth:token-type:jwt=\". +pub async fn load_table( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + table: &str, + snapshots: Option<&str>, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables/{table}", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace), + table = crate::apis::urlencode(table) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = snapshots { + local_var_req_builder = + local_var_req_builder.query(&[("snapshots", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Rename a table from one identifier to another. It's valid to move a table across namespaces, but the server implementation is not required to support it. +pub async fn rename_table( + configuration: &configuration::Configuration, + prefix: &str, + rename_table_request: crate::models::RenameTableRequest, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/tables/rename", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&rename_table_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn report_metrics( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + table: &str, + report_metrics_request: crate::models::ReportMetricsRequest, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables/{table}/metrics", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace), + table = crate::apis::urlencode(table) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&report_metrics_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Check if a table exists within a given namespace. This request does not return a response body. +pub async fn table_exists( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + table: &str, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables/{table}", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace), + table = crate::apis::urlencode(table) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::HEAD, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Set and/or remove properties on a namespace. The request body specifies a list of properties to remove and a map of key value pairs to update. Properties that are not in the request are not modified or removed by this call. Server implementations are not required to support namespace properties. +pub async fn update_properties( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + update_namespace_properties_request: Option, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/properties", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_namespace_properties_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Commit updates to a table. Commits have two parts, requirements and updates. Requirements are assertions that will be validated before attempting to make and commit changes. For example, `assert-ref-snapshot-id` will check that a named ref's snapshot ID has a certain value. Updates are changes to make to table metadata. For example, after asserting that the current main ref is at the expected snapshot, a commit may add a new child snapshot and set the ref to the new snapshot id. Create table transactions that are started by createTable with `stage-create` set to true are committed using this route. Transactions should include all changes to the table, including table initialization, like AddSchemaUpdate and SetCurrentSchemaUpdate. The `assert-create` requirement is used to ensure that the table was not created concurrently. +pub async fn update_table( + configuration: &configuration::Configuration, + prefix: &str, + namespace: &str, + table: &str, + commit_table_request: Option, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/v1/{prefix}/namespaces/{namespace}/tables/{table}", + local_var_configuration.base_path, + prefix = crate::apis::urlencode(prefix), + namespace = crate::apis::urlencode(namespace), + table = crate::apis::urlencode(table) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&commit_table_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/crates/iceberg-rest-catalog-client/src/apis/configuration.rs b/crates/iceberg-rest-catalog-client/src/apis/configuration.rs new file mode 100644 index 0000000000..34ab7406d2 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/apis/configuration.rs @@ -0,0 +1,66 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "https://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/apis/configuration_api_api.rs b/crates/iceberg-rest-catalog-client/src/apis/configuration_api_api.rs new file mode 100644 index 0000000000..70980ef64c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/apis/configuration_api_api.rs @@ -0,0 +1,92 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use reqwest; + +use super::{configuration, Error}; +use crate::apis::ResponseContent; + +/// struct for typed errors of method [`get_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetConfigError { + Status400(crate::models::ErrorModel), + Status401(crate::models::ErrorModel), + Status403(crate::models::ErrorModel), + Status419(crate::models::ErrorModel), + Status503(crate::models::ErrorModel), + Status5XX(crate::models::ErrorModel), + UnknownValue(serde_json::Value), +} + +/// All REST clients should first call this route to get catalog configuration properties from the server to configure the catalog and its HTTP client. Configuration from the server consists of two sets of key/value pairs. - defaults - properties that should be used as default configuration; applied before client configuration - overrides - properties that should be used to override client configuration; applied after defaults and client configuration Catalog configuration is constructed by setting the defaults, then client- provided configuration, and finally overrides. The final property set is then used to configure the catalog. For example, a default configuration property might set the size of the client pool, which can be replaced with a client-specific setting. An override might be used to set the warehouse location, which is stored on the server rather than in client configuration. Common catalog configuration settings are documented at https://iceberg.apache.org/configuration/#catalog-properties +pub async fn get_config( + configuration: &configuration::Configuration, + warehouse: Option<&str>, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/config", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = warehouse { + local_var_req_builder = + local_var_req_builder.query(&[("warehouse", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/crates/iceberg-rest-catalog-client/src/apis/mod.rs b/crates/iceberg-rest-catalog-client/src/apis/mod.rs new file mode 100644 index 0000000000..0adf068e96 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/apis/mod.rs @@ -0,0 +1,116 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + } + serde_json::Value::String(s) => { + params.push((format!("{}[{}]", prefix, key), s.clone())) + } + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod catalog_api_api; +pub mod configuration_api_api; +pub mod o_auth2_api_api; + +pub mod configuration; diff --git a/crates/iceberg-rest-catalog-client/src/apis/o_auth2_api_api.rs b/crates/iceberg-rest-catalog-client/src/apis/o_auth2_api_api.rs new file mode 100644 index 0000000000..b63801e346 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/apis/o_auth2_api_api.rs @@ -0,0 +1,111 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use reqwest; + +use super::{configuration, Error}; +use crate::apis::ResponseContent; + +/// struct for typed errors of method [`get_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTokenError { + Status400(crate::models::OAuthError), + Status401(crate::models::OAuthError), + Status5XX(crate::models::OAuthError), + UnknownValue(serde_json::Value), +} + +/// Exchange credentials for a token using the OAuth2 client credentials flow or token exchange. This endpoint is used for three purposes - 1. To exchange client credentials (client ID and secret) for an access token This uses the client credentials flow. 2. To exchange a client token and an identity token for a more specific access token This uses the token exchange flow. 3. To exchange an access token for one with the same claims and a refreshed expiration period This uses the token exchange flow. For example, a catalog client may be configured with client credentials from the OAuth2 Authorization flow. This client would exchange its client ID and secret for an access token using the client credentials request with this endpoint (1). Subsequent requests would then use that access token. Some clients may also handle sessions that have additional user context. These clients would use the token exchange flow to exchange a user token (the \"subject\" token) from the session for a more specific access token for that user, using the catalog's access token as the \"actor\" token (2). The user ID token is the \"subject\" token and can be any token type allowed by the OAuth2 token exchange flow, including a unsecured JWT token with a sub claim. This request should use the catalog's bearer token in the \"Authorization\" header. Clients may also use the token exchange flow to refresh a token that is about to expire by sending a token exchange request (3). The request's \"subject\" token should be the expiring token. This request should use the subject token in the \"Authorization\" header. +pub async fn get_token( + configuration: &configuration::Configuration, + grant_type: &str, + client_id: &str, + client_secret: &str, + subject_token: &str, + subject_token_type: crate::models::TokenType, + scope: Option<&str>, + requested_token_type: Option, + actor_token: Option<&str>, + actor_token_type: Option, +) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/oauth/tokens", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + let mut local_var_form_params = std::collections::HashMap::new(); + local_var_form_params.insert("grant_type", grant_type.to_string()); + if let Some(local_var_param_value) = scope { + local_var_form_params.insert("scope", local_var_param_value.to_string()); + } + local_var_form_params.insert("client_id", client_id.to_string()); + local_var_form_params.insert("client_secret", client_secret.to_string()); + if let Some(local_var_param_value) = requested_token_type { + local_var_form_params.insert("requested_token_type", local_var_param_value.to_string()); + } + local_var_form_params.insert("subject_token", subject_token.to_string()); + local_var_form_params.insert("subject_token_type", subject_token_type.to_string()); + if let Some(local_var_param_value) = actor_token { + local_var_form_params.insert("actor_token", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = actor_token_type { + local_var_form_params.insert("actor_token_type", local_var_param_value.to_string()); + } + local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/crates/iceberg-rest-catalog-client/src/lib.rs b/crates/iceberg-rest-catalog-client/src/lib.rs new file mode 100644 index 0000000000..ade9294ed5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/lib.rs @@ -0,0 +1,29 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#![allow(clippy::too_many_arguments)] + +#[macro_use] +extern crate serde_derive; + +extern crate reqwest; +extern crate serde; +extern crate serde_json; +extern crate url; + +pub mod apis; +pub mod models; diff --git a/crates/iceberg-rest-catalog-client/src/models/add_partition_spec_update.rs b/crates/iceberg-rest-catalog-client/src/models/add_partition_spec_update.rs new file mode 100644 index 0000000000..3f64f2ebec --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_partition_spec_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddPartitionSpecUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "spec")] + pub spec: Box, +} + +impl AddPartitionSpecUpdate { + pub fn new(action: Action, spec: crate::models::PartitionSpec) -> AddPartitionSpecUpdate { + AddPartitionSpecUpdate { + action, + spec: Box::new(spec), + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_partition_spec_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/add_partition_spec_update_all_of.rs new file mode 100644 index 0000000000..4640c7feb1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_partition_spec_update_all_of.rs @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddPartitionSpecUpdateAllOf { + #[serde(rename = "spec")] + pub spec: Box, +} + +impl AddPartitionSpecUpdateAllOf { + pub fn new(spec: crate::models::PartitionSpec) -> AddPartitionSpecUpdateAllOf { + AddPartitionSpecUpdateAllOf { + spec: Box::new(spec), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_schema_update.rs b/crates/iceberg-rest-catalog-client/src/models/add_schema_update.rs new file mode 100644 index 0000000000..9ba5815842 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_schema_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddSchemaUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "schema")] + pub schema: Box, +} + +impl AddSchemaUpdate { + pub fn new(action: Action, schema: crate::models::Schema) -> AddSchemaUpdate { + AddSchemaUpdate { + action, + schema: Box::new(schema), + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_schema_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/add_schema_update_all_of.rs new file mode 100644 index 0000000000..ba2a9db3d4 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_schema_update_all_of.rs @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddSchemaUpdateAllOf { + #[serde(rename = "schema")] + pub schema: Box, +} + +impl AddSchemaUpdateAllOf { + pub fn new(schema: crate::models::Schema) -> AddSchemaUpdateAllOf { + AddSchemaUpdateAllOf { + schema: Box::new(schema), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_snapshot_update.rs b/crates/iceberg-rest-catalog-client/src/models/add_snapshot_update.rs new file mode 100644 index 0000000000..87378cfec6 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_snapshot_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddSnapshotUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "snapshot")] + pub snapshot: Box, +} + +impl AddSnapshotUpdate { + pub fn new(action: Action, snapshot: crate::models::Snapshot) -> AddSnapshotUpdate { + AddSnapshotUpdate { + action, + snapshot: Box::new(snapshot), + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_snapshot_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/add_snapshot_update_all_of.rs new file mode 100644 index 0000000000..d90ffbf76e --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_snapshot_update_all_of.rs @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddSnapshotUpdateAllOf { + #[serde(rename = "snapshot")] + pub snapshot: Box, +} + +impl AddSnapshotUpdateAllOf { + pub fn new(snapshot: crate::models::Snapshot) -> AddSnapshotUpdateAllOf { + AddSnapshotUpdateAllOf { + snapshot: Box::new(snapshot), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_sort_order_update.rs b/crates/iceberg-rest-catalog-client/src/models/add_sort_order_update.rs new file mode 100644 index 0000000000..2ffe20b501 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_sort_order_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddSortOrderUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "sort-order")] + pub sort_order: Box, +} + +impl AddSortOrderUpdate { + pub fn new(action: Action, sort_order: crate::models::SortOrder) -> AddSortOrderUpdate { + AddSortOrderUpdate { + action, + sort_order: Box::new(sort_order), + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/add_sort_order_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/add_sort_order_update_all_of.rs new file mode 100644 index 0000000000..c9ff4fc110 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/add_sort_order_update_all_of.rs @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddSortOrderUpdateAllOf { + #[serde(rename = "sort-order")] + pub sort_order: Box, +} + +impl AddSortOrderUpdateAllOf { + pub fn new(sort_order: crate::models::SortOrder) -> AddSortOrderUpdateAllOf { + AddSortOrderUpdateAllOf { + sort_order: Box::new(sort_order), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/and_or_expression.rs b/crates/iceberg-rest-catalog-client/src/models/and_or_expression.rs new file mode 100644 index 0000000000..ad8e7a03d8 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/and_or_expression.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AndOrExpression { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "left")] + pub left: Box, + #[serde(rename = "right")] + pub right: Box, +} + +impl AndOrExpression { + pub fn new( + r#type: String, + left: crate::models::Expression, + right: crate::models::Expression, + ) -> AndOrExpression { + AndOrExpression { + r#type, + left: Box::new(left), + right: Box::new(right), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/base_update.rs b/crates/iceberg-rest-catalog-client/src/models/base_update.rs new file mode 100644 index 0000000000..fa4532edf7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/base_update.rs @@ -0,0 +1,77 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct BaseUpdate { + #[serde(rename = "action")] + pub action: Action, +} + +impl BaseUpdate { + pub fn new(action: Action) -> BaseUpdate { + BaseUpdate { action } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/catalog_config.rs b/crates/iceberg-rest-catalog-client/src/models/catalog_config.rs new file mode 100644 index 0000000000..fd1991d2b9 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/catalog_config.rs @@ -0,0 +1,51 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// CatalogConfig : Server-provided configuration for the catalog. + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CatalogConfig { + /// Properties that should be used to override client configuration; applied after defaults and client configuration. + #[serde(rename = "overrides")] + pub overrides: ::std::collections::HashMap, + /// Properties that should be used as default configuration; applied before client configuration. + #[serde(rename = "defaults")] + pub defaults: ::std::collections::HashMap, +} + +impl CatalogConfig { + /// Server-provided configuration for the catalog. + pub fn new( + overrides: ::std::collections::HashMap, + defaults: ::std::collections::HashMap, + ) -> CatalogConfig { + CatalogConfig { + overrides, + defaults, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/commit_report.rs b/crates/iceberg-rest-catalog-client/src/models/commit_report.rs new file mode 100644 index 0000000000..c1b78f0530 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/commit_report.rs @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitReport { + #[serde(rename = "table-name")] + pub table_name: String, + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "sequence-number")] + pub sequence_number: i64, + #[serde(rename = "operation")] + pub operation: String, + #[serde(rename = "metrics")] + pub metrics: ::std::collections::HashMap, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option<::std::collections::HashMap>, +} + +impl CommitReport { + pub fn new( + table_name: String, + snapshot_id: i64, + sequence_number: i64, + operation: String, + metrics: ::std::collections::HashMap, + ) -> CommitReport { + CommitReport { + table_name, + snapshot_id, + sequence_number, + operation, + metrics, + metadata: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/commit_table_request.rs b/crates/iceberg-rest-catalog-client/src/models/commit_table_request.rs new file mode 100644 index 0000000000..2b960e9881 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/commit_table_request.rs @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitTableRequest { + #[serde(rename = "requirements")] + pub requirements: Vec, + #[serde(rename = "updates")] + pub updates: Vec, +} + +impl CommitTableRequest { + pub fn new( + requirements: Vec, + updates: Vec, + ) -> CommitTableRequest { + CommitTableRequest { + requirements, + updates, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/commit_table_response.rs b/crates/iceberg-rest-catalog-client/src/models/commit_table_response.rs new file mode 100644 index 0000000000..1aa23daf9f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/commit_table_response.rs @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitTableResponse { + #[serde(rename = "metadata-location")] + pub metadata_location: String, + #[serde(rename = "metadata")] + pub metadata: Box, +} + +impl CommitTableResponse { + pub fn new( + metadata_location: String, + metadata: crate::models::TableMetadata, + ) -> CommitTableResponse { + CommitTableResponse { + metadata_location, + metadata: Box::new(metadata), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/counter_result.rs b/crates/iceberg-rest-catalog-client/src/models/counter_result.rs new file mode 100644 index 0000000000..3709a4bc5b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/counter_result.rs @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CounterResult { + #[serde(rename = "unit")] + pub unit: String, + #[serde(rename = "value")] + pub value: i64, +} + +impl CounterResult { + pub fn new(unit: String, value: i64) -> CounterResult { + CounterResult { unit, value } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/create_namespace_request.rs b/crates/iceberg-rest-catalog-client/src/models/create_namespace_request.rs new file mode 100644 index 0000000000..e2d194e0d5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/create_namespace_request.rs @@ -0,0 +1,45 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateNamespaceRequest { + /// Reference to one or more levels of a namespace + #[serde(rename = "namespace")] + pub namespace: Vec, + /// Configured string to string map of properties for the namespace + #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] + pub properties: Option<::std::collections::HashMap>, +} + +impl CreateNamespaceRequest { + pub fn new(namespace: Vec) -> CreateNamespaceRequest { + CreateNamespaceRequest { + namespace, + properties: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/create_namespace_response.rs b/crates/iceberg-rest-catalog-client/src/models/create_namespace_response.rs new file mode 100644 index 0000000000..6e299265bb --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/create_namespace_response.rs @@ -0,0 +1,45 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateNamespaceResponse { + /// Reference to one or more levels of a namespace + #[serde(rename = "namespace")] + pub namespace: Vec, + /// Properties stored on the namespace, if supported by the server. + #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] + pub properties: Option<::std::collections::HashMap>, +} + +impl CreateNamespaceResponse { + pub fn new(namespace: Vec) -> CreateNamespaceResponse { + CreateNamespaceResponse { + namespace, + properties: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/create_table_request.rs b/crates/iceberg-rest-catalog-client/src/models/create_table_request.rs new file mode 100644 index 0000000000..e108d3e409 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/create_table_request.rs @@ -0,0 +1,58 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateTableRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "schema")] + pub schema: Box, + #[serde(rename = "partition-spec", skip_serializing_if = "Option::is_none")] + pub partition_spec: Option>, + #[serde(rename = "write-order", skip_serializing_if = "Option::is_none")] + pub write_order: Option>, + #[serde(rename = "stage-create", skip_serializing_if = "Option::is_none")] + pub stage_create: Option, + #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] + pub properties: Option<::std::collections::HashMap>, +} + +impl CreateTableRequest { + pub fn new(name: String, schema: crate::models::Schema) -> CreateTableRequest { + CreateTableRequest { + name, + location: None, + schema: Box::new(schema), + partition_spec: None, + write_order: None, + stage_create: None, + properties: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/error_model.rs b/crates/iceberg-rest-catalog-client/src/models/error_model.rs new file mode 100644 index 0000000000..1a44149f63 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/error_model.rs @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// ErrorModel : JSON error payload returned in a response with further details on the error + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ErrorModel { + /// Human-readable error message + #[serde(rename = "message")] + pub message: String, + /// Internal type definition of the error + #[serde(rename = "type")] + pub r#type: String, + /// HTTP response code + #[serde(rename = "code")] + pub code: i32, + #[serde(rename = "stack", skip_serializing_if = "Option::is_none")] + pub stack: Option>, +} + +impl ErrorModel { + /// JSON error payload returned in a response with further details on the error + pub fn new(message: String, r#type: String, code: i32) -> ErrorModel { + ErrorModel { + message, + r#type, + code, + stack: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/expression.rs b/crates/iceberg-rest-catalog-client/src/models/expression.rs new file mode 100644 index 0000000000..fbabae47dc --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/expression.rs @@ -0,0 +1,66 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Expression { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "left")] + pub left: Box, + #[serde(rename = "right")] + pub right: Box, + #[serde(rename = "child")] + pub child: Box, + #[serde(rename = "term")] + pub term: Box, + #[serde(rename = "values")] + pub values: Vec, + #[serde(rename = "value")] + pub value: serde_json::Value, +} + +impl Expression { + pub fn new( + r#type: String, + left: crate::models::Expression, + right: crate::models::Expression, + child: crate::models::Expression, + term: crate::models::Term, + values: Vec, + value: serde_json::Value, + ) -> Expression { + Expression { + r#type, + left: Box::new(left), + right: Box::new(right), + child: Box::new(child), + term: Box::new(term), + values, + value, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/get_namespace_response.rs b/crates/iceberg-rest-catalog-client/src/models/get_namespace_response.rs new file mode 100644 index 0000000000..ac308942ce --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/get_namespace_response.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GetNamespaceResponse { + /// Reference to one or more levels of a namespace + #[serde(rename = "namespace")] + pub namespace: Vec, + /// 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. + #[serde( + rename = "properties", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub properties: Option>>, +} + +impl GetNamespaceResponse { + pub fn new(namespace: Vec) -> GetNamespaceResponse { + GetNamespaceResponse { + namespace, + properties: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/iceberg_error_response.rs b/crates/iceberg-rest-catalog-client/src/models/iceberg_error_response.rs new file mode 100644 index 0000000000..ce3d9a4405 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/iceberg_error_response.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct IcebergErrorResponse { + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option>, +} + +impl IcebergErrorResponse { + pub fn new() -> IcebergErrorResponse { + IcebergErrorResponse { error: None } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/list_namespaces_response.rs b/crates/iceberg-rest-catalog-client/src/models/list_namespaces_response.rs new file mode 100644 index 0000000000..c43fd3f4c9 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/list_namespaces_response.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ListNamespacesResponse { + #[serde(rename = "namespaces", skip_serializing_if = "Option::is_none")] + pub namespaces: Option>>, +} + +impl ListNamespacesResponse { + pub fn new() -> ListNamespacesResponse { + ListNamespacesResponse { namespaces: None } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/list_tables_response.rs b/crates/iceberg-rest-catalog-client/src/models/list_tables_response.rs new file mode 100644 index 0000000000..97cf740d45 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/list_tables_response.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ListTablesResponse { + #[serde(rename = "identifiers", skip_serializing_if = "Option::is_none")] + pub identifiers: Option>, +} + +impl ListTablesResponse { + pub fn new() -> ListTablesResponse { + ListTablesResponse { identifiers: None } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/list_type.rs b/crates/iceberg-rest-catalog-client/src/models/list_type.rs new file mode 100644 index 0000000000..47c12d2a7b --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/list_type.rs @@ -0,0 +1,67 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ListType { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "element-id")] + pub element_id: i32, + #[serde(rename = "element")] + pub element: Box, + #[serde(rename = "element-required")] + pub element_required: bool, +} + +impl ListType { + pub fn new( + r#type: RHashType, + element_id: i32, + element: crate::models::Type, + element_required: bool, + ) -> ListType { + ListType { + r#type, + element_id, + element: Box::new(element), + element_required, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "list")] + List, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::List + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/literal_expression.rs b/crates/iceberg-rest-catalog-client/src/models/literal_expression.rs new file mode 100644 index 0000000000..3860ec35ff --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/literal_expression.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct LiteralExpression { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "term")] + pub term: Box, + #[serde(rename = "value")] + pub value: serde_json::Value, +} + +impl LiteralExpression { + pub fn new( + r#type: String, + term: crate::models::Term, + value: serde_json::Value, + ) -> LiteralExpression { + LiteralExpression { + r#type, + term: Box::new(term), + value, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/load_table_result.rs b/crates/iceberg-rest-catalog-client/src/models/load_table_result.rs new file mode 100644 index 0000000000..783097d6c1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/load_table_result.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// LoadTableResult : Result used when a table is successfully loaded. The table metadata JSON is returned in the `metadata` field. The corresponding file location of table metadata should be returned in the `metadata-location` field, unless the metadata is not yet committed. For example, a create transaction may return metadata that is staged but not committed. Clients can check whether metadata has changed by comparing metadata locations after the table has been created. The `config` map returns table-specific configuration for the table's resources, including its HTTP client and FileIO. For example, config may contain a specific FileIO implementation class for the table depending on its underlying storage. The following configurations should be respected by clients: ## General Configurations - `token`: Authorization bearer token to use for table requests if OAuth2 security is enabled ## AWS Configurations The following configurations should be respected when working with tables stored in AWS S3 - `client.region`: region to configure client for making requests to AWS - `s3.access-key-id`: id for for credentials that provide access to the data in S3 - `s3.secret-access-key`: secret for credentials that provide access to data in S3 - `s3.session-token`: if present, this value should be used for as the session token - `s3.remote-signing-enabled`: if `true` remote signing should be performed as described in the `s3-signer-open-api.yaml` specification + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct LoadTableResult { + /// May be null if the table is staged as part of a transaction + #[serde(rename = "metadata-location", skip_serializing_if = "Option::is_none")] + pub metadata_location: Option, + #[serde(rename = "metadata")] + pub metadata: Box, + #[serde(rename = "config", skip_serializing_if = "Option::is_none")] + pub config: Option<::std::collections::HashMap>, +} + +impl LoadTableResult { + /// Result used when a table is successfully loaded. The table metadata JSON is returned in the `metadata` field. The corresponding file location of table metadata should be returned in the `metadata-location` field, unless the metadata is not yet committed. For example, a create transaction may return metadata that is staged but not committed. Clients can check whether metadata has changed by comparing metadata locations after the table has been created. The `config` map returns table-specific configuration for the table's resources, including its HTTP client and FileIO. For example, config may contain a specific FileIO implementation class for the table depending on its underlying storage. The following configurations should be respected by clients: ## General Configurations - `token`: Authorization bearer token to use for table requests if OAuth2 security is enabled ## AWS Configurations The following configurations should be respected when working with tables stored in AWS S3 - `client.region`: region to configure client for making requests to AWS - `s3.access-key-id`: id for for credentials that provide access to the data in S3 - `s3.secret-access-key`: secret for credentials that provide access to data in S3 - `s3.session-token`: if present, this value should be used for as the session token - `s3.remote-signing-enabled`: if `true` remote signing should be performed as described in the `s3-signer-open-api.yaml` specification + pub fn new(metadata: crate::models::TableMetadata) -> LoadTableResult { + LoadTableResult { + metadata_location: None, + metadata: Box::new(metadata), + config: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/map_type.rs b/crates/iceberg-rest-catalog-client/src/models/map_type.rs new file mode 100644 index 0000000000..21fb148851 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/map_type.rs @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MapType { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "key-id")] + pub key_id: i32, + #[serde(rename = "key")] + pub key: Box, + #[serde(rename = "value-id")] + pub value_id: i32, + #[serde(rename = "value")] + pub value: Box, + #[serde(rename = "value-required")] + pub value_required: bool, +} + +impl MapType { + pub fn new( + r#type: RHashType, + key_id: i32, + key: crate::models::Type, + value_id: i32, + value: crate::models::Type, + value_required: bool, + ) -> MapType { + MapType { + r#type, + key_id, + key: Box::new(key), + value_id, + value: Box::new(value), + value_required, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "map")] + Map, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Map + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/metadata_log_inner.rs b/crates/iceberg-rest-catalog-client/src/models/metadata_log_inner.rs new file mode 100644 index 0000000000..8ece9e0001 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/metadata_log_inner.rs @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MetadataLogInner { + #[serde(rename = "metadata-file")] + pub metadata_file: String, + #[serde(rename = "timestamp-ms")] + pub timestamp_ms: i64, +} + +impl MetadataLogInner { + pub fn new(metadata_file: String, timestamp_ms: i64) -> MetadataLogInner { + MetadataLogInner { + metadata_file, + timestamp_ms, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/metric_result.rs b/crates/iceberg-rest-catalog-client/src/models/metric_result.rs new file mode 100644 index 0000000000..fe84e6a48e --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/metric_result.rs @@ -0,0 +1,58 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MetricResult { + #[serde(rename = "unit")] + pub unit: String, + #[serde(rename = "value")] + pub value: i64, + #[serde(rename = "time-unit")] + pub time_unit: String, + #[serde(rename = "count")] + pub count: i64, + #[serde(rename = "total-duration")] + pub total_duration: i64, +} + +impl MetricResult { + pub fn new( + unit: String, + value: i64, + time_unit: String, + count: i64, + total_duration: i64, + ) -> MetricResult { + MetricResult { + unit, + value, + time_unit, + count, + total_duration, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/mod.rs b/crates/iceberg-rest-catalog-client/src/models/mod.rs new file mode 100644 index 0000000000..09507c0c81 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/mod.rs @@ -0,0 +1,181 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +pub mod add_partition_spec_update; +pub use self::add_partition_spec_update::AddPartitionSpecUpdate; +pub mod add_partition_spec_update_all_of; +pub use self::add_partition_spec_update_all_of::AddPartitionSpecUpdateAllOf; +pub mod add_schema_update; +pub use self::add_schema_update::AddSchemaUpdate; +pub mod add_schema_update_all_of; +pub use self::add_schema_update_all_of::AddSchemaUpdateAllOf; +pub mod add_snapshot_update; +pub use self::add_snapshot_update::AddSnapshotUpdate; +pub mod add_snapshot_update_all_of; +pub use self::add_snapshot_update_all_of::AddSnapshotUpdateAllOf; +pub mod add_sort_order_update; +pub use self::add_sort_order_update::AddSortOrderUpdate; +pub mod add_sort_order_update_all_of; +pub use self::add_sort_order_update_all_of::AddSortOrderUpdateAllOf; +pub mod and_or_expression; +pub use self::and_or_expression::AndOrExpression; +pub mod base_update; +pub use self::base_update::BaseUpdate; +pub mod catalog_config; +pub use self::catalog_config::CatalogConfig; +pub mod commit_report; +pub use self::commit_report::CommitReport; +pub mod commit_table_request; +pub use self::commit_table_request::CommitTableRequest; +pub mod commit_table_response; +pub use self::commit_table_response::CommitTableResponse; +pub mod counter_result; +pub use self::counter_result::CounterResult; +pub mod create_namespace_request; +pub use self::create_namespace_request::CreateNamespaceRequest; +pub mod create_namespace_response; +pub use self::create_namespace_response::CreateNamespaceResponse; +pub mod create_table_request; +pub use self::create_table_request::CreateTableRequest; +pub mod error_model; +pub use self::error_model::ErrorModel; +pub mod expression; +pub use self::expression::Expression; +pub mod get_namespace_response; +pub use self::get_namespace_response::GetNamespaceResponse; +pub mod iceberg_error_response; +pub use self::iceberg_error_response::IcebergErrorResponse; +pub mod list_namespaces_response; +pub use self::list_namespaces_response::ListNamespacesResponse; +pub mod list_tables_response; +pub use self::list_tables_response::ListTablesResponse; +pub mod list_type; +pub use self::list_type::ListType; +pub mod literal_expression; +pub use self::literal_expression::LiteralExpression; +pub mod load_table_result; +pub use self::load_table_result::LoadTableResult; +pub mod map_type; +pub use self::map_type::MapType; +pub mod metadata_log_inner; +pub use self::metadata_log_inner::MetadataLogInner; +pub mod metric_result; +pub use self::metric_result::MetricResult; +pub mod not_expression; +pub use self::not_expression::NotExpression; +pub mod null_order; +pub use self::null_order::NullOrder; +pub mod o_auth_error; +pub use self::o_auth_error::OAuthError; +pub mod o_auth_token_response; +pub use self::o_auth_token_response::OAuthTokenResponse; +pub mod partition_field; +pub use self::partition_field::PartitionField; +pub mod partition_spec; +pub use self::partition_spec::PartitionSpec; +pub mod remove_properties_update; +pub use self::remove_properties_update::RemovePropertiesUpdate; +pub mod remove_properties_update_all_of; +pub use self::remove_properties_update_all_of::RemovePropertiesUpdateAllOf; +pub mod remove_snapshot_ref_update; +pub use self::remove_snapshot_ref_update::RemoveSnapshotRefUpdate; +pub mod remove_snapshots_update; +pub use self::remove_snapshots_update::RemoveSnapshotsUpdate; +pub mod remove_snapshots_update_all_of; +pub use self::remove_snapshots_update_all_of::RemoveSnapshotsUpdateAllOf; +pub mod rename_table_request; +pub use self::rename_table_request::RenameTableRequest; +pub mod report_metrics_request; +pub use self::report_metrics_request::ReportMetricsRequest; +pub mod scan_report; +pub use self::scan_report::ScanReport; +pub mod schema; +pub use self::schema::Schema; +pub mod schema_all_of; +pub use self::schema_all_of::SchemaAllOf; +pub mod set_current_schema_update; +pub use self::set_current_schema_update::SetCurrentSchemaUpdate; +pub mod set_current_schema_update_all_of; +pub use self::set_current_schema_update_all_of::SetCurrentSchemaUpdateAllOf; +pub mod set_default_sort_order_update; +pub use self::set_default_sort_order_update::SetDefaultSortOrderUpdate; +pub mod set_default_sort_order_update_all_of; +pub use self::set_default_sort_order_update_all_of::SetDefaultSortOrderUpdateAllOf; +pub mod set_default_spec_update; +pub use self::set_default_spec_update::SetDefaultSpecUpdate; +pub mod set_default_spec_update_all_of; +pub use self::set_default_spec_update_all_of::SetDefaultSpecUpdateAllOf; +pub mod set_expression; +pub use self::set_expression::SetExpression; +pub mod set_location_update; +pub use self::set_location_update::SetLocationUpdate; +pub mod set_location_update_all_of; +pub use self::set_location_update_all_of::SetLocationUpdateAllOf; +pub mod set_properties_update; +pub use self::set_properties_update::SetPropertiesUpdate; +pub mod set_properties_update_all_of; +pub use self::set_properties_update_all_of::SetPropertiesUpdateAllOf; +pub mod set_snapshot_ref_update; +pub use self::set_snapshot_ref_update::SetSnapshotRefUpdate; +pub mod set_snapshot_ref_update_all_of; +pub use self::set_snapshot_ref_update_all_of::SetSnapshotRefUpdateAllOf; +pub mod snapshot; +pub use self::snapshot::Snapshot; +pub mod snapshot_log_inner; +pub use self::snapshot_log_inner::SnapshotLogInner; +pub mod snapshot_reference; +pub use self::snapshot_reference::SnapshotReference; +pub mod snapshot_summary; +pub use self::snapshot_summary::SnapshotSummary; +pub mod sort_direction; +pub use self::sort_direction::SortDirection; +pub mod sort_field; +pub use self::sort_field::SortField; +pub mod sort_order; +pub use self::sort_order::SortOrder; +pub mod struct_field; +pub use self::struct_field::StructField; +pub mod struct_type; +pub use self::struct_type::StructType; +pub mod table_identifier; +pub use self::table_identifier::TableIdentifier; +pub mod table_metadata; +pub use self::table_metadata::TableMetadata; +pub mod table_requirement; +pub use self::table_requirement::TableRequirement; +pub mod table_update; +pub use self::table_update::TableUpdate; +pub mod term; +pub use self::term::Term; +pub mod timer_result; +pub use self::timer_result::TimerResult; +pub mod token_type; +pub use self::token_type::TokenType; +pub mod transform_term; +pub use self::transform_term::TransformTerm; +pub mod model_type; +pub use self::model_type::Type; +pub mod unary_expression; +pub use self::unary_expression::UnaryExpression; +pub mod update_namespace_properties_request; +pub use self::update_namespace_properties_request::UpdateNamespacePropertiesRequest; +pub mod update_namespace_properties_response; +pub use self::update_namespace_properties_response::UpdateNamespacePropertiesResponse; +pub mod upgrade_format_version_update; +pub use self::upgrade_format_version_update::UpgradeFormatVersionUpdate; +pub mod upgrade_format_version_update_all_of; +pub use self::upgrade_format_version_update_all_of::UpgradeFormatVersionUpdateAllOf; diff --git a/crates/iceberg-rest-catalog-client/src/models/model_type.rs b/crates/iceberg-rest-catalog-client/src/models/model_type.rs new file mode 100644 index 0000000000..a3fa8a90d7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/model_type.rs @@ -0,0 +1,91 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Type { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "fields")] + pub fields: Vec, + #[serde(rename = "element-id")] + pub element_id: i32, + #[serde(rename = "element")] + pub element: Box, + #[serde(rename = "element-required")] + pub element_required: bool, + #[serde(rename = "key-id")] + pub key_id: i32, + #[serde(rename = "key")] + pub key: Box, + #[serde(rename = "value-id")] + pub value_id: i32, + #[serde(rename = "value")] + pub value: Box, + #[serde(rename = "value-required")] + pub value_required: bool, +} + +impl Type { + pub fn new( + r#type: RHashType, + fields: Vec, + element_id: i32, + element: crate::models::Type, + element_required: bool, + key_id: i32, + key: crate::models::Type, + value_id: i32, + value: crate::models::Type, + value_required: bool, + ) -> Type { + Type { + r#type, + fields, + element_id, + element: Box::new(element), + element_required, + key_id, + key: Box::new(key), + value_id, + value: Box::new(value), + value_required, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "map")] + Map, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Map + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/not_expression.rs b/crates/iceberg-rest-catalog-client/src/models/not_expression.rs new file mode 100644 index 0000000000..c9bda6f7af --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/not_expression.rs @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NotExpression { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "child")] + pub child: Box, +} + +impl NotExpression { + pub fn new(r#type: String, child: crate::models::Expression) -> NotExpression { + NotExpression { + r#type, + child: Box::new(child), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/null_order.rs b/crates/iceberg-rest-catalog-client/src/models/null_order.rs new file mode 100644 index 0000000000..34a8b6faa7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/null_order.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum NullOrder { + #[serde(rename = "nulls-first")] + First, + #[serde(rename = "nulls-last")] + Last, +} + +impl ToString for NullOrder { + fn to_string(&self) -> String { + match self { + Self::First => String::from("nulls-first"), + Self::Last => String::from("nulls-last"), + } + } +} + +impl Default for NullOrder { + fn default() -> NullOrder { + Self::First + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/o_auth_error.rs b/crates/iceberg-rest-catalog-client/src/models/o_auth_error.rs new file mode 100644 index 0000000000..f69d7299fd --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/o_auth_error.rs @@ -0,0 +1,69 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OAuthError { + #[serde(rename = "error")] + pub error: Error, + #[serde(rename = "error_description", skip_serializing_if = "Option::is_none")] + pub error_description: Option, + #[serde(rename = "error_uri", skip_serializing_if = "Option::is_none")] + pub error_uri: Option, +} + +impl OAuthError { + pub fn new(error: Error) -> OAuthError { + OAuthError { + error, + error_description: None, + error_uri: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Error { + #[serde(rename = "invalid_request")] + InvalidRequest, + #[serde(rename = "invalid_client")] + InvalidClient, + #[serde(rename = "invalid_grant")] + InvalidGrant, + #[serde(rename = "unauthorized_client")] + UnauthorizedClient, + #[serde(rename = "unsupported_grant_type")] + UnsupportedGrantType, + #[serde(rename = "invalid_scope")] + InvalidScope, +} + +impl Default for Error { + fn default() -> Error { + Self::InvalidRequest + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/o_auth_token_response.rs b/crates/iceberg-rest-catalog-client/src/models/o_auth_token_response.rs new file mode 100644 index 0000000000..3c37c252f6 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/o_auth_token_response.rs @@ -0,0 +1,77 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OAuthTokenResponse { + /// The access token, for client credentials or token exchange + #[serde(rename = "access_token")] + pub access_token: String, + /// Access token type for client credentials or token exchange See https://datatracker.ietf.org/doc/html/rfc6749#section-7.1 + #[serde(rename = "token_type")] + pub token_type: TokenType, + /// Lifetime of the access token in seconds for client credentials or token exchange + #[serde(rename = "expires_in", skip_serializing_if = "Option::is_none")] + pub expires_in: Option, + #[serde(rename = "issued_token_type", skip_serializing_if = "Option::is_none")] + pub issued_token_type: Option, + /// Refresh token for client credentials or token exchange + #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + /// Authorization scope for client credentials or token exchange + #[serde(rename = "scope", skip_serializing_if = "Option::is_none")] + pub scope: Option, +} + +impl OAuthTokenResponse { + pub fn new(access_token: String, token_type: TokenType) -> OAuthTokenResponse { + OAuthTokenResponse { + access_token, + token_type, + expires_in: None, + issued_token_type: None, + refresh_token: None, + scope: None, + } + } +} + +/// Access token type for client credentials or token exchange See https://datatracker.ietf.org/doc/html/rfc6749#section-7.1 +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TokenType { + #[serde(rename = "bearer")] + Bearer, + #[serde(rename = "mac")] + Mac, + #[serde(rename = "N_A")] + NA, +} + +impl Default for TokenType { + fn default() -> TokenType { + Self::Bearer + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/partition_field.rs b/crates/iceberg-rest-catalog-client/src/models/partition_field.rs new file mode 100644 index 0000000000..7428e8e031 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/partition_field.rs @@ -0,0 +1,49 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PartitionField { + #[serde(rename = "field-id", skip_serializing_if = "Option::is_none")] + pub field_id: Option, + #[serde(rename = "source-id")] + pub source_id: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "transform")] + pub transform: String, +} + +impl PartitionField { + pub fn new(source_id: i32, name: String, transform: String) -> PartitionField { + PartitionField { + field_id: None, + source_id, + name, + transform, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/partition_spec.rs b/crates/iceberg-rest-catalog-client/src/models/partition_spec.rs new file mode 100644 index 0000000000..60fdc2db45 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/partition_spec.rs @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PartitionSpec { + #[serde(rename = "spec-id", skip_serializing_if = "Option::is_none")] + pub spec_id: Option, + #[serde(rename = "fields")] + pub fields: Vec, +} + +impl PartitionSpec { + pub fn new(fields: Vec) -> PartitionSpec { + PartitionSpec { + spec_id: None, + fields, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/remove_properties_update.rs b/crates/iceberg-rest-catalog-client/src/models/remove_properties_update.rs new file mode 100644 index 0000000000..9be8cf6ac5 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/remove_properties_update.rs @@ -0,0 +1,79 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RemovePropertiesUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "removals")] + pub removals: Vec, +} + +impl RemovePropertiesUpdate { + pub fn new(action: Action, removals: Vec) -> RemovePropertiesUpdate { + RemovePropertiesUpdate { action, removals } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/remove_properties_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/remove_properties_update_all_of.rs new file mode 100644 index 0000000000..ab11050b44 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/remove_properties_update_all_of.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RemovePropertiesUpdateAllOf { + #[serde(rename = "removals")] + pub removals: Vec, +} + +impl RemovePropertiesUpdateAllOf { + pub fn new(removals: Vec) -> RemovePropertiesUpdateAllOf { + RemovePropertiesUpdateAllOf { removals } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/remove_snapshot_ref_update.rs b/crates/iceberg-rest-catalog-client/src/models/remove_snapshot_ref_update.rs new file mode 100644 index 0000000000..b449450c1a --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/remove_snapshot_ref_update.rs @@ -0,0 +1,79 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RemoveSnapshotRefUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "ref-name")] + pub ref_name: String, +} + +impl RemoveSnapshotRefUpdate { + pub fn new(action: Action, ref_name: String) -> RemoveSnapshotRefUpdate { + RemoveSnapshotRefUpdate { action, ref_name } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/remove_snapshots_update.rs b/crates/iceberg-rest-catalog-client/src/models/remove_snapshots_update.rs new file mode 100644 index 0000000000..d2226c555f --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/remove_snapshots_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RemoveSnapshotsUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "snapshot-ids")] + pub snapshot_ids: Vec, +} + +impl RemoveSnapshotsUpdate { + pub fn new(action: Action, snapshot_ids: Vec) -> RemoveSnapshotsUpdate { + RemoveSnapshotsUpdate { + action, + snapshot_ids, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/remove_snapshots_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/remove_snapshots_update_all_of.rs new file mode 100644 index 0000000000..490aabae03 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/remove_snapshots_update_all_of.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RemoveSnapshotsUpdateAllOf { + #[serde(rename = "snapshot-ids")] + pub snapshot_ids: Vec, +} + +impl RemoveSnapshotsUpdateAllOf { + pub fn new(snapshot_ids: Vec) -> RemoveSnapshotsUpdateAllOf { + RemoveSnapshotsUpdateAllOf { snapshot_ids } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/rename_table_request.rs b/crates/iceberg-rest-catalog-client/src/models/rename_table_request.rs new file mode 100644 index 0000000000..4feb7a3115 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/rename_table_request.rs @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RenameTableRequest { + #[serde(rename = "source")] + pub source: Box, + #[serde(rename = "destination")] + pub destination: Box, +} + +impl RenameTableRequest { + pub fn new( + source: crate::models::TableIdentifier, + destination: crate::models::TableIdentifier, + ) -> RenameTableRequest { + RenameTableRequest { + source: Box::new(source), + destination: Box::new(destination), + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/report_metrics_request.rs b/crates/iceberg-rest-catalog-client/src/models/report_metrics_request.rs new file mode 100644 index 0000000000..bcfafc74c1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/report_metrics_request.rs @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ReportMetricsRequest { + #[serde(rename = "report-type")] + pub report_type: String, + #[serde(rename = "table-name")] + pub table_name: String, + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "filter")] + pub filter: Box, + #[serde(rename = "schema-id")] + pub schema_id: i32, + #[serde(rename = "projected-field-ids")] + pub projected_field_ids: Vec, + #[serde(rename = "projected-field-names")] + pub projected_field_names: Vec, + #[serde(rename = "metrics")] + pub metrics: ::std::collections::HashMap, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option<::std::collections::HashMap>, + #[serde(rename = "sequence-number")] + pub sequence_number: i64, + #[serde(rename = "operation")] + pub operation: String, +} + +impl ReportMetricsRequest { + pub fn new( + report_type: String, + table_name: String, + snapshot_id: i64, + filter: crate::models::Expression, + schema_id: i32, + projected_field_ids: Vec, + projected_field_names: Vec, + metrics: ::std::collections::HashMap, + sequence_number: i64, + operation: String, + ) -> ReportMetricsRequest { + ReportMetricsRequest { + report_type, + table_name, + snapshot_id, + filter: Box::new(filter), + schema_id, + projected_field_ids, + projected_field_names, + metrics, + metadata: None, + sequence_number, + operation, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/scan_report.rs b/crates/iceberg-rest-catalog-client/src/models/scan_report.rs new file mode 100644 index 0000000000..78ec3ff743 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/scan_report.rs @@ -0,0 +1,69 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ScanReport { + #[serde(rename = "table-name")] + pub table_name: String, + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "filter")] + pub filter: Box, + #[serde(rename = "schema-id")] + pub schema_id: i32, + #[serde(rename = "projected-field-ids")] + pub projected_field_ids: Vec, + #[serde(rename = "projected-field-names")] + pub projected_field_names: Vec, + #[serde(rename = "metrics")] + pub metrics: ::std::collections::HashMap, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option<::std::collections::HashMap>, +} + +impl ScanReport { + pub fn new( + table_name: String, + snapshot_id: i64, + filter: crate::models::Expression, + schema_id: i32, + projected_field_ids: Vec, + projected_field_names: Vec, + metrics: ::std::collections::HashMap, + ) -> ScanReport { + ScanReport { + table_name, + snapshot_id, + filter: Box::new(filter), + schema_id, + projected_field_ids, + projected_field_names, + metrics, + metadata: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/schema.rs b/crates/iceberg-rest-catalog-client/src/models/schema.rs new file mode 100644 index 0000000000..ce20e1bcf6 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/schema.rs @@ -0,0 +1,65 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Schema { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "fields")] + pub fields: Vec, + #[serde(rename = "schema-id", skip_serializing_if = "Option::is_none")] + pub schema_id: Option, + #[serde( + rename = "identifier-field-ids", + skip_serializing_if = "Option::is_none" + )] + pub identifier_field_ids: Option>, +} + +impl Schema { + pub fn new(r#type: RHashType, fields: Vec) -> Schema { + Schema { + r#type, + fields, + schema_id: None, + identifier_field_ids: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "struct")] + Struct, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Struct + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/schema_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/schema_all_of.rs new file mode 100644 index 0000000000..2f4d2969aa --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/schema_all_of.rs @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SchemaAllOf { + #[serde(rename = "schema-id", skip_serializing_if = "Option::is_none")] + pub schema_id: Option, + #[serde( + rename = "identifier-field-ids", + skip_serializing_if = "Option::is_none" + )] + pub identifier_field_ids: Option>, +} + +impl SchemaAllOf { + pub fn new() -> SchemaAllOf { + SchemaAllOf { + schema_id: None, + identifier_field_ids: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_current_schema_update.rs b/crates/iceberg-rest-catalog-client/src/models/set_current_schema_update.rs new file mode 100644 index 0000000000..7f5a4c4292 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_current_schema_update.rs @@ -0,0 +1,80 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetCurrentSchemaUpdate { + #[serde(rename = "action")] + pub action: Action, + /// Schema ID to set as current, or -1 to set last added schema + #[serde(rename = "schema-id")] + pub schema_id: i32, +} + +impl SetCurrentSchemaUpdate { + pub fn new(action: Action, schema_id: i32) -> SetCurrentSchemaUpdate { + SetCurrentSchemaUpdate { action, schema_id } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_current_schema_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/set_current_schema_update_all_of.rs new file mode 100644 index 0000000000..07658f33b7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_current_schema_update_all_of.rs @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetCurrentSchemaUpdateAllOf { + /// Schema ID to set as current, or -1 to set last added schema + #[serde(rename = "schema-id")] + pub schema_id: i32, +} + +impl SetCurrentSchemaUpdateAllOf { + pub fn new(schema_id: i32) -> SetCurrentSchemaUpdateAllOf { + SetCurrentSchemaUpdateAllOf { schema_id } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_default_sort_order_update.rs b/crates/iceberg-rest-catalog-client/src/models/set_default_sort_order_update.rs new file mode 100644 index 0000000000..d9d18a52e1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_default_sort_order_update.rs @@ -0,0 +1,83 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetDefaultSortOrderUpdate { + #[serde(rename = "action")] + pub action: Action, + /// Sort order ID to set as the default, or -1 to set last added sort order + #[serde(rename = "sort-order-id")] + pub sort_order_id: i32, +} + +impl SetDefaultSortOrderUpdate { + pub fn new(action: Action, sort_order_id: i32) -> SetDefaultSortOrderUpdate { + SetDefaultSortOrderUpdate { + action, + sort_order_id, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_default_sort_order_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/set_default_sort_order_update_all_of.rs new file mode 100644 index 0000000000..4ad14943f7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_default_sort_order_update_all_of.rs @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetDefaultSortOrderUpdateAllOf { + /// Sort order ID to set as the default, or -1 to set last added sort order + #[serde(rename = "sort-order-id")] + pub sort_order_id: i32, +} + +impl SetDefaultSortOrderUpdateAllOf { + pub fn new(sort_order_id: i32) -> SetDefaultSortOrderUpdateAllOf { + SetDefaultSortOrderUpdateAllOf { sort_order_id } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_default_spec_update.rs b/crates/iceberg-rest-catalog-client/src/models/set_default_spec_update.rs new file mode 100644 index 0000000000..7f932b3336 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_default_spec_update.rs @@ -0,0 +1,80 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetDefaultSpecUpdate { + #[serde(rename = "action")] + pub action: Action, + /// Partition spec ID to set as the default, or -1 to set last added spec + #[serde(rename = "spec-id")] + pub spec_id: i32, +} + +impl SetDefaultSpecUpdate { + pub fn new(action: Action, spec_id: i32) -> SetDefaultSpecUpdate { + SetDefaultSpecUpdate { action, spec_id } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_default_spec_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/set_default_spec_update_all_of.rs new file mode 100644 index 0000000000..d946c83f89 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_default_spec_update_all_of.rs @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetDefaultSpecUpdateAllOf { + /// Partition spec ID to set as the default, or -1 to set last added spec + #[serde(rename = "spec-id")] + pub spec_id: i32, +} + +impl SetDefaultSpecUpdateAllOf { + pub fn new(spec_id: i32) -> SetDefaultSpecUpdateAllOf { + SetDefaultSpecUpdateAllOf { spec_id } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_expression.rs b/crates/iceberg-rest-catalog-client/src/models/set_expression.rs new file mode 100644 index 0000000000..928d0360dd --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_expression.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetExpression { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "term")] + pub term: Box, + #[serde(rename = "values")] + pub values: Vec, +} + +impl SetExpression { + pub fn new( + r#type: String, + term: crate::models::Term, + values: Vec, + ) -> SetExpression { + SetExpression { + r#type, + term: Box::new(term), + values, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_location_update.rs b/crates/iceberg-rest-catalog-client/src/models/set_location_update.rs new file mode 100644 index 0000000000..5bc7532c91 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_location_update.rs @@ -0,0 +1,79 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetLocationUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "location")] + pub location: String, +} + +impl SetLocationUpdate { + pub fn new(action: Action, location: String) -> SetLocationUpdate { + SetLocationUpdate { action, location } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_location_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/set_location_update_all_of.rs new file mode 100644 index 0000000000..498011717e --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_location_update_all_of.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetLocationUpdateAllOf { + #[serde(rename = "location")] + pub location: String, +} + +impl SetLocationUpdateAllOf { + pub fn new(location: String) -> SetLocationUpdateAllOf { + SetLocationUpdateAllOf { location } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_properties_update.rs b/crates/iceberg-rest-catalog-client/src/models/set_properties_update.rs new file mode 100644 index 0000000000..6d4f448b09 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_properties_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetPropertiesUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "updates")] + pub updates: ::std::collections::HashMap, +} + +impl SetPropertiesUpdate { + pub fn new( + action: Action, + updates: ::std::collections::HashMap, + ) -> SetPropertiesUpdate { + SetPropertiesUpdate { action, updates } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_properties_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/set_properties_update_all_of.rs new file mode 100644 index 0000000000..54c44c0e34 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_properties_update_all_of.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetPropertiesUpdateAllOf { + #[serde(rename = "updates")] + pub updates: ::std::collections::HashMap, +} + +impl SetPropertiesUpdateAllOf { + pub fn new(updates: ::std::collections::HashMap) -> SetPropertiesUpdateAllOf { + SetPropertiesUpdateAllOf { updates } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_snapshot_ref_update.rs b/crates/iceberg-rest-catalog-client/src/models/set_snapshot_ref_update.rs new file mode 100644 index 0000000000..0e19088a79 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_snapshot_ref_update.rs @@ -0,0 +1,122 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetSnapshotRefUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "max-ref-age-ms", skip_serializing_if = "Option::is_none")] + pub max_ref_age_ms: Option, + #[serde( + rename = "max-snapshot-age-ms", + skip_serializing_if = "Option::is_none" + )] + pub max_snapshot_age_ms: Option, + #[serde( + rename = "min-snapshots-to-keep", + skip_serializing_if = "Option::is_none" + )] + pub min_snapshots_to_keep: Option, + #[serde(rename = "ref-name")] + pub ref_name: String, +} + +impl SetSnapshotRefUpdate { + pub fn new( + action: Action, + r#type: RHashType, + snapshot_id: i64, + ref_name: String, + ) -> SetSnapshotRefUpdate { + SetSnapshotRefUpdate { + action, + r#type, + snapshot_id, + max_ref_age_ms: None, + max_snapshot_age_ms: None, + min_snapshots_to_keep: None, + ref_name, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "tag")] + Tag, + #[serde(rename = "branch")] + Branch, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Tag + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/set_snapshot_ref_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/set_snapshot_ref_update_all_of.rs new file mode 100644 index 0000000000..b081092f6c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/set_snapshot_ref_update_all_of.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SetSnapshotRefUpdateAllOf { + #[serde(rename = "ref-name")] + pub ref_name: String, +} + +impl SetSnapshotRefUpdateAllOf { + pub fn new(ref_name: String) -> SetSnapshotRefUpdateAllOf { + SetSnapshotRefUpdateAllOf { ref_name } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/snapshot.rs b/crates/iceberg-rest-catalog-client/src/models/snapshot.rs new file mode 100644 index 0000000000..dfe79e0944 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/snapshot.rs @@ -0,0 +1,64 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Snapshot { + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "parent-snapshot-id", skip_serializing_if = "Option::is_none")] + pub parent_snapshot_id: Option, + #[serde(rename = "sequence-number", skip_serializing_if = "Option::is_none")] + pub sequence_number: Option, + #[serde(rename = "timestamp-ms")] + pub timestamp_ms: i64, + /// Location of the snapshot's manifest list file + #[serde(rename = "manifest-list")] + pub manifest_list: String, + #[serde(rename = "summary")] + pub summary: Box, + #[serde(rename = "schema-id", skip_serializing_if = "Option::is_none")] + pub schema_id: Option, +} + +impl Snapshot { + pub fn new( + snapshot_id: i64, + timestamp_ms: i64, + manifest_list: String, + summary: crate::models::SnapshotSummary, + ) -> Snapshot { + Snapshot { + snapshot_id, + parent_snapshot_id: None, + sequence_number: None, + timestamp_ms, + manifest_list, + summary: Box::new(summary), + schema_id: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/snapshot_log_inner.rs b/crates/iceberg-rest-catalog-client/src/models/snapshot_log_inner.rs new file mode 100644 index 0000000000..75b7269702 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/snapshot_log_inner.rs @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SnapshotLogInner { + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "timestamp-ms")] + pub timestamp_ms: i64, +} + +impl SnapshotLogInner { + pub fn new(snapshot_id: i64, timestamp_ms: i64) -> SnapshotLogInner { + SnapshotLogInner { + snapshot_id, + timestamp_ms, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/snapshot_reference.rs b/crates/iceberg-rest-catalog-client/src/models/snapshot_reference.rs new file mode 100644 index 0000000000..fe65e177be --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/snapshot_reference.rs @@ -0,0 +1,73 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SnapshotReference { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "max-ref-age-ms", skip_serializing_if = "Option::is_none")] + pub max_ref_age_ms: Option, + #[serde( + rename = "max-snapshot-age-ms", + skip_serializing_if = "Option::is_none" + )] + pub max_snapshot_age_ms: Option, + #[serde( + rename = "min-snapshots-to-keep", + skip_serializing_if = "Option::is_none" + )] + pub min_snapshots_to_keep: Option, +} + +impl SnapshotReference { + pub fn new(r#type: RHashType, snapshot_id: i64) -> SnapshotReference { + SnapshotReference { + r#type, + snapshot_id, + max_ref_age_ms: None, + max_snapshot_age_ms: None, + min_snapshots_to_keep: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "tag")] + Tag, + #[serde(rename = "branch")] + Branch, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Tag + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/snapshot_summary.rs b/crates/iceberg-rest-catalog-client/src/models/snapshot_summary.rs new file mode 100644 index 0000000000..b93c96597d --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/snapshot_summary.rs @@ -0,0 +1,65 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SnapshotSummary { + #[serde(rename = "operation")] + pub operation: Operation, + #[serde( + rename = "additionalProperties", + skip_serializing_if = "Option::is_none" + )] + pub additional_properties: Option, +} + +impl SnapshotSummary { + pub fn new(operation: Operation) -> SnapshotSummary { + SnapshotSummary { + operation, + additional_properties: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Operation { + #[serde(rename = "append")] + Append, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "overwrite")] + Overwrite, + #[serde(rename = "delete")] + Delete, +} + +impl Default for Operation { + fn default() -> Operation { + Self::Append + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/sort_direction.rs b/crates/iceberg-rest-catalog-client/src/models/sort_direction.rs new file mode 100644 index 0000000000..02eaaa8f59 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/sort_direction.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SortDirection { + #[serde(rename = "asc")] + Asc, + #[serde(rename = "desc")] + Desc, +} + +impl ToString for SortDirection { + fn to_string(&self) -> String { + match self { + Self::Asc => String::from("asc"), + Self::Desc => String::from("desc"), + } + } +} + +impl Default for SortDirection { + fn default() -> SortDirection { + Self::Asc + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/sort_field.rs b/crates/iceberg-rest-catalog-client/src/models/sort_field.rs new file mode 100644 index 0000000000..1810a67ed4 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/sort_field.rs @@ -0,0 +1,54 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SortField { + #[serde(rename = "source-id")] + pub source_id: i32, + #[serde(rename = "transform")] + pub transform: String, + #[serde(rename = "direction")] + pub direction: crate::models::SortDirection, + #[serde(rename = "null-order")] + pub null_order: crate::models::NullOrder, +} + +impl SortField { + pub fn new( + source_id: i32, + transform: String, + direction: crate::models::SortDirection, + null_order: crate::models::NullOrder, + ) -> SortField { + SortField { + source_id, + transform, + direction, + null_order, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/sort_order.rs b/crates/iceberg-rest-catalog-client/src/models/sort_order.rs new file mode 100644 index 0000000000..e26ec949ee --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/sort_order.rs @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SortOrder { + #[serde(rename = "order-id")] + pub order_id: i32, + #[serde(rename = "fields")] + pub fields: Vec, +} + +impl SortOrder { + pub fn new(order_id: i32, fields: Vec) -> SortOrder { + SortOrder { order_id, fields } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/struct_field.rs b/crates/iceberg-rest-catalog-client/src/models/struct_field.rs new file mode 100644 index 0000000000..375f821286 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/struct_field.rs @@ -0,0 +1,52 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct StructField { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "type")] + pub r#type: Box, + #[serde(rename = "required")] + pub required: bool, + #[serde(rename = "doc", skip_serializing_if = "Option::is_none")] + pub doc: Option, +} + +impl StructField { + pub fn new(id: i32, name: String, r#type: crate::models::Type, required: bool) -> StructField { + StructField { + id, + name, + r#type: Box::new(r#type), + required, + doc: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/struct_type.rs b/crates/iceberg-rest-catalog-client/src/models/struct_type.rs new file mode 100644 index 0000000000..51bcb67742 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/struct_type.rs @@ -0,0 +1,53 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct StructType { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "fields")] + pub fields: Vec, +} + +impl StructType { + pub fn new(r#type: RHashType, fields: Vec) -> StructType { + StructType { r#type, fields } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "struct")] + Struct, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Struct + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/table_identifier.rs b/crates/iceberg-rest-catalog-client/src/models/table_identifier.rs new file mode 100644 index 0000000000..8757883aaa --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/table_identifier.rs @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TableIdentifier { + /// Reference to one or more levels of a namespace + #[serde(rename = "namespace")] + pub namespace: Vec, + #[serde(rename = "name")] + pub name: String, +} + +impl TableIdentifier { + pub fn new(namespace: Vec, name: String) -> TableIdentifier { + TableIdentifier { namespace, name } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/table_metadata.rs b/crates/iceberg-rest-catalog-client/src/models/table_metadata.rs new file mode 100644 index 0000000000..cae80144d0 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/table_metadata.rs @@ -0,0 +1,97 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TableMetadata { + #[serde(rename = "format-version")] + pub format_version: i32, + #[serde(rename = "table-uuid")] + pub table_uuid: String, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "last-updated-ms", skip_serializing_if = "Option::is_none")] + pub last_updated_ms: Option, + #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] + pub properties: Option<::std::collections::HashMap>, + #[serde(rename = "schemas", skip_serializing_if = "Option::is_none")] + pub schemas: Option>, + #[serde(rename = "current-schema-id", skip_serializing_if = "Option::is_none")] + pub current_schema_id: Option, + #[serde(rename = "last-column-id", skip_serializing_if = "Option::is_none")] + pub last_column_id: Option, + #[serde(rename = "partition-specs", skip_serializing_if = "Option::is_none")] + pub partition_specs: Option>, + #[serde(rename = "default-spec-id", skip_serializing_if = "Option::is_none")] + pub default_spec_id: Option, + #[serde(rename = "last-partition-id", skip_serializing_if = "Option::is_none")] + pub last_partition_id: Option, + #[serde(rename = "sort-orders", skip_serializing_if = "Option::is_none")] + pub sort_orders: Option>, + #[serde( + rename = "default-sort-order-id", + skip_serializing_if = "Option::is_none" + )] + pub default_sort_order_id: Option, + #[serde(rename = "snapshots", skip_serializing_if = "Option::is_none")] + pub snapshots: Option>, + #[serde(rename = "refs", skip_serializing_if = "Option::is_none")] + pub refs: Option<::std::collections::HashMap>, + #[serde( + rename = "current-snapshot-id", + skip_serializing_if = "Option::is_none" + )] + pub current_snapshot_id: Option, + #[serde(rename = "snapshot-log", skip_serializing_if = "Option::is_none")] + pub snapshot_log: Option>, + #[serde(rename = "metadata-log", skip_serializing_if = "Option::is_none")] + pub metadata_log: Option>, +} + +impl TableMetadata { + pub fn new(format_version: i32, table_uuid: String) -> TableMetadata { + TableMetadata { + format_version, + table_uuid, + location: None, + last_updated_ms: None, + properties: None, + schemas: None, + current_schema_id: None, + last_column_id: None, + partition_specs: None, + default_spec_id: None, + last_partition_id: None, + sort_orders: None, + default_sort_order_id: None, + snapshots: None, + refs: None, + current_snapshot_id: None, + snapshot_log: None, + metadata_log: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/table_requirement.rs b/crates/iceberg-rest-catalog-client/src/models/table_requirement.rs new file mode 100644 index 0000000000..ff7a07505c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/table_requirement.rs @@ -0,0 +1,103 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// TableRequirement : Assertions from the client that must be valid for the commit to succeed. Assertions are identified by `type` - - `assert-create` - the table must not already exist; used for create transactions - `assert-table-uuid` - the table UUID must match the requirement's `uuid` - `assert-ref-snapshot-id` - the table branch or tag identified by the requirement's `ref` must reference the requirement's `snapshot-id`; if `snapshot-id` is `null` or missing, the ref must not already exist - `assert-last-assigned-field-id` - the table's last assigned column id must match the requirement's `last-assigned-field-id` - `assert-current-schema-id` - the table's current schema id must match the requirement's `current-schema-id` - `assert-last-assigned-partition-id` - the table's last assigned partition id must match the requirement's `last-assigned-partition-id` - `assert-default-spec-id` - the table's default spec id must match the requirement's `default-spec-id` - `assert-default-sort-order-id` - the table's default sort order id must match the requirement's `default-sort-order-id` + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TableRequirement { + #[serde(rename = "requirement")] + pub requirement: Requirement, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[serde(rename = "snapshot-id", skip_serializing_if = "Option::is_none")] + pub snapshot_id: Option, + #[serde( + rename = "last-assigned-field-id", + skip_serializing_if = "Option::is_none" + )] + pub last_assigned_field_id: Option, + #[serde(rename = "current-schema-id", skip_serializing_if = "Option::is_none")] + pub current_schema_id: Option, + #[serde( + rename = "last-assigned-partition-id", + skip_serializing_if = "Option::is_none" + )] + pub last_assigned_partition_id: Option, + #[serde(rename = "default-spec-id", skip_serializing_if = "Option::is_none")] + pub default_spec_id: Option, + #[serde( + rename = "default-sort-order-id", + skip_serializing_if = "Option::is_none" + )] + pub default_sort_order_id: Option, +} + +impl TableRequirement { + /// Assertions from the client that must be valid for the commit to succeed. Assertions are identified by `type` - - `assert-create` - the table must not already exist; used for create transactions - `assert-table-uuid` - the table UUID must match the requirement's `uuid` - `assert-ref-snapshot-id` - the table branch or tag identified by the requirement's `ref` must reference the requirement's `snapshot-id`; if `snapshot-id` is `null` or missing, the ref must not already exist - `assert-last-assigned-field-id` - the table's last assigned column id must match the requirement's `last-assigned-field-id` - `assert-current-schema-id` - the table's current schema id must match the requirement's `current-schema-id` - `assert-last-assigned-partition-id` - the table's last assigned partition id must match the requirement's `last-assigned-partition-id` - `assert-default-spec-id` - the table's default spec id must match the requirement's `default-spec-id` - `assert-default-sort-order-id` - the table's default sort order id must match the requirement's `default-sort-order-id` + pub fn new(requirement: Requirement) -> TableRequirement { + TableRequirement { + requirement, + r#ref: None, + uuid: None, + snapshot_id: None, + last_assigned_field_id: None, + current_schema_id: None, + last_assigned_partition_id: None, + default_spec_id: None, + default_sort_order_id: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Requirement { + #[serde(rename = "assert-create")] + Create, + #[serde(rename = "assert-table-uuid")] + TableUuid, + #[serde(rename = "assert-ref-snapshot-id")] + RefSnapshotId, + #[serde(rename = "assert-last-assigned-field-id")] + LastAssignedFieldId, + #[serde(rename = "assert-current-schema-id")] + CurrentSchemaId, + #[serde(rename = "assert-last-assigned-partition-id")] + LastAssignedPartitionId, + #[serde(rename = "assert-default-spec-id")] + DefaultSpecId, + #[serde(rename = "assert-default-sort-order-id")] + DefaultSortOrderId, +} + +impl Default for Requirement { + fn default() -> Requirement { + Self::Create + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/table_update.rs b/crates/iceberg-rest-catalog-client/src/models/table_update.rs new file mode 100644 index 0000000000..89cafb6828 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/table_update.rs @@ -0,0 +1,173 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TableUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "format-version")] + pub format_version: i32, + #[serde(rename = "schema")] + pub schema: Box, + /// Schema ID to set as current, or -1 to set last added schema + #[serde(rename = "schema-id")] + pub schema_id: i32, + #[serde(rename = "spec")] + pub spec: Box, + /// Partition spec ID to set as the default, or -1 to set last added spec + #[serde(rename = "spec-id")] + pub spec_id: i32, + #[serde(rename = "sort-order")] + pub sort_order: Box, + /// Sort order ID to set as the default, or -1 to set last added sort order + #[serde(rename = "sort-order-id")] + pub sort_order_id: i32, + #[serde(rename = "snapshot")] + pub snapshot: Box, + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "snapshot-id")] + pub snapshot_id: i64, + #[serde(rename = "max-ref-age-ms", skip_serializing_if = "Option::is_none")] + pub max_ref_age_ms: Option, + #[serde( + rename = "max-snapshot-age-ms", + skip_serializing_if = "Option::is_none" + )] + pub max_snapshot_age_ms: Option, + #[serde( + rename = "min-snapshots-to-keep", + skip_serializing_if = "Option::is_none" + )] + pub min_snapshots_to_keep: Option, + #[serde(rename = "ref-name")] + pub ref_name: String, + #[serde(rename = "snapshot-ids")] + pub snapshot_ids: Vec, + #[serde(rename = "location")] + pub location: String, + #[serde(rename = "updates")] + pub updates: ::std::collections::HashMap, + #[serde(rename = "removals")] + pub removals: Vec, +} + +impl TableUpdate { + pub fn new( + action: Action, + format_version: i32, + schema: crate::models::Schema, + schema_id: i32, + spec: crate::models::PartitionSpec, + spec_id: i32, + sort_order: crate::models::SortOrder, + sort_order_id: i32, + snapshot: crate::models::Snapshot, + r#type: RHashType, + snapshot_id: i64, + ref_name: String, + snapshot_ids: Vec, + location: String, + updates: ::std::collections::HashMap, + removals: Vec, + ) -> TableUpdate { + TableUpdate { + action, + format_version, + schema: Box::new(schema), + schema_id, + spec: Box::new(spec), + spec_id, + sort_order: Box::new(sort_order), + sort_order_id, + snapshot: Box::new(snapshot), + r#type, + snapshot_id, + max_ref_age_ms: None, + max_snapshot_age_ms: None, + min_snapshots_to_keep: None, + ref_name, + snapshot_ids, + location, + updates, + removals, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "tag")] + Tag, + #[serde(rename = "branch")] + Branch, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Tag + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/term.rs b/crates/iceberg-rest-catalog-client/src/models/term.rs new file mode 100644 index 0000000000..e8986f13f1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/term.rs @@ -0,0 +1,59 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Term { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "transform")] + pub transform: String, + #[serde(rename = "term")] + pub term: String, +} + +impl Term { + pub fn new(r#type: RHashType, transform: String, term: String) -> Term { + Term { + r#type, + transform, + term, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "transform")] + Transform, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Transform + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/timer_result.rs b/crates/iceberg-rest-catalog-client/src/models/timer_result.rs new file mode 100644 index 0000000000..73ef3d6ae1 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/timer_result.rs @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TimerResult { + #[serde(rename = "time-unit")] + pub time_unit: String, + #[serde(rename = "count")] + pub count: i64, + #[serde(rename = "total-duration")] + pub total_duration: i64, +} + +impl TimerResult { + pub fn new(time_unit: String, count: i64, total_duration: i64) -> TimerResult { + TimerResult { + time_unit, + count, + total_duration, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/token_type.rs b/crates/iceberg-rest-catalog-client/src/models/token_type.rs new file mode 100644 index 0000000000..fad457aef6 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/token_type.rs @@ -0,0 +1,64 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +/// TokenType : Token type identifier, from RFC 8693 Section 3 See https://datatracker.ietf.org/doc/html/rfc8693#section-3 + +/// Token type identifier, from RFC 8693 Section 3 See https://datatracker.ietf.org/doc/html/rfc8693#section-3 +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TokenType { + #[serde(rename = "urn:ietf:params:oauth:token-type:access_token")] + AccessToken, + #[serde(rename = "urn:ietf:params:oauth:token-type:refresh_token")] + RefreshToken, + #[serde(rename = "urn:ietf:params:oauth:token-type:id_token")] + IdToken, + #[serde(rename = "urn:ietf:params:oauth:token-type:saml1")] + Saml1, + #[serde(rename = "urn:ietf:params:oauth:token-type:saml2")] + Saml2, + #[serde(rename = "urn:ietf:params:oauth:token-type:jwt")] + Jwt, +} + +impl ToString for TokenType { + fn to_string(&self) -> String { + match self { + Self::AccessToken => String::from("urn:ietf:params:oauth:token-type:access_token"), + Self::RefreshToken => String::from("urn:ietf:params:oauth:token-type:refresh_token"), + Self::IdToken => String::from("urn:ietf:params:oauth:token-type:id_token"), + Self::Saml1 => String::from("urn:ietf:params:oauth:token-type:saml1"), + Self::Saml2 => String::from("urn:ietf:params:oauth:token-type:saml2"), + Self::Jwt => String::from("urn:ietf:params:oauth:token-type:jwt"), + } + } +} + +impl Default for TokenType { + fn default() -> TokenType { + Self::AccessToken + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/transform_term.rs b/crates/iceberg-rest-catalog-client/src/models/transform_term.rs new file mode 100644 index 0000000000..2235d4a8c9 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/transform_term.rs @@ -0,0 +1,59 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TransformTerm { + #[serde(rename = "type")] + pub r#type: RHashType, + #[serde(rename = "transform")] + pub transform: String, + #[serde(rename = "term")] + pub term: String, +} + +impl TransformTerm { + pub fn new(r#type: RHashType, transform: String, term: String) -> TransformTerm { + TransformTerm { + r#type, + transform, + term, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "transform")] + Transform, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Transform + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/unary_expression.rs b/crates/iceberg-rest-catalog-client/src/models/unary_expression.rs new file mode 100644 index 0000000000..f9a79250a7 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/unary_expression.rs @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UnaryExpression { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "term")] + pub term: Box, + #[serde(rename = "value")] + pub value: serde_json::Value, +} + +impl UnaryExpression { + pub fn new( + r#type: String, + term: crate::models::Term, + value: serde_json::Value, + ) -> UnaryExpression { + UnaryExpression { + r#type, + term: Box::new(term), + value, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/update_namespace_properties_request.rs b/crates/iceberg-rest-catalog-client/src/models/update_namespace_properties_request.rs new file mode 100644 index 0000000000..d3e58b3d0c --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/update_namespace_properties_request.rs @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateNamespacePropertiesRequest { + #[serde(rename = "removals", skip_serializing_if = "Option::is_none")] + pub removals: Option>, + #[serde(rename = "updates", skip_serializing_if = "Option::is_none")] + pub updates: Option<::std::collections::HashMap>, +} + +impl UpdateNamespacePropertiesRequest { + pub fn new() -> UpdateNamespacePropertiesRequest { + UpdateNamespacePropertiesRequest { + removals: None, + updates: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/update_namespace_properties_response.rs b/crates/iceberg-rest-catalog-client/src/models/update_namespace_properties_response.rs new file mode 100644 index 0000000000..30ee8a1ac6 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/update_namespace_properties_response.rs @@ -0,0 +1,54 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateNamespacePropertiesResponse { + /// List of property keys that were added or updated + #[serde(rename = "updated")] + pub updated: Vec, + /// List of properties that were removed + #[serde(rename = "removed")] + pub removed: Vec, + /// List of properties requested for removal that were not found in the namespace's properties. Represents a partial success response. Server's do not need to implement this. + #[serde( + rename = "missing", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub missing: Option>>, +} + +impl UpdateNamespacePropertiesResponse { + pub fn new(updated: Vec, removed: Vec) -> UpdateNamespacePropertiesResponse { + UpdateNamespacePropertiesResponse { + updated, + removed, + missing: None, + } + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/upgrade_format_version_update.rs b/crates/iceberg-rest-catalog-client/src/models/upgrade_format_version_update.rs new file mode 100644 index 0000000000..a9834797db --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/upgrade_format_version_update.rs @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpgradeFormatVersionUpdate { + #[serde(rename = "action")] + pub action: Action, + #[serde(rename = "format-version")] + pub format_version: i32, +} + +impl UpgradeFormatVersionUpdate { + pub fn new(action: Action, format_version: i32) -> UpgradeFormatVersionUpdate { + UpgradeFormatVersionUpdate { + action, + format_version, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Action { + #[serde(rename = "upgrade-format-version")] + UpgradeFormatVersion, + #[serde(rename = "add-schema")] + AddSchema, + #[serde(rename = "set-current-schema")] + SetCurrentSchema, + #[serde(rename = "add-spec")] + AddSpec, + #[serde(rename = "set-default-spec")] + SetDefaultSpec, + #[serde(rename = "add-sort-order")] + AddSortOrder, + #[serde(rename = "set-default-sort-order")] + SetDefaultSortOrder, + #[serde(rename = "add-snapshot")] + AddSnapshot, + #[serde(rename = "set-snapshot-ref")] + SetSnapshotRef, + #[serde(rename = "remove-snapshots")] + RemoveSnapshots, + #[serde(rename = "remove-snapshot-ref")] + RemoveSnapshotRef, + #[serde(rename = "set-location")] + SetLocation, + #[serde(rename = "set-properties")] + SetProperties, + #[serde(rename = "remove-properties")] + RemoveProperties, +} + +impl Default for Action { + fn default() -> Action { + Self::UpgradeFormatVersion + } +} diff --git a/crates/iceberg-rest-catalog-client/src/models/upgrade_format_version_update_all_of.rs b/crates/iceberg-rest-catalog-client/src/models/upgrade_format_version_update_all_of.rs new file mode 100644 index 0000000000..be4371fc10 --- /dev/null +++ b/crates/iceberg-rest-catalog-client/src/models/upgrade_format_version_update_all_of.rs @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +/* + * Apache Iceberg REST Catalog API + * + * Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpgradeFormatVersionUpdateAllOf { + #[serde(rename = "format-version")] + pub format_version: i32, +} + +impl UpgradeFormatVersionUpdateAllOf { + pub fn new(format_version: i32) -> UpgradeFormatVersionUpdateAllOf { + UpgradeFormatVersionUpdateAllOf { format_version } + } +}