From de72eb594ec6e105f24afad88441aa6a66dcbc0a Mon Sep 17 00:00:00 2001 From: Ally Heev Date: Sun, 21 Jun 2026 16:51:52 +0530 Subject: [PATCH 1/2] add C/C++ SDK --- .bumpversion.toml | 12 +- .github/labeler.yml | 3 + .github/workflows/cpp-publish.yml | 122 + .github/workflows/cpp.yml | 79 + CONTRIBUTING.md | 10 +- Makefile | 18 +- README.md | 1 + cpp/Makefile | 71 + cpp/README.md | 59 + cpp/lance_namespace/CMakeLists.txt | 34 + .../include/lance_namespace/errors.h | 130 + .../include/lance_namespace/errors.hpp | 250 + .../include/lance_namespace/lance_namespace.h | 138 + .../lance_namespace/lance_namespace.hpp | 180 + .../lance_namespace_rest_client.hpp | 7 + .../include/lance_namespace/models.h | 828 ++ .../lance_namespace/namespace_operations.hpp | 1107 +++ .../include/lance_namespace/operations.h | 941 +++ .../include/lance_namespace/version.h | 6 + .../lance_namespace_rest_client_wrapper.hpp | 29 + cpp/lance_namespace/src/lance_namespace.cpp | 401 + cpp/lance_namespace/src/operations.cpp | 667 ++ cpp/lance_namespace/tests/smoke.cpp | 140 + .../CMakeLists.txt | 105 + .../Config.cmake.in | 5 + cpp/lance_namespace_rest_client/README.md | 60 + .../lance_namespace_rest_client/AnyType.h | 58 + .../lance_namespace_rest_client/ApiClient.h | 114 + .../ApiConfiguration.h | 66 + .../ApiException.h | 60 + .../lance_namespace_rest_client/HttpContent.h | 69 + .../lance_namespace_rest_client/IHttpBody.h | 42 + .../lance_namespace_rest_client/JsonBody.h | 49 + .../lance_namespace_rest_client/ModelBase.h | 505 ++ .../MultipartFormData.h | 61 + .../lance_namespace_rest_client/Object.h | 62 + .../api/BranchApi.h | 106 + .../lance_namespace_rest_client/api/DataApi.h | 287 + .../api/IndexApi.h | 139 + .../api/MaterializedViewApi.h | 89 + .../api/MetadataApi.h | 708 ++ .../api/NamespaceApi.h | 156 + .../api/TableApi.h | 810 ++ .../lance_namespace_rest_client/api/TagApi.h | 138 + .../api/TransactionApi.h | 103 + .../model/AddColumnsEntry.h | 98 + .../model/AddVirtualColumnEntry.h | 191 + .../model/AddVirtualColumnOutputEntry.h | 123 + .../model/AlterColumnsEntry.h | 121 + .../model/AlterTableAddColumnsRequest.h | 112 + .../model/AlterTableAddColumnsResponse.h | 76 + .../model/AlterTableAlterColumnsRequest.h | 112 + .../model/AlterTableAlterColumnsResponse.h | 76 + .../model/AlterTableBackfillColumnsRequest.h | 253 + .../model/AlterTableBackfillColumnsResponse.h | 77 + .../model/AlterTableDropColumnsRequest.h | 119 + .../model/AlterTableDropColumnsResponse.h | 88 + .../model/AlterTransactionAction.h | 98 + .../model/AlterTransactionRequest.h | 110 + .../model/AlterTransactionResponse.h | 86 + .../model/AlterTransactionSetProperty.h | 93 + .../model/AlterTransactionSetStatus.h | 77 + .../model/AlterTransactionUnsetProperty.h | 85 + .../model/AlterVirtualColumnEntry.h | 178 + .../model/AnalyzeTableQueryPlanRequest.h | 303 + .../model/AnalyzeTableQueryPlanResponse.h | 77 + .../model/BatchCommitTablesRequest.h | 105 + .../model/BatchCommitTablesResponse.h | 94 + .../model/BatchCreateTableVersionsRequest.h | 105 + .../model/BatchCreateTableVersionsResponse.h | 94 + .../model/BatchDeleteTableVersionsRequest.h | 127 + .../model/BatchDeleteTableVersionsResponse.h | 91 + .../model/BooleanQuery.h | 104 + .../model/BoostQuery.h | 97 + .../model/BranchContents.h | 122 + .../model/CommitTableOperation.h | 120 + .../model/CommitTableResult.h | 120 + .../model/CountTableRowsRequest.h | 130 + .../model/CreateMaterializedViewRequest.h | 168 + .../model/CreateMaterializedViewResponse.h | 88 + .../model/CreateNamespaceRequest.h | 119 + .../model/CreateNamespaceResponse.h | 89 + .../model/CreateTableBranchRequest.h | 130 + .../model/CreateTableBranchResponse.h | 80 + .../model/CreateTableIndexRequest.h | 240 + .../model/CreateTableIndexResponse.h | 80 + .../model/CreateTableRequest.h | 133 + .../model/CreateTableResponse.h | 116 + .../model/CreateTableScalarIndexResponse.h | 80 + .../model/CreateTableTagRequest.h | 130 + .../model/CreateTableTagResponse.h | 80 + .../model/CreateTableVersionEntry.h | 159 + .../model/CreateTableVersionRequest.h | 180 + .../model/CreateTableVersionResponse.h | 90 + .../model/DeclareTableRequest.h | 133 + .../model/DeclareTableResponse.h | 122 + .../model/DeleteFromTableRequest.h | 125 + .../model/DeleteFromTableResponse.h | 88 + .../model/DeleteTableBranchRequest.h | 108 + .../model/DeleteTableBranchResponse.h | 80 + .../model/DeleteTableTagRequest.h | 108 + .../model/DeleteTableTagResponse.h | 80 + .../model/DeregisterTableRequest.h | 100 + .../model/DeregisterTableResponse.h | 106 + .../model/DescribeNamespaceRequest.h | 97 + .../model/DescribeNamespaceResponse.h | 78 + .../model/DescribeTableIndexStatsRequest.h | 130 + .../model/DescribeTableIndexStatsResponse.h | 121 + .../model/DescribeTableRequest.h | 163 + .../model/DescribeTableResponse.h | 204 + .../model/DescribeTableVersionRequest.h | 125 + .../model/DescribeTableVersionResponse.h | 81 + .../model/DescribeTransactionRequest.h | 97 + .../model/DescribeTransactionResponse.h | 86 + .../model/DropNamespaceRequest.h | 119 + .../model/DropNamespaceResponse.h | 90 + .../model/DropTableIndexRequest.h | 119 + .../model/DropTableIndexResponse.h | 80 + .../model/DropTableRequest.h | 100 + .../model/DropTableResponse.h | 106 + .../model/ErrorResponse.h | 113 + .../model/ExplainTableQueryPlanRequest.h | 129 + .../model/ExplainTableQueryPlanResponse.h | 77 + .../model/FragmentStats.h | 100 + .../model/FragmentSummary.h | 121 + .../model/FtsQuery.h | 118 + .../model/GetTableStatsRequest.h | 108 + .../model/GetTableStatsResponse.h | 111 + .../model/GetTableTagVersionRequest.h | 108 + .../model/GetTableTagVersionResponse.h | 88 + .../model/Identity.h | 91 + .../model/IndexContent.h | 210 + .../model/InsertIntoTableRequest.h | 122 + .../model/InsertIntoTableResponse.h | 80 + .../model/JsonArrowDataType.h | 105 + .../model/JsonArrowField.h | 104 + .../model/JsonArrowSchema.h | 89 + .../model/ListNamespacesRequest.h | 119 + .../model/ListNamespacesResponse.h | 89 + .../model/ListTableBranchesRequest.h | 122 + .../model/ListTableBranchesResponse.h | 94 + .../model/ListTableIndicesRequest.h | 144 + .../model/ListTableIndicesResponse.h | 91 + .../model/ListTableTagsRequest.h | 122 + .../model/ListTableTagsResponse.h | 94 + .../model/ListTableVersionsRequest.h | 141 + .../model/ListTableVersionsResponse.h | 91 + .../model/ListTablesRequest.h | 130 + .../model/ListTablesResponse.h | 89 + .../model/MatchQuery.h | 134 + .../model/MaterializedViewUdtfEntry.h | 241 + .../model/MergeInsertIntoTableRequest.h | 199 + .../model/MergeInsertIntoTableResponse.h | 124 + .../model/MultiMatchQuery.h | 76 + .../model/NamespaceExistsRequest.h | 97 + .../model/PartitionField.h | 129 + .../model/PartitionSpec.h | 93 + .../model/PartitionTransform.h | 102 + .../model/PhraseQuery.h | 93 + .../model/QueryTableRequest.h | 303 + .../model/QueryTableRequest_columns.h | 93 + .../model/QueryTableRequest_full_text_query.h | 88 + .../model/QueryTableRequest_vector.h | 91 + .../model/RefreshMaterializedViewRequest.h | 176 + .../model/RefreshMaterializedViewResponse.h | 77 + .../model/RegisterTableRequest.h | 127 + .../model/RegisterTableResponse.h | 97 + .../model/RenameTableRequest.h | 122 + .../model/RenameTableResponse.h | 77 + .../model/RestoreTableRequest.h | 119 + .../model/RestoreTableResponse.h | 80 + .../model/StringFtsQuery.h | 86 + .../model/StructuredFtsQuery.h | 75 + .../model/TableBasicStats.h | 87 + .../model/TableExistsRequest.h | 108 + .../model/TableVersion.h | 133 + .../model/TagContents.h | 99 + .../model/UpdateFieldMetadataEntry.h | 100 + .../model/UpdateFieldMetadataRequest.h | 112 + .../model/UpdateFieldMetadataResponse.h | 89 + .../model/UpdateTableRequest.h | 144 + .../model/UpdateTableResponse.h | 111 + .../model/UpdateTableSchemaMetadataRequest.h | 122 + .../model/UpdateTableSchemaMetadataResponse.h | 89 + .../model/UpdateTableTagRequest.h | 130 + .../model/UpdateTableTagResponse.h | 80 + .../model/VersionRange.h | 90 + .../src/AnyType.cpp | 52 + .../src/ApiClient.cpp | 208 + .../src/ApiConfiguration.cpp | 85 + .../src/ApiException.cpp | 53 + .../src/HttpContent.cpp | 86 + .../src/JsonBody.cpp | 36 + .../src/ModelBase.cpp | 665 ++ .../src/MultipartFormData.cpp | 112 + .../src/Object.cpp | 91 + .../src/api/BranchApi.cpp | 511 ++ .../src/api/DataApi.cpp | 2157 +++++ .../src/api/IndexApi.cpp | 831 ++ .../src/api/MaterializedViewApi.cpp | 359 + .../src/api/MetadataApi.cpp | 6362 +++++++++++++++ .../src/api/NamespaceApi.cpp | 965 +++ .../src/api/TableApi.cpp | 7215 +++++++++++++++++ .../src/api/TagApi.cpp | 833 ++ .../src/api/TransactionApi.cpp | 525 ++ .../src/model/AddColumnsEntry.cpp | 221 + .../src/model/AddVirtualColumnEntry.cpp | 610 ++ .../src/model/AddVirtualColumnOutputEntry.cpp | 317 + .../src/model/AlterColumnsEntry.cpp | 317 + .../src/model/AlterTableAddColumnsRequest.cpp | 268 + .../model/AlterTableAddColumnsResponse.cpp | 123 + .../model/AlterTableAlterColumnsRequest.cpp | 268 + .../model/AlterTableAlterColumnsResponse.cpp | 123 + .../AlterTableBackfillColumnsRequest.cpp | 896 ++ .../AlterTableBackfillColumnsResponse.cpp | 124 + .../model/AlterTableDropColumnsRequest.cpp | 316 + .../model/AlterTableDropColumnsResponse.cpp | 172 + .../src/model/AlterTransactionAction.cpp | 219 + .../src/model/AlterTransactionRequest.cpp | 267 + .../src/model/AlterTransactionResponse.cpp | 172 + .../src/model/AlterTransactionSetProperty.cpp | 222 + .../src/model/AlterTransactionSetStatus.cpp | 124 + .../model/AlterTransactionUnsetProperty.cpp | 173 + .../src/model/AlterVirtualColumnEntry.cpp | 562 ++ .../model/AnalyzeTableQueryPlanRequest.cpp | 1135 +++ .../model/AnalyzeTableQueryPlanResponse.cpp | 124 + .../src/model/BatchCommitTablesRequest.cpp | 219 + .../src/model/BatchCommitTablesResponse.cpp | 172 + .../model/BatchCreateTableVersionsRequest.cpp | 219 + .../BatchCreateTableVersionsResponse.cpp | 172 + .../model/BatchDeleteTableVersionsRequest.cpp | 316 + .../BatchDeleteTableVersionsResponse.cpp | 172 + .../src/model/BooleanQuery.cpp | 219 + .../src/model/BoostQuery.cpp | 219 + .../src/model/BranchContents.cpp | 316 + .../src/model/CommitTableOperation.cpp | 267 + .../src/model/CommitTableResult.cpp | 267 + .../src/model/CountTableRowsRequest.cpp | 365 + .../model/CreateMaterializedViewRequest.cpp | 497 ++ .../model/CreateMaterializedViewResponse.cpp | 172 + .../src/model/CreateNamespaceRequest.cpp | 316 + .../src/model/CreateNamespaceResponse.cpp | 172 + .../src/model/CreateTableBranchRequest.cpp | 365 + .../src/model/CreateTableBranchResponse.cpp | 124 + .../src/model/CreateTableIndexRequest.cpp | 850 ++ .../src/model/CreateTableIndexResponse.cpp | 124 + .../src/model/CreateTableRequest.cpp | 364 + .../src/model/CreateTableResponse.cpp | 317 + .../model/CreateTableScalarIndexResponse.cpp | 124 + .../src/model/CreateTableTagRequest.cpp | 365 + .../src/model/CreateTableTagResponse.cpp | 124 + .../src/model/CreateTableVersionEntry.cpp | 463 ++ .../src/model/CreateTableVersionRequest.cpp | 559 ++ .../src/model/CreateTableVersionResponse.cpp | 172 + .../src/model/DeclareTableRequest.cpp | 364 + .../src/model/DeclareTableResponse.cpp | 317 + .../src/model/DeleteFromTableRequest.cpp | 317 + .../src/model/DeleteFromTableResponse.cpp | 172 + .../src/model/DeleteTableBranchRequest.cpp | 268 + .../src/model/DeleteTableBranchResponse.cpp | 124 + .../src/model/DeleteTableTagRequest.cpp | 268 + .../src/model/DeleteTableTagResponse.cpp | 124 + .../src/model/DeregisterTableRequest.cpp | 219 + .../src/model/DeregisterTableResponse.cpp | 269 + .../src/model/DescribeNamespaceRequest.cpp | 219 + .../src/model/DescribeNamespaceResponse.cpp | 123 + .../model/DescribeTableIndexStatsRequest.cpp | 365 + .../model/DescribeTableIndexStatsResponse.cpp | 317 + .../src/model/DescribeTableRequest.cpp | 508 ++ .../src/model/DescribeTableResponse.cpp | 654 ++ .../src/model/DescribeTableVersionRequest.cpp | 316 + .../model/DescribeTableVersionResponse.cpp | 123 + .../src/model/DescribeTransactionRequest.cpp | 219 + .../src/model/DescribeTransactionResponse.cpp | 172 + .../src/model/DropNamespaceRequest.cpp | 317 + .../src/model/DropNamespaceResponse.cpp | 171 + .../src/model/DropTableIndexRequest.cpp | 317 + .../src/model/DropTableIndexResponse.cpp | 124 + .../src/model/DropTableRequest.cpp | 219 + .../src/model/DropTableResponse.cpp | 269 + .../src/model/ErrorResponse.cpp | 270 + .../model/ExplainTableQueryPlanRequest.cpp | 364 + .../model/ExplainTableQueryPlanResponse.cpp | 124 + .../src/model/FragmentStats.cpp | 219 + .../src/model/FragmentSummary.cpp | 411 + .../src/model/FtsQuery.cpp | 315 + .../src/model/GetTableStatsRequest.cpp | 268 + .../src/model/GetTableStatsResponse.cpp | 267 + .../src/model/GetTableTagVersionRequest.cpp | 268 + .../src/model/GetTableTagVersionResponse.cpp | 172 + .../src/model/Identity.cpp | 173 + .../src/model/IndexContent.cpp | 706 ++ .../src/model/InsertIntoTableRequest.cpp | 317 + .../src/model/InsertIntoTableResponse.cpp | 124 + .../src/model/JsonArrowDataType.cpp | 220 + .../src/model/JsonArrowField.cpp | 268 + .../src/model/JsonArrowSchema.cpp | 171 + .../src/model/ListNamespacesRequest.cpp | 316 + .../src/model/ListNamespacesResponse.cpp | 172 + .../src/model/ListTableBranchesRequest.cpp | 316 + .../src/model/ListTableBranchesResponse.cpp | 172 + .../src/model/ListTableIndicesRequest.cpp | 413 + .../src/model/ListTableIndicesResponse.cpp | 172 + .../src/model/ListTableTagsRequest.cpp | 316 + .../src/model/ListTableTagsResponse.cpp | 172 + .../src/model/ListTableVersionsRequest.cpp | 413 + .../src/model/ListTableVersionsResponse.cpp | 172 + .../src/model/ListTablesRequest.cpp | 364 + .../src/model/ListTablesResponse.cpp | 172 + .../src/model/MatchQuery.cpp | 414 + .../src/model/MaterializedViewUdtfEntry.cpp | 833 ++ .../src/model/MergeInsertIntoTableRequest.cpp | 656 ++ .../model/MergeInsertIntoTableResponse.cpp | 316 + .../src/model/MultiMatchQuery.cpp | 123 + .../src/model/NamespaceExistsRequest.cpp | 219 + .../src/model/PartitionField.cpp | 316 + .../src/model/PartitionSpec.cpp | 171 + .../src/model/PartitionTransform.cpp | 220 + .../src/model/PhraseQuery.cpp | 221 + .../src/model/QueryTableRequest.cpp | 1135 +++ .../src/model/QueryTableRequest_columns.cpp | 171 + .../QueryTableRequest_full_text_query.cpp | 171 + .../src/model/QueryTableRequest_vector.cpp | 170 + .../model/RefreshMaterializedViewRequest.cpp | 557 ++ .../model/RefreshMaterializedViewResponse.cpp | 124 + .../src/model/RegisterTableRequest.cpp | 365 + .../src/model/RegisterTableResponse.cpp | 221 + .../src/model/RenameTableRequest.cpp | 316 + .../src/model/RenameTableResponse.cpp | 124 + .../src/model/RestoreTableRequest.cpp | 316 + .../src/model/RestoreTableResponse.cpp | 124 + .../src/model/StringFtsQuery.cpp | 172 + .../src/model/StructuredFtsQuery.cpp | 123 + .../src/model/TableBasicStats.cpp | 171 + .../src/model/TableExistsRequest.cpp | 267 + .../src/model/TableVersion.cpp | 365 + .../src/model/TagContents.cpp | 220 + .../src/model/UpdateFieldMetadataEntry.cpp | 220 + .../src/model/UpdateFieldMetadataRequest.cpp | 268 + .../src/model/UpdateFieldMetadataResponse.cpp | 171 + .../src/model/UpdateTableRequest.cpp | 413 + .../src/model/UpdateTableResponse.cpp | 268 + .../UpdateTableSchemaMetadataRequest.cpp | 316 + .../UpdateTableSchemaMetadataResponse.cpp | 172 + .../src/model/UpdateTableTagRequest.cpp | 365 + .../src/model/UpdateTableTagResponse.cpp | 124 + .../src/model/VersionRange.cpp | 171 + cpp/package_release.py | 38 + 348 files changed, 87039 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/cpp-publish.yml create mode 100644 .github/workflows/cpp.yml create mode 100644 cpp/Makefile create mode 100644 cpp/README.md create mode 100644 cpp/lance_namespace/CMakeLists.txt create mode 100644 cpp/lance_namespace/include/lance_namespace/errors.h create mode 100644 cpp/lance_namespace/include/lance_namespace/errors.hpp create mode 100644 cpp/lance_namespace/include/lance_namespace/lance_namespace.h create mode 100644 cpp/lance_namespace/include/lance_namespace/lance_namespace.hpp create mode 100644 cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp create mode 100644 cpp/lance_namespace/include/lance_namespace/models.h create mode 100644 cpp/lance_namespace/include/lance_namespace/namespace_operations.hpp create mode 100644 cpp/lance_namespace/include/lance_namespace/operations.h create mode 100644 cpp/lance_namespace/include/lance_namespace/version.h create mode 100644 cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp create mode 100644 cpp/lance_namespace/src/lance_namespace.cpp create mode 100644 cpp/lance_namespace/src/operations.cpp create mode 100644 cpp/lance_namespace/tests/smoke.cpp create mode 100644 cpp/lance_namespace_rest_client/CMakeLists.txt create mode 100644 cpp/lance_namespace_rest_client/Config.cmake.in create mode 100644 cpp/lance_namespace_rest_client/README.md create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/AnyType.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiClient.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiConfiguration.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiException.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/HttpContent.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/IHttpBody.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/JsonBody.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ModelBase.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/MultipartFormData.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/Object.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/BranchApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/DataApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/IndexApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MaterializedViewApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MetadataApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/NamespaceApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TableApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TagApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TransactionApi.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddColumnsEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterColumnsEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionAction.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetProperty.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetStatus.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterVirtualColumnEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BooleanQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BoostQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BranchContents.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableOperation.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableResult.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CountTableRowsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ErrorResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentStats.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentSummary.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FtsQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/Identity.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/IndexContent.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowDataType.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowField.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowSchema.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MatchQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MultiMatchQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/NamespaceExistsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionField.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionSpec.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionTransform.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PhraseQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_columns.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_vector.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StringFtsQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StructuredFtsQuery.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableBasicStats.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableExistsRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableVersion.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TagContents.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagRequest.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagResponse.h create mode 100644 cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/VersionRange.h create mode 100644 cpp/lance_namespace_rest_client/src/AnyType.cpp create mode 100644 cpp/lance_namespace_rest_client/src/ApiClient.cpp create mode 100644 cpp/lance_namespace_rest_client/src/ApiConfiguration.cpp create mode 100644 cpp/lance_namespace_rest_client/src/ApiException.cpp create mode 100644 cpp/lance_namespace_rest_client/src/HttpContent.cpp create mode 100644 cpp/lance_namespace_rest_client/src/JsonBody.cpp create mode 100644 cpp/lance_namespace_rest_client/src/ModelBase.cpp create mode 100644 cpp/lance_namespace_rest_client/src/MultipartFormData.cpp create mode 100644 cpp/lance_namespace_rest_client/src/Object.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/BranchApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/DataApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/IndexApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/MaterializedViewApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/MetadataApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/NamespaceApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/TableApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/TagApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/api/TransactionApi.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AddColumnsEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AddVirtualColumnEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AddVirtualColumnOutputEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterColumnsEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTransactionAction.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTransactionRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTransactionResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTransactionSetProperty.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTransactionSetStatus.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterTransactionUnsetProperty.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AlterVirtualColumnEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BatchCommitTablesRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BatchCommitTablesResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BooleanQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BoostQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/BranchContents.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CommitTableOperation.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CommitTableResult.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CountTableRowsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateNamespaceRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateNamespaceResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableBranchRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableBranchResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableIndexRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableIndexResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableScalarIndexResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableTagRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableTagResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableVersionEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableVersionRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/CreateTableVersionResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeclareTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeclareTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeleteFromTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeleteFromTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeleteTableBranchRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeleteTableBranchResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeleteTableTagRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeleteTableTagResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeregisterTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DeregisterTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeNamespaceRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeNamespaceResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTableVersionRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTableVersionResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTransactionRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DescribeTransactionResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DropNamespaceRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DropNamespaceResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DropTableIndexRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DropTableIndexResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DropTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/DropTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ErrorResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/FragmentStats.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/FragmentSummary.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/FtsQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/GetTableStatsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/GetTableStatsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/GetTableTagVersionRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/GetTableTagVersionResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/Identity.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/IndexContent.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/InsertIntoTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/InsertIntoTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/JsonArrowDataType.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/JsonArrowField.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/JsonArrowSchema.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListNamespacesRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListNamespacesResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableBranchesRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableBranchesResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableIndicesRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableIndicesResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableTagsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableTagsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableVersionsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTableVersionsResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTablesRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/ListTablesResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/MatchQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/MaterializedViewUdtfEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/MultiMatchQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/NamespaceExistsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/PartitionField.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/PartitionSpec.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/PartitionTransform.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/PhraseQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/QueryTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/QueryTableRequest_columns.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/QueryTableRequest_full_text_query.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/QueryTableRequest_vector.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RegisterTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RegisterTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RenameTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RenameTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RestoreTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/RestoreTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/StringFtsQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/StructuredFtsQuery.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/TableBasicStats.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/TableExistsRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/TableVersion.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/TagContents.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataEntry.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateTableRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateTableResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateTableTagRequest.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/UpdateTableTagResponse.cpp create mode 100644 cpp/lance_namespace_rest_client/src/model/VersionRange.cpp create mode 100644 cpp/package_release.py diff --git a/.bumpversion.toml b/.bumpversion.toml index f8d6ae0b3..bcc807d95 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -38,6 +38,11 @@ filename = "python/Makefile" search = "VERSION = {current_version}" replace = "VERSION = {new_version}" +[[tool.bumpversion.files]] +filename = "cpp/Makefile" +search = "VERSION = {current_version}" +replace = "VERSION = {new_version}" + [[tool.bumpversion.files]] filename = "rust/Makefile" search = "VERSION = {current_version}" @@ -76,6 +81,12 @@ filename = "rust/reqwest-client.toml" search = 'version = "{current_version}"' replace = 'version = "{new_version}"' +# C++ version header +[[tool.bumpversion.files]] +filename = "cpp/include/lance_namespace/version.h" +search = 'LANCE_NAMESPACE_VERSION_STRING "{current_version}"' +replace = 'LANCE_NAMESPACE_VERSION_STRING "{new_version}"' + # Python lance_namespace package [[tool.bumpversion.files]] filename = "python/lance_namespace/pyproject.toml" @@ -88,7 +99,6 @@ filename = "python/lance_namespace/pyproject.toml" search = 'lance-namespace-urllib3-client=={current_version}' replace = 'lance-namespace-urllib3-client=={new_version}' - # Java lance-namespace-core module [[tool.bumpversion.files]] filename = "java/lance-namespace-core/pom.xml" diff --git a/.github/labeler.yml b/.github/labeler.yml index 5b150ea7c..1fe193f57 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -43,6 +43,9 @@ labels: - label: rust files: - "rust\\/.*" +- label: cpp + files: + - "cpp\\/.*" - label: spec files: - "spec\\/.*" \ No newline at end of file diff --git a/.github/workflows/cpp-publish.yml b/.github/workflows/cpp-publish.yml new file mode 100644 index 000000000..650c1799a --- /dev/null +++ b/.github/workflows/cpp-publish.yml @@ -0,0 +1,122 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: C/C++ Publish + +on: + release: + types: + - released + pull_request: + paths: + - .github/workflows/cpp-publish.yml + - cpp/** + workflow_dispatch: + inputs: + mode: + description: 'Release mode' + required: true + type: choice + default: dry_run + options: + - dry_run + - release + ref: + description: 'The branch, tag or SHA to checkout' + required: false + type: string + +jobs: + publish: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + full_build: true + asset_suffix: linux-x86_64 + - os: macos-14 + full_build: false + asset_suffix: macos-arm64 + - os: windows-2022 + full_build: false + asset_suffix: windows-x64 + + runs-on: ${{ matrix.os }} + permissions: + contents: write + defaults: + run: + shell: bash + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name || inputs.ref || '' }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install uv + uses: astral-sh/setup-uv@v4 + + - name: Install dependencies + run: uv sync --all-packages + + - name: Resolve SDK version + id: version + run: | + python - <<'PY' >> "$GITHUB_OUTPUT" + from pathlib import Path + + for line in Path("cpp/Makefile").read_text().splitlines(): + if line.startswith("VERSION = "): + print(f"version={line.split('=', 1)[1].strip()}") + break + else: + raise SystemExit("VERSION not found in cpp/Makefile") + PY + + - name: Build full C/C++ SDK + if: ${{ matrix.full_build }} + working-directory: cpp + run: make build + + - name: Build C/C++ core + if: ${{ !matrix.full_build }} + working-directory: cpp + run: | + cmake -S lance_namespace -B lance_namespace/build -DCMAKE_BUILD_TYPE=Release + cmake --build lance_namespace/build --parallel 2 + ctest --test-dir lance_namespace/build --output-on-failure --parallel 2 + + - name: Package release asset + working-directory: cpp + run: | + uv run python package_release.py \ + --root . \ + --output "dist/lance-namespace-cpp-${{ steps.version.outputs.version }}-${{ matrix.asset_suffix }}.tar.gz" \ + --build-dir build \ + --dist-dir dist + + - name: Upload release asset + if: | + (github.event_name == 'release' && github.event.action == 'released') || + (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'release') + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.release.tag_name || inputs.ref || '' }} + files: cpp/dist/*.tar.gz + token: ${{ secrets.LANCE_RELEASE_TOKEN }} diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml new file mode 100644 index 000000000..96768e230 --- /dev/null +++ b/.github/workflows/cpp.yml @@ -0,0 +1,79 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: C/C++ + +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + - ready_for_review + - reopened + paths: + - docs/src/spec.yaml + - cpp/** + - .github/workflows/cpp.yml + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + full_build: true + - os: macos-14 + full_build: false + - os: windows-2022 + full_build: false + + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + defaults: + run: + shell: bash + + steps: + - name: Checkout lance-namespace repo + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install uv + uses: astral-sh/setup-uv@v4 + + - name: Install dependencies + run: uv sync --all-packages + + - name: Build full C/C++ SDK + if: ${{ matrix.full_build }} + working-directory: cpp + run: make build + + - name: Build C/C++ core + if: ${{ !matrix.full_build }} + working-directory: cpp + run: | + cmake -S lance_namespace -B lance_namespace/build -DCMAKE_BUILD_TYPE=Release + cmake --build lance_namespace/build --parallel 2 + ctest --test-dir lance_namespace/build --output-on-failure --parallel 2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a86e217b..c992aaf68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ or to add new clients and servers to be generated based on community demand. In general, we welcome more generated components to be added as long as the contributor is willing to set up all the automations for generation and publication. -For contributing changes to directory and REST namespaces, please go to the [lance](https://github.com/lance-format/lance) repo. +For contributing changes to directory and REST namespaces, please go to the [lance-c](https://github.com/lance-format/lance-c) repo for C/C++ and [lance](https://github.com/lance-format/lance) repo for other languages. For contributing changes to implementations other than the directory and REST namespace, or for adding new namespace implementations, @@ -32,11 +32,11 @@ This is because Rust uses source code builds, and separating modules across repo The dependency chain is: `lance-namespace` → `lance` → `lance-namespace-impls` -### Other Languages (e.g. Python, Java) +### Other Languages (e.g. Python, Java, C/C++) For Python, Java, and other languages, the core `LanceNamespace` interface and generic connect functionality are maintained in **this repository** (e.g., `lance-namespace` for Python, `lance-namespace-core` for Java). -The core [lance-format/lance](https://github.com/lance-format/lance) repository then imports these modules. +The core repos [lance-format/lance](https://github.com/lance-format/lance) and [lance-format/lance-c](https://github.com/lance-format/lance-c) then import these modules. The reason for this import direction is that `lance-namespace-impls` (REST and directory namespace implementations) are used in the Lance Python and Java bindings, and are exposed back through the corresponding language interfaces. @@ -107,6 +107,8 @@ This repository currently contains the following components: | Java Apache Client | Java | java/lance-namespace-apache-client | Generated Java Apache HTTP client for Lance REST Namespace | | Java SpringBoot Server| Java | java/lance-namespace-springboot-server | Generated Java SpringBoot server for Lance REST Namespace | | Rust Reqwest Client | Rust | rust/lance-namespace-reqwest-client | Generated Rust reqwest client for Lance REST Namespace | +| C/C++ Core | C/C++ | cpp/lance_namespace | Core LanceNamespace interface and connect functionality | +| C/C++ REST Client | C/C++ | cpp/lance_namespace_rest_client | Generated C/C++ REST client for Lance REST Namespace | ## Install uv @@ -200,5 +202,5 @@ This section describes the CI/CD workflows for automated version management, rel - Go to the [Releases page](../../releases) to review the draft - Edit release notes if needed - Click "Publish release" to: - - For stable releases: Trigger automatic publishing for Java, Python, Rust + - For stable releases: Trigger automatic publishing for Java, Python, Rust, and C/C++ - For preview releases: Create a beta release (not published) diff --git a/Makefile b/Makefile index 49f83b4ce..561b7f6e0 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,18 @@ gen-rust: build-rust: cd rust; make build +.PHONY: clean-cpp +clean-cpp: + cd cpp; make clean + +.PHONY: sync gen-cpp +gen-cpp: + cd cpp; make gen + +.PHONY: build-cpp +build-cpp: + cd cpp; make build + .PHONY: clean-python clean-python: cd python; make clean @@ -63,10 +75,10 @@ sync: uv sync --all-packages .PHONY: clean -clean: clean-rust clean-python clean-java +clean: clean-rust clean-cpp clean-python clean-java .PHONY: gen -gen: lint gen-rust gen-python gen-java +gen: lint gen-rust gen-cpp gen-python gen-java .PHONY: build -build: lint build-docs build-rust build-python build-java +build: lint build-docs build-rust build-cpp build-python build-java diff --git a/README.md b/README.md index a52996bea..120f8124c 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ that compute engines can integrate against: | Python | `lance-namespace` | Core interface and connect functionality | | Java | `org.lance:lance-namespace-core` | Core interface for Spark, Flink, Kafka, Trino, Presto | | Rust | `lance-namespace` | Core interface (in [lance-format/lance](https://github.com/lance-format/lance)) | +| C/C++ | `lance-namespace-cpp` | Core interface and connect functionality | ## Resources diff --git a/cpp/Makefile b/cpp/Makefile new file mode 100644 index 000000000..be769f871 --- /dev/null +++ b/cpp/Makefile @@ -0,0 +1,71 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +VERSION = 0.8.7-beta.1 +BUILD_DIR ?= build +GENERATED_DIR ?= lance_namespace_rest_client +DIST_DIR ?= dist +JOBS ?= $(shell nproc 2>/dev/null || echo 1) + +.PHONY: clean-rest-client +clean-rest-client: + rm -rf $(GENERATED_DIR) + +.PHONY: gen-rest-client +gen-rest-client: clean-rest-client + uv run openapi-generator-cli generate \ + -i ../docs/src/spec.yaml \ + -g cpp-restsdk \ + -o $(GENERATED_DIR) \ + --additional-properties=packageName=lance_namespace_rest_client,packageVersion=$(VERSION); + uv run python -c "from pathlib import Path; p = Path('$(GENERATED_DIR)/CMakeLists.txt'); text = p.read_text(); text = text.replace('cmake_minimum_required (VERSION 3.5)', 'cmake_minimum_required (VERSION 3.20)'); text = text.replace('set(CXX_STANDARD_REQUIRED ON)', 'set(CMAKE_CXX_STANDARD_REQUIRED ON)\\nset(CMAKE_CXX_STANDARD 17)'); p.write_text(text)" + rm -rf $(GENERATED_DIR)/.openapi-generator + rm -f $(GENERATED_DIR)/.gitignore $(GENERATED_DIR)/git_push.sh $(GENERATED_DIR)/.openapi-generator-ignore + +.PHONY: build-rest-client +build-rest-client: gen-rest-client + cd $(GENERATED_DIR); \ + cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release; \ + cmake --build $(BUILD_DIR) --parallel $(JOBS); \ + ctest --test-dir $(BUILD_DIR) --output-on-failure --parallel $(JOBS); + +# lance_namespace package (hand-written, no codegen) +.PHONY: clean-core +clean-core: + cd lance_namespace; \ + rm -rf $(BUILD_DIR) $(DIST_DIR); + +.PHONY: build-core +build-core: + cd lance_namespace; \ + cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release; \ + cmake --build $(BUILD_DIR) --parallel $(JOBS); \ + ctest --test-dir $(BUILD_DIR) --output-on-failure --parallel $(JOBS); + + +.PHONY: clean +clean: clean-rest-client clean-core + +.PHONY: gen +gen: gen-rest-client + +.PHONY: build +build: build-rest-client build-core + + +.PHONY: publish +publish: build + uv run python package_release.py \ + --root . \ + --output $(DIST_DIR)/lance-namespace-cpp-$(VERSION).tar.gz \ + --build-dir $(BUILD_DIR) \ + --dist-dir $(DIST_DIR); diff --git a/cpp/README.md b/cpp/README.md new file mode 100644 index 000000000..148fbcf37 --- /dev/null +++ b/cpp/README.md @@ -0,0 +1,59 @@ +# lance-namespace + +Lance Namespace interface and plugin registry. + +## Overview + +This package provides two layers: + +1. A light-weight stable C ABI for registering namespace implementations and connecting to them. +2. A header-only C++ convenience layer with a simple `Namespace` base class and `connect()` helper. + +The package is intentionally lightweight with the following public API: + +- `register_namespace_impl(...)` +- `connect(...)` +- shared error/status codes +- generated API models and request/response structures from `lance_namespace_rest_client.hpp` + +It is intended to build and run on Linux, macOS, and Windows. + +## Build + +Requires CMake 3.20+ and a compiler with C++17 support. + +```bash +make build +``` + + + +## C usage + +```c +#include + +static const char *namespace_id(const lance_namespace_handle_t *handle) { + return "example"; +} + +static void destroy(void *instance) { + free(instance); +} +``` + +## C++ usage + +```cpp +#include + +struct ExampleNamespace : lance_namespace::Namespace { + std::string namespace_id() const override { return "example"; } +}; + +lance_namespace::register_namespace_impl( + "example", + [](const lance_namespace::Properties &) { + return std::make_unique(); + }); +``` diff --git a/cpp/lance_namespace/CMakeLists.txt b/cpp/lance_namespace/CMakeLists.txt new file mode 100644 index 000000000..0e075b984 --- /dev/null +++ b/cpp/lance_namespace/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.20) + +project(lance_namespace_cpp LANGUAGES CXX) + +include(CTest) + +option(BUILD_TESTING "Build tests" ON) + +add_library(lance_namespace SHARED + src/lance_namespace.cpp + src/operations.cpp +) + +target_compile_features(lance_namespace PUBLIC cxx_std_17) +target_include_directories(lance_namespace + PUBLIC + $ + $ + $ +) +target_compile_definitions(lance_namespace PRIVATE LANCE_NAMESPACE_BUILDING=1) + +add_executable(lance_namespace_smoke tests/smoke.cpp) +target_link_libraries(lance_namespace_smoke PRIVATE lance_namespace) + +if(BUILD_TESTING) + add_test(NAME lance_namespace_smoke COMMAND lance_namespace_smoke) +endif() + +install(TARGETS lance_namespace + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +install(DIRECTORY include/ DESTINATION include) diff --git a/cpp/lance_namespace/include/lance_namespace/errors.h b/cpp/lance_namespace/include/lance_namespace/errors.h new file mode 100644 index 000000000..bdc522a51 --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/errors.h @@ -0,0 +1,130 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file errors.h + * @brief C error codes for Lance Namespace operations. + * + * Defines all error codes that can be returned by Lance Namespace operations. + * These correspond to the C++ exception types in errors.hpp. Also, a + * error structure is provided to hold an error code and an optional message. + * + * Use lance_namespace_error_code_to_string() to get a human-readable name + * for any error code. + */ + +#ifndef LANCE_NAMESPACE_ERRORS_H +#define LANCE_NAMESPACE_ERRORS_H + +#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(LANCE_NAMESPACE_BUILDING) +#define LANCE_NAMESPACE_API __declspec(dllexport) +#else +#define LANCE_NAMESPACE_API __declspec(dllimport) +#endif +#else +#define LANCE_NAMESPACE_API +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Error codes for Lance Namespace operations. + * + * Every operation may return one of these codes to indicate success or + * the specific category of failure. The codes are shared across the C API, + * C++ exceptions (errors.hpp), and Python error types. + */ +typedef enum lance_namespace_error_code { + /** The operation is not supported by this namespace implementation. */ + LANCE_NAMESPACE_ERROR_UNSUPPORTED = 0, + /** The requested namespace does not exist. */ + LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_FOUND = 1, + /** A namespace with the same name already exists. */ + LANCE_NAMESPACE_ERROR_NAMESPACE_ALREADY_EXISTS = 2, + /** The namespace is not empty (contains tables or child namespaces). */ + LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_EMPTY = 3, + /** The requested table does not exist. */ + LANCE_NAMESPACE_ERROR_TABLE_NOT_FOUND = 4, + /** A table with the same name already exists. */ + LANCE_NAMESPACE_ERROR_TABLE_ALREADY_EXISTS = 5, + /** The requested table index does not exist. */ + LANCE_NAMESPACE_ERROR_TABLE_INDEX_NOT_FOUND = 6, + /** An index with the same name already exists on the table. */ + LANCE_NAMESPACE_ERROR_TABLE_INDEX_ALREADY_EXISTS = 7, + /** The requested table tag does not exist. */ + LANCE_NAMESPACE_ERROR_TABLE_TAG_NOT_FOUND = 8, + /** A tag with the same name already exists on the table. */ + LANCE_NAMESPACE_ERROR_TABLE_TAG_ALREADY_EXISTS = 9, + /** The requested transaction does not exist. */ + LANCE_NAMESPACE_ERROR_TRANSACTION_NOT_FOUND = 10, + /** The requested table version does not exist. */ + LANCE_NAMESPACE_ERROR_TABLE_VERSION_NOT_FOUND = 11, + /** A referenced column does not exist in the table. */ + LANCE_NAMESPACE_ERROR_TABLE_COLUMN_NOT_FOUND = 12, + /** The request contains invalid parameters. */ + LANCE_NAMESPACE_ERROR_INVALID_INPUT = 13, + /** A concurrent modification conflict occurred. */ + LANCE_NAMESPACE_ERROR_CONCURRENT_MODIFICATION = 14, + /** The user lacks permission for this operation. */ + LANCE_NAMESPACE_ERROR_PERMISSION_DENIED = 15, + /** Authentication credentials are missing or invalid. */ + LANCE_NAMESPACE_ERROR_UNAUTHENTICATED = 16, + /** The service is temporarily unavailable. */ + LANCE_NAMESPACE_ERROR_SERVICE_UNAVAILABLE = 17, + /** An unexpected internal error occurred. */ + LANCE_NAMESPACE_ERROR_INTERNAL = 18, + /** The table is in an invalid state for this operation. */ + LANCE_NAMESPACE_ERROR_INVALID_TABLE_STATE = 19, + /** Schema validation failed. */ + LANCE_NAMESPACE_ERROR_TABLE_SCHEMA_VALIDATION_ERROR = 20, + /** The request was throttled due to rate limiting. */ + LANCE_NAMESPACE_ERROR_THROTTLING = 21, + /** The requested table branch does not exist. */ + LANCE_NAMESPACE_ERROR_TABLE_BRANCH_NOT_FOUND = 22, + /** A branch with the same name already exists on the table. */ + LANCE_NAMESPACE_ERROR_TABLE_BRANCH_ALREADY_EXISTS = 23, +} lance_namespace_error_code_t; + +/** + * @brief Structure representing an error in Lance Namespace operations. + * + * This structure contains the error code and an optional message + * providing additional details about the error. + */ +typedef struct lance_namespace_error { + lance_namespace_status_t code; + char *message; +} lance_namespace_error_t; + +/** + * Convert an error code to a human-readable string. + * + * Returns a static string such as "unsupported", "namespace_not_found", + * "table_already_exists", etc. The returned pointer is valid for the + * lifetime of the program and must not be freed. + * + * @param code The error code to convert. + * @return A static string representation of the error code. + */ +LANCE_NAMESPACE_API const char *lance_namespace_error_code_to_string(lance_namespace_error_code_t code); + +#ifdef __cplusplus +} +#endif + +#endif // LANCE_NAMESPACE_ERRORS_H diff --git a/cpp/lance_namespace/include/lance_namespace/errors.hpp b/cpp/lance_namespace/include/lance_namespace/errors.hpp new file mode 100644 index 000000000..a85e94589 --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/errors.hpp @@ -0,0 +1,250 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file errors.hpp + * @brief C++ exception types for Lance Namespace operations. + * + * Defines C++ exception types corresponding to the error codes in errors.h. + */ + +#ifndef LANCE_NAMESPACE_ERRORS_HPP +#define LANCE_NAMESPACE_ERRORS_HPP + +#include "errors.h" + +#include +#include +#include + +namespace lance_namespace { + +class LanceNamespaceError : public std::exception { + public: + explicit LanceNamespaceError(std::string message, + lance_namespace_error_code_t code = LANCE_NAMESPACE_ERROR_INTERNAL) + : message_(std::move(message)), code_(code) {} + + const char *what() const noexcept override { return message_.c_str(); } + lance_namespace_error_code_t code() const noexcept { return code_; } + + private: + std::string message_; + lance_namespace_error_code_t code_; +}; + +class UnsupportedOperationError : public LanceNamespaceError { + public: + explicit UnsupportedOperationError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_UNSUPPORTED) {} +}; + +class NamespaceNotFoundError : public LanceNamespaceError { + public: + explicit NamespaceNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_FOUND) {} +}; + +class NamespaceAlreadyExistsError : public LanceNamespaceError { + public: + explicit NamespaceAlreadyExistsError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_NAMESPACE_ALREADY_EXISTS) {} +}; + +class NamespaceNotEmptyError : public LanceNamespaceError { + public: + explicit NamespaceNotEmptyError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_EMPTY) {} +}; + +class TableNotFoundError : public LanceNamespaceError { + public: + explicit TableNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_NOT_FOUND) {} +}; + +class TableAlreadyExistsError : public LanceNamespaceError { + public: + explicit TableAlreadyExistsError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_ALREADY_EXISTS) {} +}; + +class TableIndexNotFoundError : public LanceNamespaceError { + public: + explicit TableIndexNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_INDEX_NOT_FOUND) {} +}; + +class TableIndexAlreadyExistsError : public LanceNamespaceError { + public: + explicit TableIndexAlreadyExistsError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_INDEX_ALREADY_EXISTS) {} +}; + +class TableTagNotFoundError : public LanceNamespaceError { + public: + explicit TableTagNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_TAG_NOT_FOUND) {} +}; + +class TableTagAlreadyExistsError : public LanceNamespaceError { + public: + explicit TableTagAlreadyExistsError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_TAG_ALREADY_EXISTS) {} +}; + +class TransactionNotFoundError : public LanceNamespaceError { + public: + explicit TransactionNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TRANSACTION_NOT_FOUND) {} +}; + +class TableVersionNotFoundError : public LanceNamespaceError { + public: + explicit TableVersionNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_VERSION_NOT_FOUND) {} +}; + +class TableColumnNotFoundError : public LanceNamespaceError { + public: + explicit TableColumnNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_COLUMN_NOT_FOUND) {} +}; + +class InvalidInputError : public LanceNamespaceError { + public: + explicit InvalidInputError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_INVALID_INPUT) {} +}; + +class ConcurrentModificationError : public LanceNamespaceError { + public: + explicit ConcurrentModificationError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_CONCURRENT_MODIFICATION) {} +}; + +class PermissionDeniedError : public LanceNamespaceError { + public: + explicit PermissionDeniedError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_PERMISSION_DENIED) {} +}; + +class UnauthenticatedError : public LanceNamespaceError { + public: + explicit UnauthenticatedError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_UNAUTHENTICATED) {} +}; + +class ServiceUnavailableError : public LanceNamespaceError { + public: + explicit ServiceUnavailableError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_SERVICE_UNAVAILABLE) {} +}; + +class InternalError : public LanceNamespaceError { + public: + explicit InternalError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_INTERNAL) {} +}; + +class InvalidTableStateError : public LanceNamespaceError { + public: + explicit InvalidTableStateError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_INVALID_TABLE_STATE) {} +}; + +class TableSchemaValidationError : public LanceNamespaceError { + public: + explicit TableSchemaValidationError(std::string message) + : LanceNamespaceError(std::move(message), + LANCE_NAMESPACE_ERROR_TABLE_SCHEMA_VALIDATION_ERROR) {} +}; + +class ThrottlingError : public LanceNamespaceError { + public: + explicit ThrottlingError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_THROTTLING) {} +}; + +class TableBranchNotFoundError : public LanceNamespaceError { + public: + explicit TableBranchNotFoundError(std::string message) + : LanceNamespaceError(std::move(message), LANCE_NAMESPACE_ERROR_TABLE_BRANCH_NOT_FOUND) {} +}; + +class TableBranchAlreadyExistsError : public LanceNamespaceError { + public: + explicit TableBranchAlreadyExistsError(std::string message) + : LanceNamespaceError(std::move(message), + LANCE_NAMESPACE_ERROR_TABLE_BRANCH_ALREADY_EXISTS) {} +}; + +inline std::unique_ptr from_error_code(lance_namespace_error_code_t code, std::string message) { + switch (code) { + case LANCE_NAMESPACE_ERROR_UNSUPPORTED: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_NAMESPACE_ALREADY_EXISTS: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_EMPTY: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_ALREADY_EXISTS: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_INDEX_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_INDEX_ALREADY_EXISTS: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_TAG_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_TAG_ALREADY_EXISTS: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TRANSACTION_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_VERSION_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_COLUMN_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_INVALID_INPUT: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_CONCURRENT_MODIFICATION: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_PERMISSION_DENIED: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_UNAUTHENTICATED: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_SERVICE_UNAVAILABLE: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_INVALID_TABLE_STATE: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_SCHEMA_VALIDATION_ERROR: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_THROTTLING: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_BRANCH_NOT_FOUND: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_TABLE_BRANCH_ALREADY_EXISTS: + return std::make_unique(std::move(message)); + case LANCE_NAMESPACE_ERROR_INTERNAL: + default: + return std::make_unique(std::move(message)); + } +} + +} // namespace lance_namespace + +#endif // LANCE_NAMESPACE_ERRORS_HPP diff --git a/cpp/lance_namespace/include/lance_namespace/lance_namespace.h b/cpp/lance_namespace/include/lance_namespace/lance_namespace.h new file mode 100644 index 000000000..abca9be9b --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/lance_namespace.h @@ -0,0 +1,138 @@ +/** + * @file lance_namespace.h + * @brief C API for Lance Namespace core interface. + * + * This header provides the C API for creating, connecting to, and managing + * Lance Namespace implementations. It defines: + * + * - Status codes (lance_namespace_status_t) + * - Connection options (lance_namespace_options_t, lance_namespace_property_t) + * - Namespace handles (lance_namespace_handle_t) + * - Plugin registration (lance_namespace_register_impl, lance_namespace_connect) + * + * For namespace operation functions (list_tables, create_table, etc.), + * see operations.h. + * + * For C-compatible request/response model types, see models.h. + * + * Example usage: + * @code + * // Register a custom implementation + * lance_namespace_register_impl("my-impl", my_create_fn); + * + * // Connect to the namespace + * lance_namespace_handle_t *ns = NULL; + * lance_namespace_error_t error = {0}; + * lance_namespace_property_t props[] = {{"uri", "http://localhost:8080"}}; + * lance_namespace_options_t opts = {props, 1}; + * lance_namespace_connect("my-impl", &opts, &ns, &error); + * + * // Use the namespace... + * printf("ID: %s\n", lance_namespace_namespace_id(ns)); + * + * // Clean up + * lance_namespace_handle_release(ns); + * lance_namespace_error_free(&error); + * @endcode + */ + +#ifndef LANCE_NAMESPACE_LANCE_NAMESPACE_H +#define LANCE_NAMESPACE_LANCE_NAMESPACE_H + +#include + +#include "version.h" + +#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(LANCE_NAMESPACE_BUILDING) +#define LANCE_NAMESPACE_API __declspec(dllexport) +#else +#define LANCE_NAMESPACE_API __declspec(dllimport) +#endif +#else +#define LANCE_NAMESPACE_API +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum lance_namespace_status { + LANCE_NAMESPACE_STATUS_OK = 0, + LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT = 1, + LANCE_NAMESPACE_STATUS_NOT_FOUND = 2, + LANCE_NAMESPACE_STATUS_ALREADY_EXISTS = 3, + LANCE_NAMESPACE_STATUS_UNSUPPORTED = 4, + LANCE_NAMESPACE_STATUS_INTERNAL = 5, +} lance_namespace_status_t; + +typedef struct lance_namespace_property { + const char *key; + const char *value; +} lance_namespace_property_t; + +typedef struct lance_namespace_options { + const lance_namespace_property_t *properties; + size_t property_count; +} lance_namespace_options_t; + +typedef struct lance_namespace_header { + const char *name; + const char *value; +} lance_namespace_header_t; + +typedef struct lance_namespace_headers { + const lance_namespace_header_t *items; + size_t count; +} lance_namespace_headers_t; + +typedef struct lance_namespace_handle lance_namespace_handle_t; +typedef struct lance_namespace_vtable lance_namespace_vtable_t; + +typedef lance_namespace_status_t (*lance_namespace_create_fn)( + const lance_namespace_options_t *options, + lance_namespace_handle_t **out_namespace, + lance_namespace_error_t *error); + +struct lance_namespace_vtable { + const char *(*namespace_id)(const lance_namespace_handle_t *self); + void (*destroy)(void *instance); +}; + +LANCE_NAMESPACE_API const char *lance_namespace_version_string(void); +LANCE_NAMESPACE_API const char *lance_namespace_status_to_string( + lance_namespace_status_t status); +LANCE_NAMESPACE_API const char *lance_namespace_option_get( + const lance_namespace_options_t *options, + const char *key); +LANCE_NAMESPACE_API const char *lance_namespace_header_get( + const lance_namespace_headers_t *headers, + const char *name); + +LANCE_NAMESPACE_API lance_namespace_handle_t *lance_namespace_handle_create( + const lance_namespace_vtable_t *vtable, + void *instance); +LANCE_NAMESPACE_API void *lance_namespace_handle_instance( + const lance_namespace_handle_t *handle); +LANCE_NAMESPACE_API void lance_namespace_handle_release( + lance_namespace_handle_t *handle); +LANCE_NAMESPACE_API const char *lance_namespace_namespace_id( + const lance_namespace_handle_t *handle); + +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_register_impl( + const char *name, + lance_namespace_create_fn create_fn); +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_unregister_impl( + const char *name); +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_connect( + const char *impl, + const lance_namespace_options_t *options, + lance_namespace_handle_t **out_namespace, + lance_namespace_error_t *error); +LANCE_NAMESPACE_API void lance_namespace_error_free(lance_namespace_error_t *error); + +#ifdef __cplusplus +} +#endif + +#endif // LANCE_NAMESPACE_LANCE_NAMESPACE_H diff --git a/cpp/lance_namespace/include/lance_namespace/lance_namespace.hpp b/cpp/lance_namespace/include/lance_namespace/lance_namespace.hpp new file mode 100644 index 000000000..5f454575f --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/lance_namespace.hpp @@ -0,0 +1,180 @@ +/** + * @file lance_namespace.hpp + * @brief C++ interface for Lance Namespace core functionality. + * + * This header provides the C++ interface for Lance Namespace, including: + * + * - Namespace base class (alias for NamespaceOperations) + * - Plugin registration (register_namespace_impl, unregister_namespace_impl) + * - Factory function (connect) + * - Utility functions (version_string, status_to_string) + * + * Example usage: + * @code + * #include + * + * // Register a custom implementation + * lance_namespace::register_namespace_impl("my-impl", + * [](const lance_namespace::Properties &props) { + * return std::make_unique(props); + * }); + * + * // Connect to the namespace + * auto ns = lance_namespace::connect("my-impl", {{"uri", "http://localhost"}}); + * std::cout << "ID: " << ns->namespace_id() << std::endl; + * + * // Call operations (throws UnsupportedOperationError if not implemented) + * try { + * auto response = ns->list_namespaces(request); + * } catch (const lance_namespace::UnsupportedOperationError &e) { + * std::cerr << e.what() << std::endl; + * } + * @endcode + */ + +#ifndef LANCE_NAMESPACE_LANCE_NAMESPACE_HPP +#define LANCE_NAMESPACE_LANCE_NAMESPACE_HPP + +#include "errors.hpp" +#include "lance_namespace.h" +#include "namespace_operations.hpp" + +#include +#include +#include +#include +#include +#include +#include + +namespace lance_namespace { + +/** + * @brief A single key-value property for namespace configuration. + */ +struct Property { + std::string key; + std::string value; +}; + +/** + * @brief A list of key-value properties passed to namespace factories. + */ +using Properties = std::vector; + +/** + * @brief Base class for namespace implementations. + * + * Alias for NamespaceOperations, which defines all operation methods. + * Subclass this and implement at least namespace_id(). + */ +using Namespace = NamespaceOperations; + +/** + * @brief Factory function type for creating namespace instances. + * + * Takes a list of properties and returns a unique_ptr to a Namespace. + */ +using Factory = std::function(const Properties &)>; + +namespace detail { + +inline std::unordered_map ®istry() { + static auto *registry_ = new std::unordered_map(); + return *registry_; +} + +inline std::mutex ®istry_mutex() { + static auto *mutex_ = new std::mutex(); + return *mutex_; +} + +} // namespace detail + +/** + * @brief Register a namespace implementation with a short name. + * + * External libraries can use this to register their implementations, + * allowing users to use short names like "glue" instead of full class paths. + * + * @param name Short name for the implementation (e.g., "glue", "hive"). + * @param factory Factory function that creates namespace instances. + * @throws InvalidInputError If name is empty or factory is null. + */ +inline void register_namespace_impl(std::string name, Factory factory) { + if (name.empty()) { + throw InvalidInputError("namespace implementation name must not be empty"); + } + if (!factory) { + throw InvalidInputError("namespace factory must not be empty"); + } + + std::lock_guard lock(detail::registry_mutex()); + detail::registry()[std::move(name)] = std::move(factory); +} + +/** + * @brief Unregister a previously registered namespace implementation. + * + * @param name The name of the implementation to remove. + */ +inline void unregister_namespace_impl(const std::string &name) { + std::lock_guard lock(detail::registry_mutex()); + detail::registry().erase(name); +} + +/** + * @brief Connect to a Lance namespace implementation. + * + * Creates a namespace instance from a registered name. The factory + * registered via register_namespace_impl() is called with the provided + * properties to construct the namespace. + * + * @param impl Registered implementation name (e.g., "rest", "dir"). + * @param properties Configuration properties passed to the factory. + * @return A unique_ptr to the connected Namespace instance. + * @throws NamespaceNotFoundError If the implementation is not registered. + * @throws InternalError If the factory returns null. + */ +inline std::unique_ptr connect( + const std::string &impl, + const Properties &properties) { + Factory factory; + { + std::lock_guard lock(detail::registry_mutex()); + auto it = detail::registry().find(impl); + if (it == detail::registry().end()) { + throw NamespaceNotFoundError("unknown namespace implementation: " + impl); + } + factory = it->second; + } + + auto namespace_ptr = factory(properties); + if (!namespace_ptr) { + throw InternalError("namespace factory returned null: " + impl); + } + return namespace_ptr; +} + +/** + * @brief Return the library version string. + * + * @return Version string (e.g., "0.8.7-beta.1"). + */ +inline const char *version_string() { + return LANCE_NAMESPACE_VERSION_STRING; +} + +/** + * @brief Convert a status code to a human-readable string. + * + * @param status The status code to convert. + * @return Static string like "ok", "not_found", "unsupported", etc. + */ +inline const char *status_to_string(lance_namespace_status_t status) { + return lance_namespace_status_to_string(status); +} + +} // namespace lance_namespace + +#endif // LANCE_NAMESPACE_LANCE_NAMESPACE_HPP diff --git a/cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp b/cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp new file mode 100644 index 000000000..41ad9a634 --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp @@ -0,0 +1,7 @@ +#pragma once + +#if defined(__has_include) +#if __has_include() +#include +#endif +#endif diff --git a/cpp/lance_namespace/include/lance_namespace/models.h b/cpp/lance_namespace/include/lance_namespace/models.h new file mode 100644 index 000000000..29e8450e2 --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/models.h @@ -0,0 +1,828 @@ +/** + * @file models.h + * @brief C-compatible model types for Lance Namespace request and response structs. + * + * This header defines C-compatible struct types for all Lance Namespace + * operations. These types mirror the generated C++ model types from the + * REST client but use plain C types (const char*, int64_t, etc.) for + * cross-language compatibility. + * + * String fields (const char*) are not owned by the struct unless noted. + * Callers must ensure string pointers remain valid for the lifetime of + * the request. Response structs with allocated strings must be freed by + * the caller. + * + * Helper types: + * - lance_namespace_map_t: Key-value string map for properties and metadata. + * - lance_namespace_buffer_t: Byte buffer for binary data (Arrow IPC streams). + * + * Use the provided helper functions to create and manage these types: + * - lance_namespace_map_create() / lance_namespace_map_free() + * - lance_namespace_map_set() + * - lance_namespace_buffer_create() / lance_namespace_buffer_free() + */ + +#ifndef LANCE_NAMESPACE_MODELS_H +#define LANCE_NAMESPACE_MODELS_H + +#include +#include + +#include "lance_namespace.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Generic key-value string map for properties and metadata. + * + * Used to pass properties on requests and receive properties on responses. + * Keys and values are string pointers. When created via + * lance_namespace_map_create(), the map owns copies of all strings and + * must be freed with lance_namespace_map_free(). + */ +typedef struct lance_namespace_map { + /** Array of key strings. */ + const char **keys; + /** Array of value strings. */ + const char **values; + /** Number of key-value pairs. */ + size_t count; +} lance_namespace_map_t; + +/** + * @brief Byte buffer for binary data (Arrow IPC streams, etc.). + * + * When created via lance_namespace_buffer_create(), the buffer owns the + * allocated memory and must be freed with lance_namespace_buffer_free(). + */ +typedef struct lance_namespace_buffer { + /** Pointer to the byte data. */ + uint8_t *data; + /** Size of the data in bytes. */ + size_t size; +} lance_namespace_buffer_t; + +// ============================================================================ +// Namespace Operations +// ============================================================================ + +typedef struct lance_namespace_list_namespaces_request { + const char *id; + const char *delimiter; + const char *page_token; + int32_t limit; +} lance_namespace_list_namespaces_request_t; + +typedef struct lance_namespace_list_namespaces_response { + char **namespaces; + size_t count; + char *page_token; +} lance_namespace_list_namespaces_response_t; + +typedef struct lance_namespace_describe_namespace_request { + const char *id; + const char *delimiter; +} lance_namespace_describe_namespace_request_t; + +typedef struct lance_namespace_describe_namespace_response { + char *id; + lance_namespace_map_t properties; +} lance_namespace_describe_namespace_response_t; + +typedef struct lance_namespace_create_namespace_request { + const char *id; + const char *delimiter; + lance_namespace_map_t properties; +} lance_namespace_create_namespace_request_t; + +typedef struct lance_namespace_create_namespace_response { + char *id; + lance_namespace_map_t properties; +} lance_namespace_create_namespace_response_t; + +typedef struct lance_namespace_drop_namespace_request { + const char *id; + const char *delimiter; +} lance_namespace_drop_namespace_request_t; + +typedef struct lance_namespace_drop_namespace_response { + // Empty response +} lance_namespace_drop_namespace_response_t; + +typedef struct lance_namespace_namespace_exists_request { + const char *id; + const char *delimiter; +} lance_namespace_namespace_exists_request_t; + +typedef struct lance_namespace_list_tables_request { + const char *id; + const char *delimiter; + const char *page_token; + int32_t limit; +} lance_namespace_list_tables_request_t; + +typedef struct lance_namespace_list_tables_response { + char **tables; + size_t count; + char *page_token; +} lance_namespace_list_tables_response_t; + +// ============================================================================ +// Table Operations +// ============================================================================ + +typedef struct lance_namespace_describe_table_request { + const char *id; + const char *delimiter; +} lance_namespace_describe_table_request_t; + +typedef struct lance_namespace_describe_table_response { + char *id; + char *location; + int64_t version; + lance_namespace_map_t properties; +} lance_namespace_describe_table_response_t; + +typedef struct lance_namespace_register_table_request { + const char *id; + const char *delimiter; + const char *location; + lance_namespace_map_t properties; +} lance_namespace_register_table_request_t; + +typedef struct lance_namespace_register_table_response { + char *id; + char *location; +} lance_namespace_register_table_response_t; + +typedef struct lance_namespace_table_exists_request { + const char *id; + const char *delimiter; +} lance_namespace_table_exists_request_t; + +typedef struct lance_namespace_drop_table_request { + const char *id; + const char *delimiter; +} lance_namespace_drop_table_request_t; + +typedef struct lance_namespace_drop_table_response { + // Empty response +} lance_namespace_drop_table_response_t; + +typedef struct lance_namespace_deregister_table_request { + const char *id; + const char *delimiter; +} lance_namespace_deregister_table_request_t; + +typedef struct lance_namespace_deregister_table_response { + // Empty response +} lance_namespace_deregister_table_response_t; + +typedef struct lance_namespace_count_table_rows_request { + const char *id; + const char *delimiter; + int64_t version; +} lance_namespace_count_table_rows_request_t; + +typedef struct lance_namespace_create_table_request { + const char *id; + const char *delimiter; + const char *mode; + lance_namespace_map_t properties; + lance_namespace_map_t storage_options; + lance_namespace_buffer_t data; +} lance_namespace_create_table_request_t; + +typedef struct lance_namespace_create_table_response { + char *id; + char *location; + int64_t version; +} lance_namespace_create_table_response_t; + +typedef struct lance_namespace_declare_table_request { + const char *id; + const char *delimiter; + lance_namespace_map_t properties; +} lance_namespace_declare_table_request_t; + +typedef struct lance_namespace_declare_table_response { + char *id; + char *location; +} lance_namespace_declare_table_response_t; + +typedef struct lance_namespace_insert_into_table_request { + const char *id; + const char *delimiter; + const char *mode; + const char *branch; + lance_namespace_buffer_t data; +} lance_namespace_insert_into_table_request_t; + +typedef struct lance_namespace_insert_into_table_response { + int64_t rows_inserted; +} lance_namespace_insert_into_table_response_t; + +typedef struct lance_namespace_query_table_request { + const char *id; + const char *delimiter; + int64_t version; + const char *branch; + int64_t limit; + const char *filter; + lance_namespace_buffer_t vector; + int32_t k; + const char *columns; +} lance_namespace_query_table_request_t; + +typedef struct lance_namespace_query_table_response { + lance_namespace_buffer_t data; +} lance_namespace_query_table_response_t; + +typedef struct lance_namespace_update_table_request { + const char *id; + const char *delimiter; + const char *updates; +} lance_namespace_update_table_request_t; + +typedef struct lance_namespace_update_table_response { + int64_t rows_updated; +} lance_namespace_update_table_response_t; + +typedef struct lance_namespace_delete_from_table_request { + const char *id; + const char *delimiter; + const char *predicate; +} lance_namespace_delete_from_table_request_t; + +typedef struct lance_namespace_delete_from_table_response { + int64_t rows_deleted; +} lance_namespace_delete_from_table_response_t; + +typedef struct lance_namespace_merge_insert_into_table_request { + const char *id; + const char *delimiter; + const char *branch; + const char *on; + int32_t when_matched_update_all; + const char *when_matched_update_all_filt; + int32_t when_not_matched_insert_all; + int32_t when_not_matched_by_source_delete; + const char *when_not_matched_by_source_delete_filt; + lance_namespace_buffer_t data; +} lance_namespace_merge_insert_into_table_request_t; + +typedef struct lance_namespace_merge_insert_into_table_response { + int64_t rows_inserted; + int64_t rows_updated; + int64_t rows_deleted; +} lance_namespace_merge_insert_into_table_response_t; + +typedef struct lance_namespace_rename_table_request { + const char *id; + const char *delimiter; + const char *new_id; +} lance_namespace_rename_table_request_t; + +typedef struct lance_namespace_rename_table_response { + // Empty response +} lance_namespace_rename_table_response_t; + +typedef struct lance_namespace_restore_table_request { + const char *id; + const char *delimiter; + int64_t version; +} lance_namespace_restore_table_request_t; + +typedef struct lance_namespace_restore_table_response { + // Empty response +} lance_namespace_restore_table_response_t; + +typedef struct lance_namespace_list_all_tables_request { + const char *delimiter; + const char *page_token; + int32_t limit; +} lance_namespace_list_all_tables_request_t; + +// ============================================================================ +// Table Index Operations +// ============================================================================ + +typedef struct lance_namespace_create_table_index_request { + const char *id; + const char *delimiter; + const char *index_name; + const char *index_type; + const char *distance_type; + const char *column; + int32_t num_partitions; + int32_t num_sub_vectors; + lance_namespace_map_t params; +} lance_namespace_create_table_index_request_t; + +typedef struct lance_namespace_create_table_index_response { + char *index_uuid; +} lance_namespace_create_table_index_response_t; + +typedef struct lance_namespace_create_table_scalar_index_response { + char *index_uuid; +} lance_namespace_create_table_scalar_index_response_t; + +typedef struct lance_namespace_list_table_indices_request { + const char *id; + const char *delimiter; + const char *page_token; + int32_t limit; +} lance_namespace_list_table_indices_request_t; + +typedef struct lance_namespace_table_index_info { + char *index_name; + char *index_type; + char *column; + char *index_uuid; + char *status; +} lance_namespace_table_index_info_t; + +typedef struct lance_namespace_list_table_indices_response { + lance_namespace_table_index_info_t *indices; + size_t count; + char *page_token; +} lance_namespace_list_table_indices_response_t; + +typedef struct lance_namespace_describe_table_index_stats_request { + const char *id; + const char *delimiter; + const char *index_name; +} lance_namespace_describe_table_index_stats_request_t; + +typedef struct lance_namespace_describe_table_index_stats_response { + char *index_type; + char *distance_type; + int64_t num_rows_indexed; + char *status; +} lance_namespace_describe_table_index_stats_response_t; + +typedef struct lance_namespace_drop_table_index_request { + const char *id; + const char *delimiter; + const char *index_name; +} lance_namespace_drop_table_index_request_t; + +typedef struct lance_namespace_drop_table_index_response { + // Empty response +} lance_namespace_drop_table_index_response_t; + +// ============================================================================ +// Table Version Operations +// ============================================================================ + +typedef struct lance_namespace_list_table_versions_request { + const char *id; + const char *delimiter; + const char *branch; + const char *page_token; + int32_t limit; + int32_t descending; +} lance_namespace_list_table_versions_request_t; + +typedef struct lance_namespace_table_version_info { + int64_t version; + char *manifest_path; + char *timestamp; + char *operation; +} lance_namespace_table_version_info_t; + +typedef struct lance_namespace_list_table_versions_response { + lance_namespace_table_version_info_t *versions; + size_t count; + char *page_token; +} lance_namespace_list_table_versions_response_t; + +typedef struct lance_namespace_create_table_version_request { + const char *id; + const char *delimiter; + int64_t version; + const char *manifest_path; + int32_t put_if_not_exists; +} lance_namespace_create_table_version_request_t; + +typedef struct lance_namespace_create_table_version_response { + int64_t version; + char *manifest_path; +} lance_namespace_create_table_version_response_t; + +typedef struct lance_namespace_describe_table_version_request { + const char *id; + const char *delimiter; + int64_t version; + const char *branch; +} lance_namespace_describe_table_version_request_t; + +typedef struct lance_namespace_describe_table_version_response { + int64_t version; + char *manifest_path; + char *timestamp; + char *operation; +} lance_namespace_describe_table_version_response_t; + +typedef struct lance_namespace_batch_delete_table_versions_request { + const char *id; + const char *delimiter; + int64_t start_version; + int64_t end_version; +} lance_namespace_batch_delete_table_versions_request_t; + +typedef struct lance_namespace_batch_delete_table_versions_response { + // Empty response +} lance_namespace_batch_delete_table_versions_response_t; + +typedef struct lance_namespace_create_table_version_entry { + const char *id; + int64_t version; + const char *manifest_path; +} lance_namespace_create_table_version_entry_t; + +typedef struct lance_namespace_batch_create_table_versions_request { + lance_namespace_create_table_version_entry_t *entries; + size_t count; + const char *delimiter; +} lance_namespace_batch_create_table_versions_request_t; + +typedef struct lance_namespace_batch_create_table_versions_response { + // Empty response +} lance_namespace_batch_create_table_versions_response_t; + +typedef struct lance_namespace_commit_table_operation { + const char *type; + const char *id; + lance_namespace_map_t properties; +} lance_namespace_commit_table_operation_t; + +typedef struct lance_namespace_batch_commit_tables_request { + lance_namespace_commit_table_operation_t *operations; + size_t count; + const char *delimiter; +} lance_namespace_batch_commit_tables_request_t; + +typedef struct lance_namespace_commit_table_result { + const char *id; + int32_t success; + char *error_message; +} lance_namespace_commit_table_result_t; + +typedef struct lance_namespace_batch_commit_tables_response { + lance_namespace_commit_table_result_t *results; + size_t count; +} lance_namespace_batch_commit_tables_response_t; + +// ============================================================================ +// Table Schema Operations +// ============================================================================ + +typedef struct lance_namespace_add_columns_entry { + char *name; + char *type; + char *value; +} lance_namespace_add_columns_entry_t; + +typedef struct lance_namespace_alter_table_add_columns_request { + const char *id; + const char *delimiter; + lance_namespace_add_columns_entry_t *columns; + size_t count; +} lance_namespace_alter_table_add_columns_request_t; + +typedef struct lance_namespace_alter_table_add_columns_response { + // Empty response +} lance_namespace_alter_table_add_columns_response_t; + +typedef struct lance_namespace_alter_columns_entry { + char *path; + char *rename; + char *data_type; + int32_t nullable; +} lance_namespace_alter_columns_entry_t; + +typedef struct lance_namespace_alter_table_alter_columns_request { + const char *id; + const char *delimiter; + lance_namespace_alter_columns_entry_t *columns; + size_t count; +} lance_namespace_alter_table_alter_columns_request_t; + +typedef struct lance_namespace_alter_table_alter_columns_response { + // Empty response +} lance_namespace_alter_table_alter_columns_response_t; + +typedef struct lance_namespace_alter_table_drop_columns_request { + const char *id; + const char *delimiter; + char **column_names; + size_t count; +} lance_namespace_alter_table_drop_columns_request_t; + +typedef struct lance_namespace_alter_table_drop_columns_response { + // Empty response +} lance_namespace_alter_table_drop_columns_response_t; + +typedef struct lance_namespace_alter_table_backfill_columns_request { + const char *id; + const char *delimiter; + char **column_names; + size_t count; +} lance_namespace_alter_table_backfill_columns_request_t; + +typedef struct lance_namespace_alter_table_backfill_columns_response { + char *job_id; +} lance_namespace_alter_table_backfill_columns_response_t; + +// ============================================================================ +// Table Metadata Operations +// ============================================================================ + +typedef struct lance_namespace_update_table_schema_metadata_request { + const char *id; + const char *delimiter; + const char *branch; + lance_namespace_map_t metadata; +} lance_namespace_update_table_schema_metadata_request_t; + +typedef struct lance_namespace_update_table_schema_metadata_response { + lance_namespace_map_t metadata; +} lance_namespace_update_table_schema_metadata_response_t; + +typedef struct lance_namespace_update_field_metadata_entry { + char *path; + lance_namespace_map_t metadata; + int32_t replace; +} lance_namespace_update_field_metadata_entry_t; + +typedef struct lance_namespace_update_field_metadata_request { + const char *id; + const char *delimiter; + lance_namespace_update_field_metadata_entry_t *entries; + size_t count; +} lance_namespace_update_field_metadata_request_t; + +typedef struct lance_namespace_update_field_metadata_response { + // Empty response +} lance_namespace_update_field_metadata_response_t; + +typedef struct lance_namespace_get_table_stats_request { + const char *id; + const char *delimiter; +} lance_namespace_get_table_stats_request_t; + +typedef struct lance_namespace_get_table_stats_response { + int64_t num_rows; + int64_t num_versions; + int64_t num_deleted_rows; + lance_namespace_map_t column_stats; +} lance_namespace_get_table_stats_response_t; + +// ============================================================================ +// Query Plan Operations +// ============================================================================ + +typedef struct lance_namespace_explain_table_query_plan_request { + const char *id; + const char *delimiter; + const char *query; +} lance_namespace_explain_table_query_plan_request_t; + +typedef struct lance_namespace_analyze_table_query_plan_request { + const char *id; + const char *delimiter; + const char *query; +} lance_namespace_analyze_table_query_plan_request_t; + +// ============================================================================ +// Table Tag Operations +// ============================================================================ + +typedef struct lance_namespace_list_table_tags_request { + const char *id; + const char *delimiter; + const char *page_token; + int32_t limit; +} lance_namespace_list_table_tags_request_t; + +typedef struct lance_namespace_table_tag_info { + char *tag_name; + int64_t version; +} lance_namespace_table_tag_info_t; + +typedef struct lance_namespace_list_table_tags_response { + lance_namespace_table_tag_info_t *tags; + size_t count; + char *page_token; +} lance_namespace_list_table_tags_response_t; + +typedef struct lance_namespace_get_table_tag_version_request { + const char *id; + const char *delimiter; + const char *tag_name; +} lance_namespace_get_table_tag_version_request_t; + +typedef struct lance_namespace_get_table_tag_version_response { + int64_t version; +} lance_namespace_get_table_tag_version_response_t; + +typedef struct lance_namespace_create_table_tag_request { + const char *id; + const char *delimiter; + const char *tag_name; + int64_t version; +} lance_namespace_create_table_tag_request_t; + +typedef struct lance_namespace_create_table_tag_response { + // Empty response +} lance_namespace_create_table_tag_response_t; + +typedef struct lance_namespace_delete_table_tag_request { + const char *id; + const char *delimiter; + const char *tag_name; +} lance_namespace_delete_table_tag_request_t; + +typedef struct lance_namespace_delete_table_tag_response { + // Empty response +} lance_namespace_delete_table_tag_response_t; + +typedef struct lance_namespace_update_table_tag_request { + const char *id; + const char *delimiter; + const char *tag_name; + int64_t version; +} lance_namespace_update_table_tag_request_t; + +typedef struct lance_namespace_update_table_tag_response { + // Empty response +} lance_namespace_update_table_tag_response_t; + +// ============================================================================ +// Table Branch Operations +// ============================================================================ + +typedef struct lance_namespace_create_table_branch_request { + const char *id; + const char *delimiter; + const char *branch; + int64_t source_version; + const char *source_branch; +} lance_namespace_create_table_branch_request_t; + +typedef struct lance_namespace_create_table_branch_response { + // Empty response +} lance_namespace_create_table_branch_response_t; + +typedef struct lance_namespace_list_table_branches_request { + const char *id; + const char *delimiter; + const char *page_token; + int32_t limit; +} lance_namespace_list_table_branches_request_t; + +typedef struct lance_namespace_table_branch_info { + char *branch_name; + int64_t version; +} lance_namespace_table_branch_info_t; + +typedef struct lance_namespace_list_table_branches_response { + lance_namespace_table_branch_info_t *branches; + size_t count; + char *page_token; +} lance_namespace_list_table_branches_response_t; + +typedef struct lance_namespace_delete_table_branch_request { + const char *id; + const char *delimiter; + const char *branch; +} lance_namespace_delete_table_branch_request_t; + +typedef struct lance_namespace_delete_table_branch_response { + // Empty response +} lance_namespace_delete_table_branch_response_t; + +// ============================================================================ +// Materialized View Operations +// ============================================================================ + +typedef struct lance_namespace_create_materialized_view_request { + const char *id; + const char *delimiter; + const char *kind; + const char *query; + lance_namespace_map_t properties; +} lance_namespace_create_materialized_view_request_t; + +typedef struct lance_namespace_create_materialized_view_response { + char *id; + char *location; +} lance_namespace_create_materialized_view_response_t; + +typedef struct lance_namespace_refresh_materialized_view_request { + const char *id; + const char *delimiter; + int64_t source_task_size; +} lance_namespace_refresh_materialized_view_request_t; + +typedef struct lance_namespace_refresh_materialized_view_response { + char *job_id; +} lance_namespace_refresh_materialized_view_response_t; + +// ============================================================================ +// Transaction Operations +// ============================================================================ + +typedef struct lance_namespace_describe_transaction_request { + const char *transaction_id; +} lance_namespace_describe_transaction_request_t; + +typedef struct lance_namespace_describe_transaction_response { + char *transaction_id; + char *status; + char *created_at; + char *updated_at; +} lance_namespace_describe_transaction_response_t; + +typedef struct lance_namespace_alter_transaction_request { + const char *transaction_id; + const char *action; + lance_namespace_map_t properties; +} lance_namespace_alter_transaction_request_t; + +typedef struct lance_namespace_alter_transaction_response { + char *transaction_id; + char *status; +} lance_namespace_alter_transaction_response_t; + +/* ============================================================================ + * Helper functions for creating and managing model types + * + * Use these functions to construct and destroy map and buffer types used + * in request and response structs. All functions are safe to call with + * zero-capacity/zero-size values. + * ==========================================================================*/ + +/** + * Create a key-value map with the given initial capacity. + * + * The map is initialized empty (count = 0). Use lance_namespace_map_set() + * to add entries. Must be freed with lance_namespace_map_free(). + * + * @param capacity Initial capacity hint (0 is valid for an empty map). + * @return An initialized map struct. + */ +LANCE_NAMESPACE_API lance_namespace_map_t lance_namespace_map_create(size_t capacity); + +/** + * Free all memory owned by a map, including string copies. + * + * After calling this function, the map's keys, values, and count are + * zeroed out. The struct itself is not freed (caller owns the struct). + * + * @param map Pointer to the map to free. Safe to pass NULL. + */ +LANCE_NAMESPACE_API void lance_namespace_map_free(lance_namespace_map_t *map); + +/** + * Set a key-value pair in the map. + * + * If the key already exists, its value is replaced. Both key and value + * strings are copied internally. + * + * @param map Pointer to the map. + * @param key The key string (copied internally). + * @param value The value string (copied internally), or NULL. + * @return 1 on success, 0 on failure (allocation error or NULL args). + */ +LANCE_NAMESPACE_API int lance_namespace_map_set(lance_namespace_map_t *map, const char *key, const char *value); + +/** + * Create a byte buffer with the given size. + * + * Memory is zero-initialized. Must be freed with + * lance_namespace_buffer_free(). + * + * @param size Number of bytes to allocate (0 is valid). + * @return An initialized buffer struct. + */ +LANCE_NAMESPACE_API lance_namespace_buffer_t lance_namespace_buffer_create(size_t size); + +/** + * Free all memory owned by a buffer. + * + * After calling this function, the buffer's data and size are zeroed out. + * The struct itself is not freed (caller owns the struct). + * + * @param buffer Pointer to the buffer to free. Safe to pass NULL. + */ +LANCE_NAMESPACE_API void lance_namespace_buffer_free(lance_namespace_buffer_t *buffer); + +#ifdef __cplusplus +} +#endif + +#endif // LANCE_NAMESPACE_MODELS_H diff --git a/cpp/lance_namespace/include/lance_namespace/namespace_operations.hpp b/cpp/lance_namespace/include/lance_namespace/namespace_operations.hpp new file mode 100644 index 000000000..293ee5b7a --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/namespace_operations.hpp @@ -0,0 +1,1107 @@ +/** + * @file namespace_operations.hpp + * @brief Base interface for Lance Namespace implementations. + * + * This module provides the NamespaceOperations abstract base class that + * defines the contract for namespace implementations that manage Lance tables. + * Implementations can provide different storage backends (directory-based, + * REST API, cloud catalogs, etc.). + * + * To create a custom namespace implementation, subclass NamespaceOperations + * and implement at least the namespace_id() method. Other methods have default + * implementations that raise UnsupportedOperationError. + * + * All operations may raise the following common errors: + * - UnsupportedOperationError: The operation is not supported by this backend + * - InvalidInputError: The request contains invalid parameters + * - PermissionDeniedError: The user lacks permission for this operation + * - UnauthenticatedError: Authentication credentials are missing or invalid + * - ServiceUnavailableError: The service is temporarily unavailable + * - InternalError: An unexpected internal error occurred + */ + +#ifndef LANCE_NAMESPACE_NAMESPACE_OPERATIONS_HPP +#define LANCE_NAMESPACE_NAMESPACE_OPERATIONS_HPP + +#include "errors.hpp" + +#include +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AlterTableAddColumnsRequest; +class AlterTableAddColumnsResponse; +class AlterTableAlterColumnsRequest; +class AlterTableAlterColumnsResponse; +class AlterTableBackfillColumnsRequest; +class AlterTableBackfillColumnsResponse; +class AlterTableDropColumnsRequest; +class AlterTableDropColumnsResponse; +class AlterTransactionRequest; +class AlterTransactionResponse; +class AnalyzeTableQueryPlanRequest; +class BatchCommitTablesRequest; +class BatchCommitTablesResponse; +class BatchCreateTableVersionsRequest; +class BatchCreateTableVersionsResponse; +class BatchDeleteTableVersionsRequest; +class BatchDeleteTableVersionsResponse; +class CountTableRowsRequest; +class CreateMaterializedViewRequest; +class CreateMaterializedViewResponse; +class CreateNamespaceRequest; +class CreateNamespaceResponse; +class CreateTableBranchRequest; +class CreateTableBranchResponse; +class CreateTableIndexRequest; +class CreateTableIndexResponse; +class CreateTableScalarIndexResponse; +class CreateTableRequest; +class CreateTableResponse; +class CreateTableTagRequest; +class CreateTableTagResponse; +class CreateTableVersionRequest; +class CreateTableVersionResponse; +class DeclareTableRequest; +class DeclareTableResponse; +class DeleteFromTableRequest; +class DeleteFromTableResponse; +class DeleteTableBranchRequest; +class DeleteTableBranchResponse; +class DeleteTableTagRequest; +class DeleteTableTagResponse; +class DeregisterTableRequest; +class DeregisterTableResponse; +class DescribeNamespaceRequest; +class DescribeNamespaceResponse; +class DescribeTableIndexStatsRequest; +class DescribeTableIndexStatsResponse; +class DescribeTableRequest; +class DescribeTableResponse; +class DescribeTableVersionRequest; +class DescribeTableVersionResponse; +class DescribeTransactionRequest; +class DescribeTransactionResponse; +class DropNamespaceRequest; +class DropNamespaceResponse; +class DropTableIndexRequest; +class DropTableIndexResponse; +class DropTableRequest; +class DropTableResponse; +class ExplainTableQueryPlanRequest; +class GetTableStatsRequest; +class GetTableStatsResponse; +class GetTableTagVersionRequest; +class GetTableTagVersionResponse; +class InsertIntoTableRequest; +class InsertIntoTableResponse; +class ListNamespacesRequest; +class ListNamespacesResponse; +class ListTableBranchesRequest; +class ListTableBranchesResponse; +class ListTableIndicesRequest; +class ListTableIndicesResponse; +class ListTableTagsRequest; +class ListTableTagsResponse; +class ListTableVersionsRequest; +class ListTableVersionsResponse; +class ListTablesRequest; +class ListTablesResponse; +class MergeInsertIntoTableRequest; +class MergeInsertIntoTableResponse; +class NamespaceExistsRequest; +class QueryTableRequest; +class RefreshMaterializedViewRequest; +class RefreshMaterializedViewResponse; +class RegisterTableRequest; +class RegisterTableResponse; +class RenameTableRequest; +class RenameTableResponse; +class RestoreTableRequest; +class RestoreTableResponse; +class TableExistsRequest; +class UpdateFieldMetadataRequest; +class UpdateFieldMetadataResponse; +class UpdateTableRequest; +class UpdateTableResponse; +class UpdateTableSchemaMetadataRequest; +class UpdateTableSchemaMetadataResponse; +class UpdateTableTagRequest; +class UpdateTableTagResponse; + +} +} +} +} + +namespace lance_namespace { + +using namespace org::openapitools::client::model; + +/** + * @brief Base interface for Lance Namespace implementations. + * + * This abstract base class defines the contract for namespace implementations + * that manage Lance tables. Implementations can provide different storage + * backends (directory-based, REST API, cloud catalogs, etc.). + * + * To create a custom namespace implementation, subclass this class and + * implement at least the namespace_id() method. Other methods have default + * implementations that raise UnsupportedOperationError. + * + * Native implementations (DirectoryNamespace, RestNamespace) are provided + * by the lance package. External integrations (Glue, Hive, Unity) can be + * registered using register_namespace_impl(). + */ +class NamespaceOperations { + public: + virtual ~NamespaceOperations() = default; + + /** + * @brief Return a human-readable unique identifier for this namespace instance. + * + * Used for equality comparison and hashing when the namespace is used as + * part of a storage options provider. Two namespace instances with the same + * ID are considered equal and will share cached resources. + * + * Examples: + * - REST namespace: "RestNamespace { uri: 'https://api.example.com' }" + * - Directory namespace: "DirectoryNamespace { root: '/path/to/data' }" + * + * @return A human-readable unique identifier string. + */ + virtual std::string namespace_id() const = 0; + + // ======================================================================== + // Namespace operations + // ======================================================================== + + /** + * @brief List namespaces. + * + * @param request The list namespaces request containing parent namespace ID + * and pagination parameters. + * @return List of child namespace names. + * @throws NamespaceNotFoundError If the parent namespace does not exist. + */ + virtual std::shared_ptr list_namespaces( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_namespaces"); + } + + /** + * @brief Describe a namespace. + * + * @param request The describe namespace request containing the namespace ID. + * @return Detailed namespace information including properties. + * @throws NamespaceNotFoundError If the namespace does not exist. + */ + virtual std::shared_ptr describe_namespace( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: describe_namespace"); + } + + /** + * @brief Create a new namespace. + * + * @param request The create namespace request containing the namespace ID + * and optional properties. + * @return The created namespace information. + * @throws NamespaceAlreadyExistsError If a namespace with the same name already exists. + */ + virtual std::shared_ptr create_namespace( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_namespace"); + } + + /** + * @brief Drop a namespace. + * + * @param request The drop namespace request containing the namespace ID. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws NamespaceNotEmptyError If the namespace contains tables or child namespaces. + */ + virtual std::shared_ptr drop_namespace( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: drop_namespace"); + } + + /** + * @brief Check if a namespace exists. + * + * Behaves exactly like describe_namespace(), except it does not contain + * a response body. + * + * @param request The namespace exists request containing the namespace ID. + * @throws NamespaceNotFoundError If the namespace does not exist. + */ + virtual void namespace_exists( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: namespace_exists"); + } + + /** + * @brief List tables in a namespace. + * + * @param request The list tables request containing the parent namespace ID + * and pagination parameters. + * @return List of table names in the namespace. + * @throws NamespaceNotFoundError If the namespace does not exist. + */ + virtual std::shared_ptr list_tables( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_tables"); + } + + // ======================================================================== + // Table operations + // ======================================================================== + + /** + * @brief Describe a table. + * + * @param request The describe table request containing the table ID. + * @return Detailed table information including location, version, and properties. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableVersionNotFoundError If the specified version does not exist. + */ + virtual std::shared_ptr describe_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: describe_table"); + } + + /** + * @brief Register a table. + * + * Register an existing table at a given storage location. + * + * @param request The register table request containing the table ID and location. + * @return The registered table information. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableAlreadyExistsError If a table with the same name already exists. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr register_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: register_table"); + } + + /** + * @brief Check if a table exists. + * + * Behaves exactly like describe_table(), except it does not contain + * a response body. + * + * @param request The table exists request containing the table ID. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual void table_exists( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: table_exists"); + } + + /** + * @brief Drop a table. + * + * Drop a table and delete its data. + * + * @param request The drop table request containing the table ID. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr drop_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: drop_table"); + } + + /** + * @brief Deregister a table. + * + * Deregister a table from its namespace without deleting the underlying data. + * + * @param request The deregister table request containing the table ID. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr deregister_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: deregister_table"); + } + + /** + * @brief Count rows in a table. + * + * @param request The count table rows request containing the table ID + * and optional version. + * @return The number of rows in the table. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableVersionNotFoundError If the specified version does not exist. + */ + virtual int64_t count_table_rows( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: count_table_rows"); + } + + /** + * @brief Create a new table with data from Arrow IPC stream. + * + * Create a table in the namespace with the given data in Arrow IPC stream. + * The schema of the Arrow IPC stream is used as the table schema. + * If the stream is empty, a new empty table is created. + * + * @param request The create table request containing the table ID, mode, + * and optional properties/storage options. + * @param request_data The Arrow IPC stream data for the initial table contents. + * @return The created table information including location and version. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableAlreadyExistsError If a table with the same name already exists. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws TableSchemaValidationError If the schema validation fails. + */ + virtual std::shared_ptr create_table( + std::shared_ptr request, + const std::vector &request_data) { + throw UnsupportedOperationError("Not supported: create_table"); + } + + /** + * @brief Declare a table (metadata only operation). + * + * Declare a table with the given name without touching storage. This is a + * metadata-only operation that records table existence and sets up aspects + * like access control. + * + * @param request The declare table request containing the table ID and + * optional properties. + * @return The declared table information. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableAlreadyExistsError If a table with the same name already exists. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr declare_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: declare_table"); + } + + /** + * @brief Insert data into a table. + * + * Insert new records into a table via Arrow IPC stream. For tables that have + * been declared but not yet created on storage, this operation will create + * the table with the provided data. + * + * @param request The insert request containing the table ID, mode, and + * optional branch. + * @param request_data The Arrow IPC stream containing records to insert. + * @return The insert result including the number of rows inserted. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws InvalidTableStateError If the table is in an invalid state. + * @throws TableSchemaValidationError If the schema validation fails. + */ + virtual std::shared_ptr insert_into_table( + std::shared_ptr request, + const std::vector &request_data) { + throw UnsupportedOperationError("Not supported: insert_into_table"); + } + + /** + * @brief Merge insert (upsert) data into a table. + * + * Performs a merge insert (upsert) operation on a table. This updates + * existing rows based on a matching column and inserts new rows that + * don't match. + * + * @param request The merge insert request containing the table ID, match + * column, and merge conditions. + * @param request_data The Arrow IPC stream containing records to merge. + * @return The merge result including row counts for inserted, updated, + * and deleted rows. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableColumnNotFoundError If a referenced column does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws InvalidTableStateError If the table is in an invalid state. + */ + virtual std::shared_ptr merge_insert_into_table( + std::shared_ptr request, + const std::vector &request_data) { + throw UnsupportedOperationError("Not supported: merge_insert_into_table"); + } + + /** + * @brief Update rows in a table. + * + * @param request The update table request containing the table ID and + * update expressions. + * @return The update result including the number of rows updated. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableColumnNotFoundError If a referenced column does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws InvalidTableStateError If the table is in an invalid state. + */ + virtual std::shared_ptr update_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: update_table"); + } + + /** + * @brief Delete rows from a table. + * + * @param request The delete request containing the table ID and predicate. + * @return The delete result including the number of rows deleted. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws InvalidTableStateError If the table is in an invalid state. + */ + virtual std::shared_ptr delete_from_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: delete_from_table"); + } + + /** + * @brief Query a table. + * + * Query a table with vector search, full text search and optional SQL + * filtering. Returns results in Arrow IPC file or stream format. + * + * @param request The query request containing the table ID, vector, + * filter, and other query parameters. + * @return Arrow IPC stream containing the query results. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableVersionNotFoundError If the specified version does not exist. + * @throws TableColumnNotFoundError If a referenced column does not exist. + */ + virtual std::vector query_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: query_table"); + } + + /** + * @brief List all tables across all namespaces. + * + * @param request The list tables request containing pagination parameters. + * @return List of all tables with their namespace information. + */ + virtual std::shared_ptr list_all_tables( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_all_tables"); + } + + /** + * @brief Rename a table. + * + * @param request The rename table request containing the table ID and new name. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableAlreadyExistsError If a table with the new name already exists. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr rename_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: rename_table"); + } + + /** + * @brief Restore a table to a specific version. + * + * @param request The restore table request containing the table ID and + * target version. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableVersionNotFoundError If the specified version does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr restore_table( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: restore_table"); + } + + // ======================================================================== + // Table index operations + // ======================================================================== + + /** + * @brief Create a table index. + * + * Create an index on a table field for faster search operations. Supports + * vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes + * (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. + * + * @param request The create table index request containing the table ID, + * index name, type, and configuration. + * @return The created index information including UUID. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableIndexAlreadyExistsError If an index with the same name already exists. + * @throws TableColumnNotFoundError If a referenced column does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr create_table_index( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_table_index"); + } + + /** + * @brief Create a scalar index on a table. + * + * Create a scalar index on a table field for faster filtering operations. + * Supports BTREE, BITMAP, LABEL_LIST, FTS, etc. This is an alias for + * create_table_index specifically for scalar indexes. + * + * @param request The create table index request containing the table ID, + * index name, type, and configuration. + * @return The created scalar index information including UUID. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableIndexAlreadyExistsError If an index with the same name already exists. + * @throws TableColumnNotFoundError If a referenced column does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr create_table_scalar_index( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_table_scalar_index"); + } + + /** + * @brief List table indices. + * + * @param request The list table indices request containing the table ID + * and pagination parameters. + * @return List of indices with their name, type, status, and UUID. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr list_table_indices( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_table_indices"); + } + + /** + * @brief Describe table index statistics. + * + * Get statistics for a specific index on a table, including index type, + * distance type (for vector indices), and row counts. + * + * @param request The describe table index stats request containing the + * table ID and index name. + * @return Index statistics including type, distance type, and row count. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableIndexNotFoundError If the index does not exist. + */ + virtual std::shared_ptr describe_table_index_stats( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: describe_table_index_stats"); + } + + /** + * @brief Drop a table index. + * + * @param request The drop table index request containing the table ID + * and index name. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableIndexNotFoundError If the index does not exist. + */ + virtual std::shared_ptr drop_table_index( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: drop_table_index"); + } + + // ======================================================================== + // Table version operations + // ======================================================================== + + /** + * @brief List all versions of a table. + * + * @param request The list table versions request containing the table ID + * and pagination parameters. + * @return List of table versions with their manifest paths and metadata. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr list_table_versions( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_table_versions"); + } + + /** + * @brief Create a new table version entry. + * + * This operation supports put_if_not_exists semantics: the operation fails + * if the version already exists. + * + * @param request The create table version request containing the table ID, + * version number, and manifest path. + * @return The created version information. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws ConcurrentModificationError If the version already exists. + */ + virtual std::shared_ptr create_table_version( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_table_version"); + } + + /** + * @brief Describe a specific table version. + * + * Returns the manifest path and metadata for the specified version. + * + * @param request The describe table version request containing the table ID + * and version number. + * @return Version details including manifest path and timestamp. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableVersionNotFoundError If the specified version does not exist. + */ + virtual std::shared_ptr describe_table_version( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: describe_table_version"); + } + + /** + * @brief Delete table version metadata records. + * + * This deletes version tracking records, NOT the actual table data. + * It supports deleting ranges of versions for efficient bulk cleanup. + * + * @param request The batch delete request containing the table ID and + * version range (start_version, end_version). + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr batch_delete_table_versions( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: batch_delete_table_versions"); + } + + /** + * @brief Atomically create new version entries for multiple tables. + * + * This operation is atomic: either all table versions are created + * successfully, or none are created. Each entry supports + * put_if_not_exists semantics. + * + * @param request The batch create request containing multiple table + * version entries. + * @return Empty response on success. + * @throws NamespaceNotFoundError If any namespace does not exist. + * @throws TableNotFoundError If any table does not exist. + * @throws ConcurrentModificationError If any version already exists. + */ + virtual std::shared_ptr batch_create_table_versions( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: batch_create_table_versions"); + } + + /** + * @brief Atomically commit a batch of mixed table operations. + * + * This is a generalized version of batch_create_table_versions that supports + * mixed operation types (DeclareTable, CreateTableVersion, + * DeleteTableVersions, DeregisterTable) within a single atomic transaction + * at the metadata layer. + * + * @param request The batch commit request containing multiple operations. + * @return Results for each operation in the batch. + * @throws NamespaceNotFoundError If any namespace does not exist. + * @throws TableNotFoundError If any table does not exist. + * @throws ConcurrentModificationError If any operation conflicts. + */ + virtual std::shared_ptr batch_commit_tables( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: batch_commit_tables"); + } + + // ======================================================================== + // Table schema operations + // ======================================================================== + + /** + * @brief Add columns to a table. + * + * Add new columns to a table using SQL expressions or default values. + * + * @param request The add columns request containing the table ID and + * column definitions. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws TableSchemaValidationError If the schema validation fails. + */ + virtual std::shared_ptr alter_table_add_columns( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: alter_table_add_columns"); + } + + /** + * @brief Alter columns in a table. + * + * Modify existing columns in a table, such as renaming or changing + * data types. + * + * @param request The alter columns request containing the table ID and + * column modifications. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableColumnNotFoundError If a referenced column does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + * @throws TableSchemaValidationError If the schema validation fails. + */ + virtual std::shared_ptr alter_table_alter_columns( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: alter_table_alter_columns"); + } + + /** + * @brief Drop columns from a table. + * + * @param request The drop columns request containing the table ID and + * column names to remove. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableColumnNotFoundError If a referenced column does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr alter_table_drop_columns( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: alter_table_drop_columns"); + } + + /** + * @brief Trigger an async backfill job for a computed column. + * + * @param request The backfill columns request containing the table ID and + * column names to backfill. + * @return Response containing the async job ID. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr alter_table_backfill_columns( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: alter_table_backfill_columns"); + } + + // ======================================================================== + // Table metadata operations + // ======================================================================== + + /** + * @brief Update table schema metadata. + * + * Replace the schema metadata with the provided key-value pairs. + * + * @param request The update schema metadata request containing the table ID + * and metadata key-value pairs. + * @return The updated metadata. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr update_table_schema_metadata( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: update_table_schema_metadata"); + } + + /** + * @brief Update per-field metadata. + * + * Each entry targets a field by path and merges the provided key-value + * pairs into that field's existing metadata, or replaces it when the + * replace flag is true. A null metadata value deletes that key. + * + * @param request The update field metadata request containing the table ID + * and field metadata entries. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr update_field_metadata( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: update_field_metadata"); + } + + /** + * @brief Get table statistics. + * + * Get statistics for a table, including row counts, data sizes, + * and column statistics. + * + * @param request The get table stats request containing the table ID. + * @return Table statistics including row count, version count, and column stats. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr get_table_stats( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: get_table_stats"); + } + + // ======================================================================== + // Query plan operations + // ======================================================================== + + /** + * @brief Explain a table query plan. + * + * Get a human-readable explanation of how a query will be executed. + * + * @param request The explain query plan request containing the table ID + * and query definition. + * @return A human-readable query plan explanation string. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::string explain_table_query_plan( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: explain_table_query_plan"); + } + + /** + * @brief Analyze a table query plan. + * + * Execute the query and return detailed statistics and analysis of + * the query execution plan. + * + * @param request The analyze query plan request containing the table ID + * and query definition. + * @return A detailed analysis string with execution statistics. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::string analyze_table_query_plan( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: analyze_table_query_plan"); + } + + // ======================================================================== + // Table tag operations + // ======================================================================== + + /** + * @brief List all tags for a table. + * + * @param request The list table tags request containing the table ID + * and pagination parameters. + * @return List of tags with their names and corresponding versions. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr list_table_tags( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_table_tags"); + } + + /** + * @brief Get the version for a specific tag. + * + * @param request The get table tag version request containing the table ID + * and tag name. + * @return The version number that the tag points to. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableTagNotFoundError If the tag does not exist. + */ + virtual std::shared_ptr get_table_tag_version( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: get_table_tag_version"); + } + + /** + * @brief Create a tag for a table. + * + * Create a new tag that points to a specific version. + * + * @param request The create table tag request containing the table ID, + * tag name, and target version. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableTagAlreadyExistsError If a tag with the same name already exists. + * @throws TableVersionNotFoundError If the specified version does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr create_table_tag( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_table_tag"); + } + + /** + * @brief Delete a tag from a table. + * + * @param request The delete table tag request containing the table ID + * and tag name. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableTagNotFoundError If the tag does not exist. + */ + virtual std::shared_ptr delete_table_tag( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: delete_table_tag"); + } + + /** + * @brief Update a tag to point to a different version. + * + * @param request The update table tag request containing the table ID, + * tag name, and new target version. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableTagNotFoundError If the tag does not exist. + * @throws TableVersionNotFoundError If the specified version does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr update_table_tag( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: update_table_tag"); + } + + // ======================================================================== + // Table branch operations + // ======================================================================== + + /** + * @brief Create a branch for a table. + * + * Create a new branch starting from a source ref (another branch and/or + * version), defaulting to the latest version of the main branch. + * + * @param request The create table branch request containing the table ID, + * branch name, and optional source version/branch. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + * @throws TableVersionNotFoundError If the source version does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr create_table_branch( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_table_branch"); + } + + /** + * @brief List all branches for a table. + * + * @param request The list table branches request containing the table ID + * and pagination parameters. + * @return List of branches with their names and version information. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr list_table_branches( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: list_table_branches"); + } + + /** + * @brief Delete a branch from a table. + * + * @param request The delete table branch request containing the table ID + * and branch name. + * @return Empty response on success. + * @throws NamespaceNotFoundError If the namespace does not exist. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr delete_table_branch( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: delete_table_branch"); + } + + // ======================================================================== + // Materialized view operations + // ======================================================================== + + /** + * @brief Create a materialized view. + * + * The view may be query-backed, UDTF-backed, or chunker-backed, + * controlled by the kind discriminator. + * + * @param request The create materialized view request containing the view ID, + * kind, query, and optional properties. + * @return The created materialized view information. + * @throws TableAlreadyExistsError If a table with the same identifier already exists. + */ + virtual std::shared_ptr create_materialized_view( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: create_materialized_view"); + } + + /** + * @brief Trigger an async materialized view refresh. + * + * @param request The refresh materialized view request containing the view ID + * and optional source task size. + * @return Response containing the async job ID. + * @throws TableNotFoundError If the table does not exist. + */ + virtual std::shared_ptr refresh_materialized_view( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: refresh_materialized_view"); + } + + // ======================================================================== + // Transaction operations + // ======================================================================== + + /** + * @brief Describe a transaction. + * + * @param request The describe transaction request containing the transaction ID. + * @return Transaction details including status and timestamps. + * @throws TransactionNotFoundError If the transaction does not exist. + */ + virtual std::shared_ptr describe_transaction( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: describe_transaction"); + } + + /** + * @brief Alter a transaction. + * + * Modify a transaction's status, set/unset properties, or perform + * other alterations. + * + * @param request The alter transaction request containing the transaction ID + * and the alteration to perform. + * @return The updated transaction information. + * @throws TransactionNotFoundError If the transaction does not exist. + * @throws ConcurrentModificationError If a concurrent modification conflict occurs. + */ + virtual std::shared_ptr alter_transaction( + std::shared_ptr request) { + throw UnsupportedOperationError("Not supported: alter_transaction"); + } +}; + +} // namespace lance_namespace + +#endif // LANCE_NAMESPACE_NAMESPACE_OPERATIONS_HPP diff --git a/cpp/lance_namespace/include/lance_namespace/operations.h b/cpp/lance_namespace/include/lance_namespace/operations.h new file mode 100644 index 000000000..ef71faddd --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/operations.h @@ -0,0 +1,941 @@ +/** + * @file operations.h + * @brief C API operation functions for Lance Namespace. + * + * This header declares all namespace operation functions available through + * the C API. Each function takes a namespace handle, a request struct, + * an output response struct (or output parameter), and an error struct. + * + * All functions return lance_namespace_status_t: + * - LANCE_NAMESPACE_STATUS_OK on success + * - LANCE_NAMESPACE_STATUS_UNSUPPORTED if the operation is not supported + * - LANCE_NAMESPACE_STATUS_NOT_FOUND if a resource was not found + * - LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if a resource already exists + * - LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT for invalid parameters + * - LANCE_NAMESPACE_STATUS_INTERNAL for unexpected errors + * + * On failure, the error struct is populated with a code and message. + * Callers must call lance_namespace_error_free() on the error struct. + */ + +#ifndef LANCE_NAMESPACE_OPERATIONS_H +#define LANCE_NAMESPACE_OPERATIONS_H + +#include "lance_namespace.h" +#include "models.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* ============================================================================ + * Namespace Operations + * ==========================================================================*/ + +/** + * List child namespaces of a parent namespace. + * + * @param handle The namespace handle. + * @param request List namespaces request with parent ID and pagination. + * @param response Output: list of child namespace names. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_namespaces( + lance_namespace_handle_t *handle, + const lance_namespace_list_namespaces_request_t *request, + lance_namespace_list_namespaces_response_t *response, + lance_namespace_error_t *error); + +/** + * Describe a namespace and return its properties. + * + * @param handle The namespace handle. + * @param request Describe namespace request with the namespace ID. + * @param response Output: namespace details including properties. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_describe_namespace( + lance_namespace_handle_t *handle, + const lance_namespace_describe_namespace_request_t *request, + lance_namespace_describe_namespace_response_t *response, + lance_namespace_error_t *error); + +/** + * Create a new namespace. + * + * @param handle The namespace handle. + * @param request Create namespace request with ID and optional properties. + * @param response Output: created namespace information. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if it already exists. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_namespace( + lance_namespace_handle_t *handle, + const lance_namespace_create_namespace_request_t *request, + lance_namespace_create_namespace_response_t *response, + lance_namespace_error_t *error); + +/** + * Drop a namespace from its parent. + * + * @param handle The namespace handle. + * @param request Drop namespace request with the namespace ID. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_NOT_FOUND if it does not exist. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_drop_namespace( + lance_namespace_handle_t *handle, + const lance_namespace_drop_namespace_request_t *request, + lance_namespace_drop_namespace_response_t *response, + lance_namespace_error_t *error); + +/** + * Check if a namespace exists. + * + * Behaves like describe_namespace but returns no response body. + * + * @param handle The namespace handle. + * @param request Namespace exists request with the namespace ID. + * @param error Output: error details if namespace does not exist. + * @return LANCE_NAMESPACE_STATUS_OK if exists, + * LANCE_NAMESPACE_STATUS_NOT_FOUND otherwise. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_namespace_exists( + lance_namespace_handle_t *handle, + const lance_namespace_namespace_exists_request_t *request, + lance_namespace_error_t *error); + +/** + * List tables in a namespace. + * + * @param handle The namespace handle. + * @param request List tables request with parent namespace ID and pagination. + * @param response Output: list of table names. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_tables( + lance_namespace_handle_t *handle, + const lance_namespace_list_tables_request_t *request, + lance_namespace_list_tables_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Operations + * ==========================================================================*/ + +/** + * Describe a table and return its metadata. + * + * @param handle The namespace handle. + * @param request Describe table request with the table ID. + * @param response Output: table details (location, version, properties). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_describe_table( + lance_namespace_handle_t *handle, + const lance_namespace_describe_table_request_t *request, + lance_namespace_describe_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Register an existing table at a storage location. + * + * @param handle The namespace handle. + * @param request Register table request with ID and storage location. + * @param response Output: registered table information. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if table already exists. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_register_table( + lance_namespace_handle_t *handle, + const lance_namespace_register_table_request_t *request, + lance_namespace_register_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Check if a table exists. + * + * Behaves like describe_table but returns no response body. + * + * @param handle The namespace handle. + * @param request Table exists request with the table ID. + * @param error Output: error details if table does not exist. + * @return LANCE_NAMESPACE_STATUS_OK if exists, + * LANCE_NAMESPACE_STATUS_NOT_FOUND otherwise. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_table_exists( + lance_namespace_handle_t *handle, + const lance_namespace_table_exists_request_t *request, + lance_namespace_error_t *error); + +/** + * Drop a table and delete its data. + * + * @param handle The namespace handle. + * @param request Drop table request with the table ID. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_drop_table( + lance_namespace_handle_t *handle, + const lance_namespace_drop_table_request_t *request, + lance_namespace_drop_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Deregister a table without deleting underlying data. + * + * @param handle The namespace handle. + * @param request Deregister table request with the table ID. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_deregister_table( + lance_namespace_handle_t *handle, + const lance_namespace_deregister_table_request_t *request, + lance_namespace_deregister_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Count the number of rows in a table. + * + * @param handle The namespace handle. + * @param request Count table rows request with table ID and optional version. + * @param out_count Output: the row count. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_count_table_rows( + lance_namespace_handle_t *handle, + const lance_namespace_count_table_rows_request_t *request, + int64_t *out_count, + lance_namespace_error_t *error); + +/** + * Create a new table with data from an Arrow IPC stream. + * + * The schema of the Arrow IPC stream is used as the table schema. + * If the stream is empty, an empty table is created. + * + * @param handle The namespace handle. + * @param request Create table request with ID, mode, properties, and data. + * @param response Output: created table info (location, version). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if table already exists. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_table( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_request_t *request, + lance_namespace_create_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Declare a table (metadata-only operation, does not touch storage). + * + * Records table existence and sets up access control without creating + * actual Lance data files. + * + * @param handle The namespace handle. + * @param request Declare table request with ID and optional properties. + * @param response Output: declared table information. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_declare_table( + lance_namespace_handle_t *handle, + const lance_namespace_declare_table_request_t *request, + lance_namespace_declare_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Insert records into a table via Arrow IPC stream. + * + * For declared-but-not-created tables, this creates the table with the + * provided data. + * + * @param handle The namespace handle. + * @param request Insert request with table ID, mode, branch, and data. + * @param response Output: number of rows inserted. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_insert_into_table( + lance_namespace_handle_t *handle, + const lance_namespace_insert_into_table_request_t *request, + lance_namespace_insert_into_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Merge insert (upsert) records into a table via Arrow IPC stream. + * + * Updates existing rows based on a matching column and inserts new rows + * that don't match. + * + * @param handle The namespace handle. + * @param request Merge insert request with match column and conditions. + * @param response Output: counts for inserted, updated, deleted rows. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_merge_insert_into_table( + lance_namespace_handle_t *handle, + const lance_namespace_merge_insert_into_table_request_t *request, + lance_namespace_merge_insert_into_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Update existing rows in a table. + * + * @param handle The namespace handle. + * @param request Update request with table ID and update expressions. + * @param response Output: number of rows updated. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_update_table( + lance_namespace_handle_t *handle, + const lance_namespace_update_table_request_t *request, + lance_namespace_update_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Delete rows from a table matching a predicate. + * + * @param handle The namespace handle. + * @param request Delete request with table ID and predicate. + * @param response Output: number of rows deleted. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_delete_from_table( + lance_namespace_handle_t *handle, + const lance_namespace_delete_from_table_request_t *request, + lance_namespace_delete_from_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Query a table with vector search, full text search, and SQL filtering. + * + * Returns results in Arrow IPC file or stream format. + * + * @param handle The namespace handle. + * @param request Query request with vector, filter, and parameters. + * @param out_data Output: Arrow IPC stream buffer (must be freed). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_query_table( + lance_namespace_handle_t *handle, + const lance_namespace_query_table_request_t *request, + lance_namespace_buffer_t *out_data, + lance_namespace_error_t *error); + +/** + * List all tables across all namespaces. + * + * @param handle The namespace handle. + * @param request List all tables request with pagination. + * @param response Output: list of all tables. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_all_tables( + lance_namespace_handle_t *handle, + const lance_namespace_list_all_tables_request_t *request, + lance_namespace_list_tables_response_t *response, + lance_namespace_error_t *error); + +/** + * Rename a table to a new name. + * + * @param handle The namespace handle. + * @param request Rename table request with table ID and new name. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_rename_table( + lance_namespace_handle_t *handle, + const lance_namespace_rename_table_request_t *request, + lance_namespace_rename_table_response_t *response, + lance_namespace_error_t *error); + +/** + * Restore a table to a specific version. + * + * @param handle The namespace handle. + * @param request Restore table request with table ID and target version. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_restore_table( + lance_namespace_handle_t *handle, + const lance_namespace_restore_table_request_t *request, + lance_namespace_restore_table_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Index Operations + * ==========================================================================*/ + +/** + * Create an index on a table for faster search. + * + * Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and + * scalar indexes (BTREE, BITMAP, FTS, etc.). Creation is asynchronous. + * + * @param handle The namespace handle. + * @param request Create index request with table ID, name, type, config. + * @param response Output: created index UUID. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_table_index( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_index_request_t *request, + lance_namespace_create_table_index_response_t *response, + lance_namespace_error_t *error); + +/** + * Create a scalar index on a table for faster filtering. + * + * Supports BTREE, BITMAP, LABEL_LIST, FTS, etc. This is an alias for + * create_table_index specifically for scalar indexes. + * + * @param handle The namespace handle. + * @param request Create index request with table ID, name, type, config. + * @param response Output: created scalar index UUID. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_table_scalar_index( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_index_request_t *request, + lance_namespace_create_table_scalar_index_response_t *response, + lance_namespace_error_t *error); + +/** + * List all indices on a table. + * + * @param handle The namespace handle. + * @param request List indices request with table ID and pagination. + * @param response Output: list of index info (name, type, status, UUID). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_table_indices( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_indices_request_t *request, + lance_namespace_list_table_indices_response_t *response, + lance_namespace_error_t *error); + +/** + * Get statistics for a specific index on a table. + * + * @param handle The namespace handle. + * @param request Describe index stats request with table ID and index name. + * @param response Output: index statistics (type, distance, row count). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_describe_table_index_stats( + lance_namespace_handle_t *handle, + const lance_namespace_describe_table_index_stats_request_t *request, + lance_namespace_describe_table_index_stats_response_t *response, + lance_namespace_error_t *error); + +/** + * Drop an index from a table. + * + * @param handle The namespace handle. + * @param request Drop index request with table ID and index name. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_drop_table_index( + lance_namespace_handle_t *handle, + const lance_namespace_drop_table_index_request_t *request, + lance_namespace_drop_table_index_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Version Operations + * ==========================================================================*/ + +/** + * List all versions (commits) of a table. + * + * @param handle The namespace handle. + * @param request List versions request with table ID and pagination. + * @param response Output: list of version info (version, manifest, timestamp). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_table_versions( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_versions_request_t *request, + lance_namespace_list_table_versions_response_t *response, + lance_namespace_error_t *error); + +/** + * Create a new version entry for a table. + * + * Supports put_if_not_exists semantics: fails if version already exists. + * + * @param handle The namespace handle. + * @param request Create version request with table ID, version, manifest path. + * @param response Output: created version information. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if version exists. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_table_version( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_version_request_t *request, + lance_namespace_create_table_version_response_t *response, + lance_namespace_error_t *error); + +/** + * Describe a specific table version. + * + * @param handle The namespace handle. + * @param request Describe version request with table ID and version number. + * @param response Output: version details (manifest path, timestamp, operation). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_describe_table_version( + lance_namespace_handle_t *handle, + const lance_namespace_describe_table_version_request_t *request, + lance_namespace_describe_table_version_response_t *response, + lance_namespace_error_t *error); + +/** + * Delete table version metadata records. + * + * Deletes version tracking records, NOT the actual table data. Supports + * deleting ranges of versions for efficient bulk cleanup. + * + * @param handle The namespace handle. + * @param request Batch delete request with table ID and version range. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_batch_delete_table_versions( + lance_namespace_handle_t *handle, + const lance_namespace_batch_delete_table_versions_request_t *request, + lance_namespace_batch_delete_table_versions_response_t *response, + lance_namespace_error_t *error); + +/** + * Atomically create version entries for multiple tables. + * + * Either all versions are created or none are. Each entry supports + * put_if_not_exists semantics. + * + * @param handle The namespace handle. + * @param request Batch create request with multiple version entries. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_batch_create_table_versions( + lance_namespace_handle_t *handle, + const lance_namespace_batch_create_table_versions_request_t *request, + lance_namespace_batch_create_table_versions_response_t *response, + lance_namespace_error_t *error); + +/** + * Atomically commit a batch of mixed table operations. + * + * Supports DeclareTable, CreateTableVersion, DeleteTableVersions, and + * DeregisterTable operations within a single atomic transaction. + * + * @param handle The namespace handle. + * @param request Batch commit request with multiple operations. + * @param response Output: per-operation results. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_batch_commit_tables( + lance_namespace_handle_t *handle, + const lance_namespace_batch_commit_tables_request_t *request, + lance_namespace_batch_commit_tables_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Schema Operations + * ==========================================================================*/ + +/** + * Add new columns to a table schema. + * + * @param handle The namespace handle. + * @param request Add columns request with table ID and column definitions. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_alter_table_add_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_add_columns_request_t *request, + lance_namespace_alter_table_add_columns_response_t *response, + lance_namespace_error_t *error); + +/** + * Modify existing columns (rename, change types, set nullable). + * + * @param handle The namespace handle. + * @param request Alter columns request with table ID and modifications. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_alter_table_alter_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_alter_columns_request_t *request, + lance_namespace_alter_table_alter_columns_response_t *response, + lance_namespace_error_t *error); + +/** + * Remove columns from a table. + * + * @param handle The namespace handle. + * @param request Drop columns request with table ID and column names. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_alter_table_drop_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_drop_columns_request_t *request, + lance_namespace_alter_table_drop_columns_response_t *response, + lance_namespace_error_t *error); + +/** + * Trigger an async backfill job for computed columns. + * + * @param handle The namespace handle. + * @param request Backfill columns request with table ID and column names. + * @param response Output: async job ID. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_alter_table_backfill_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_backfill_columns_request_t *request, + lance_namespace_alter_table_backfill_columns_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Metadata Operations + * ==========================================================================*/ + +/** + * Replace schema metadata with provided key-value pairs. + * + * @param handle The namespace handle. + * @param request Update schema metadata request with table ID and metadata. + * @param response Output: the updated metadata. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_update_table_schema_metadata( + lance_namespace_handle_t *handle, + const lance_namespace_update_table_schema_metadata_request_t *request, + lance_namespace_update_table_schema_metadata_response_t *response, + lance_namespace_error_t *error); + +/** + * Update per-field (column) metadata. + * + * Each entry targets a field by path and merges key-value pairs into + * existing metadata, or replaces when the replace flag is set. + * + * @param handle The namespace handle. + * @param request Update field metadata request with entries. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_update_field_metadata( + lance_namespace_handle_t *handle, + const lance_namespace_update_field_metadata_request_t *request, + lance_namespace_update_field_metadata_response_t *response, + lance_namespace_error_t *error); + +/** + * Get table statistics (row counts, version counts, column stats). + * + * @param handle The namespace handle. + * @param request Get table stats request with the table ID. + * @param response Output: table statistics. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_get_table_stats( + lance_namespace_handle_t *handle, + const lance_namespace_get_table_stats_request_t *request, + lance_namespace_get_table_stats_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Query Plan Operations + * ==========================================================================*/ + +/** + * Get a human-readable explanation of a query execution plan. + * + * @param handle The namespace handle. + * @param request Explain query plan request with table ID and query. + * @param out_plan Output: allocated plan string (caller must free). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_explain_table_query_plan( + lance_namespace_handle_t *handle, + const lance_namespace_explain_table_query_plan_request_t *request, + char **out_plan, + lance_namespace_error_t *error); + +/** + * Analyze a query execution plan with actual execution statistics. + * + * @param handle The namespace handle. + * @param request Analyze query plan request with table ID and query. + * @param out_analysis Output: allocated analysis string (caller must free). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_analyze_table_query_plan( + lance_namespace_handle_t *handle, + const lance_namespace_analyze_table_query_plan_request_t *request, + char **out_analysis, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Tag Operations + * ==========================================================================*/ + +/** + * List all tags for a table. + * + * @param handle The namespace handle. + * @param request List tags request with table ID and pagination. + * @param response Output: list of tags (name, version). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_table_tags( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_tags_request_t *request, + lance_namespace_list_table_tags_response_t *response, + lance_namespace_error_t *error); + +/** + * Get the version number that a specific tag points to. + * + * @param handle The namespace handle. + * @param request Get tag version request with table ID and tag name. + * @param response Output: the version number. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_get_table_tag_version( + lance_namespace_handle_t *handle, + const lance_namespace_get_table_tag_version_request_t *request, + lance_namespace_get_table_tag_version_response_t *response, + lance_namespace_error_t *error); + +/** + * Create a new tag pointing to a specific version. + * + * @param handle The namespace handle. + * @param request Create tag request with table ID, tag name, version. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if tag exists. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_table_tag( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_tag_request_t *request, + lance_namespace_create_table_tag_response_t *response, + lance_namespace_error_t *error); + +/** + * Delete a tag from a table. + * + * @param handle The namespace handle. + * @param request Delete tag request with table ID and tag name. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_NOT_FOUND if tag does not exist. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_delete_table_tag( + lance_namespace_handle_t *handle, + const lance_namespace_delete_table_tag_request_t *request, + lance_namespace_delete_table_tag_response_t *response, + lance_namespace_error_t *error); + +/** + * Update a tag to point to a different version. + * + * @param handle The namespace handle. + * @param request Update tag request with table ID, tag name, new version. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_update_table_tag( + lance_namespace_handle_t *handle, + const lance_namespace_update_table_tag_request_t *request, + lance_namespace_update_table_tag_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Table Branch Operations + * ==========================================================================*/ + +/** + * Create a new branch for a table. + * + * Starts from a source ref (another branch and/or version), defaulting + * to the latest version of the main branch. + * + * @param handle The namespace handle. + * @param request Create branch request with table ID, branch name, + * and optional source version/branch. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_table_branch( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_branch_request_t *request, + lance_namespace_create_table_branch_response_t *response, + lance_namespace_error_t *error); + +/** + * List all branches for a table. + * + * @param handle The namespace handle. + * @param request List branches request with table ID and pagination. + * @param response Output: list of branches (name, version). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_list_table_branches( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_branches_request_t *request, + lance_namespace_list_table_branches_response_t *response, + lance_namespace_error_t *error); + +/** + * Delete a branch from a table. + * + * @param handle The namespace handle. + * @param request Delete branch request with table ID and branch name. + * @param response Output: empty on success. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_delete_table_branch( + lance_namespace_handle_t *handle, + const lance_namespace_delete_table_branch_request_t *request, + lance_namespace_delete_table_branch_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Materialized View Operations + * ==========================================================================*/ + +/** + * Create a materialized view. + * + * The view may be query-backed, UDTF-backed, or chunker-backed, + * controlled by the kind discriminator. + * + * @param handle The namespace handle. + * @param request Create MV request with view ID, kind, query, properties. + * @param response Output: created view information (ID, location). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_ALREADY_EXISTS if view exists. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_create_materialized_view( + lance_namespace_handle_t *handle, + const lance_namespace_create_materialized_view_request_t *request, + lance_namespace_create_materialized_view_response_t *response, + lance_namespace_error_t *error); + +/** + * Trigger an async materialized view refresh. + * + * @param handle The namespace handle. + * @param request Refresh MV request with view ID and optional task size. + * @param response Output: async job ID. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_refresh_materialized_view( + lance_namespace_handle_t *handle, + const lance_namespace_refresh_materialized_view_request_t *request, + lance_namespace_refresh_materialized_view_response_t *response, + lance_namespace_error_t *error); + +/* ============================================================================ + * Transaction Operations + * ==========================================================================*/ + +/** + * Describe a transaction. + * + * @param handle The namespace handle. + * @param request Describe transaction request with transaction ID. + * @param response Output: transaction details (status, timestamps). + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, + * LANCE_NAMESPACE_STATUS_NOT_FOUND if transaction does not exist. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_describe_transaction( + lance_namespace_handle_t *handle, + const lance_namespace_describe_transaction_request_t *request, + lance_namespace_describe_transaction_response_t *response, + lance_namespace_error_t *error); + +/** + * Alter a transaction (set status, set/unset properties). + * + * @param handle The namespace handle. + * @param request Alter transaction request with transaction ID and action. + * @param response Output: updated transaction information. + * @param error Output: error details on failure (must be freed). + * @return LANCE_NAMESPACE_STATUS_OK on success, or an error status. + */ +LANCE_NAMESPACE_API lance_namespace_status_t lance_namespace_alter_transaction( + lance_namespace_handle_t *handle, + const lance_namespace_alter_transaction_request_t *request, + lance_namespace_alter_transaction_response_t *response, + lance_namespace_error_t *error); + +#ifdef __cplusplus +} +#endif + +#endif // LANCE_NAMESPACE_OPERATIONS_H diff --git a/cpp/lance_namespace/include/lance_namespace/version.h b/cpp/lance_namespace/include/lance_namespace/version.h new file mode 100644 index 000000000..a1ed5d3b0 --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/version.h @@ -0,0 +1,6 @@ +#ifndef LANCE_NAMESPACE_VERSION_H +#define LANCE_NAMESPACE_VERSION_H + +#define LANCE_NAMESPACE_VERSION_STRING "0.8.7-beta.1" + +#endif // LANCE_NAMESPACE_VERSION_H diff --git a/cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp b/cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp new file mode 100644 index 000000000..2302f3bae --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "lance_namespace_rest_client/ApiClient.h" +#include "lance_namespace_rest_client/ApiConfiguration.h" +#include "lance_namespace_rest_client/ApiException.h" +#include "lance_namespace_rest_client/AnyType.h" +#include "lance_namespace_rest_client/HttpContent.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/ModelBase.h" +#include "lance_namespace_rest_client/MultipartFormData.h" +#include "lance_namespace_rest_client/Object.h" + +#include "lance_namespace_rest_client/api/BranchApi.h" +#include "lance_namespace_rest_client/api/DataApi.h" +#include "lance_namespace_rest_client/api/IndexApi.h" +#include "lance_namespace_rest_client/api/MaterializedViewApi.h" +#include "lance_namespace_rest_client/api/MetadataApi.h" +#include "lance_namespace_rest_client/api/NamespaceApi.h" +#include "lance_namespace_rest_client/api/TableApi.h" +#include "lance_namespace_rest_client/api/TagApi.h" +#include "lance_namespace_rest_client/api/TransactionApi.h" + +namespace lance_namespace { + +using namespace org::openapitools::client::api; +using namespace org::openapitools::client::model; + +} // namespace lance_namespace diff --git a/cpp/lance_namespace/src/lance_namespace.cpp b/cpp/lance_namespace/src/lance_namespace.cpp new file mode 100644 index 000000000..733b3ed22 --- /dev/null +++ b/cpp/lance_namespace/src/lance_namespace.cpp @@ -0,0 +1,401 @@ +#include "lance_namespace/lance_namespace.h" + +#include "lance_namespace/errors.h" +#include "lance_namespace/models.h" + +#include +#include +#include +#include +#include + +namespace { + +struct RegistryEntry { + lance_namespace_create_fn create_fn; +}; + +std::unordered_map ®istry() { + static auto *registry_ = new std::unordered_map(); + return *registry_; +} + +std::mutex ®istry_mutex() { + static auto *mutex_ = new std::mutex(); + return *mutex_; +} + +} // namespace + +struct lance_namespace_handle { + const lance_namespace_vtable_t *vtable; + void *instance; +}; + +namespace { + +void set_error( + lance_namespace_error_t *error, + lance_namespace_status_t code, + const std::string &message) { + if (error == nullptr) { + return; + } + + std::free(error->message); + error->message = nullptr; + error->code = code; + error->message = static_cast(std::malloc(message.size() + 1)); + if (error->message == nullptr) { + return; + } + std::memcpy(error->message, message.c_str(), message.size() + 1); +} + +} // namespace + +extern "C" const char *lance_namespace_version_string(void) { + return LANCE_NAMESPACE_VERSION_STRING; +} + +extern "C" const char *lance_namespace_status_to_string( + lance_namespace_status_t status) { + switch (status) { + case LANCE_NAMESPACE_STATUS_OK: + return "ok"; + case LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT: + return "invalid_argument"; + case LANCE_NAMESPACE_STATUS_NOT_FOUND: + return "not_found"; + case LANCE_NAMESPACE_STATUS_ALREADY_EXISTS: + return "already_exists"; + case LANCE_NAMESPACE_STATUS_UNSUPPORTED: + return "unsupported"; + case LANCE_NAMESPACE_STATUS_INTERNAL: + default: + return "internal"; + } +} + +extern "C" const char *lance_namespace_option_get( + const lance_namespace_options_t *options, + const char *key) { + if (options == nullptr || key == nullptr || options->properties == nullptr) { + return nullptr; + } + + for (size_t i = 0; i < options->property_count; ++i) { + const auto &property = options->properties[i]; + if (property.key != nullptr && std::strcmp(property.key, key) == 0) { + return property.value; + } + } + return nullptr; +} + +extern "C" const char *lance_namespace_header_get( + const lance_namespace_headers_t *headers, + const char *name) { + if (headers == nullptr || name == nullptr || headers->items == nullptr) { + return nullptr; + } + + for (size_t i = 0; i < headers->count; ++i) { + const auto &header = headers->items[i]; + if (header.name != nullptr && std::strcmp(header.name, name) == 0) { + return header.value; + } + } + return nullptr; +} + +extern "C" lance_namespace_handle_t *lance_namespace_handle_create( + const lance_namespace_vtable_t *vtable, + void *instance) { + if (vtable == nullptr) { + return nullptr; + } + + auto *handle = new lance_namespace_handle{vtable, instance}; + return handle; +} + +extern "C" void *lance_namespace_handle_instance( + const lance_namespace_handle_t *handle) { + if (handle == nullptr) { + return nullptr; + } + return handle->instance; +} + +extern "C" void lance_namespace_handle_release(lance_namespace_handle_t *handle) { + if (handle == nullptr) { + return; + } + + if (handle->vtable != nullptr && handle->vtable->destroy != nullptr) { + handle->vtable->destroy(handle->instance); + } + delete handle; +} + +extern "C" const char *lance_namespace_namespace_id( + const lance_namespace_handle_t *handle) { + if (handle == nullptr || handle->vtable == nullptr || + handle->vtable->namespace_id == nullptr) { + return nullptr; + } + return handle->vtable->namespace_id(handle); +} + +extern "C" lance_namespace_status_t lance_namespace_register_impl( + const char *name, + lance_namespace_create_fn create_fn) { + if (name == nullptr || name[0] == '\0' || create_fn == nullptr) { + return LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT; + } + + std::lock_guard lock(registry_mutex()); + registry()[name] = RegistryEntry{create_fn}; + return LANCE_NAMESPACE_STATUS_OK; +} + +extern "C" lance_namespace_status_t lance_namespace_unregister_impl( + const char *name) { + if (name == nullptr || name[0] == '\0') { + return LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT; + } + + std::lock_guard lock(registry_mutex()); + auto erased = registry().erase(name); + return erased == 0 ? LANCE_NAMESPACE_STATUS_NOT_FOUND : LANCE_NAMESPACE_STATUS_OK; +} + +extern "C" lance_namespace_status_t lance_namespace_connect( + const char *impl, + const lance_namespace_options_t *options, + lance_namespace_handle_t **out_namespace, + lance_namespace_error_t *error) { + if (out_namespace == nullptr) { + set_error(error, LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT, "out_namespace must not be null"); + return LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT; + } + *out_namespace = nullptr; + + if (error != nullptr) { + error->code = LANCE_NAMESPACE_STATUS_OK; + std::free(error->message); + error->message = nullptr; + } + + if (impl == nullptr || impl[0] == '\0') { + set_error(error, LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT, "impl must not be empty"); + return LANCE_NAMESPACE_STATUS_INVALID_ARGUMENT; + } + + lance_namespace_create_fn create_fn = nullptr; + { + std::lock_guard lock(registry_mutex()); + auto it = registry().find(impl); + if (it == registry().end()) { + set_error(error, LANCE_NAMESPACE_STATUS_NOT_FOUND, std::string("unknown namespace implementation: ") + impl); + return LANCE_NAMESPACE_STATUS_NOT_FOUND; + } + create_fn = it->second.create_fn; + } + + if (create_fn == nullptr) { + set_error(error, LANCE_NAMESPACE_STATUS_NOT_FOUND, std::string("unknown namespace implementation: ") + impl); + return LANCE_NAMESPACE_STATUS_NOT_FOUND; + } + + lance_namespace_handle_t *handle = nullptr; + auto status = create_fn(options, &handle, error); + if (status != LANCE_NAMESPACE_STATUS_OK) { + return status; + } + + if (handle == nullptr) { + set_error(error, LANCE_NAMESPACE_STATUS_INTERNAL, std::string("namespace factory returned null: ") + impl); + return LANCE_NAMESPACE_STATUS_INTERNAL; + } + + *out_namespace = handle; + return LANCE_NAMESPACE_STATUS_OK; +} + +extern "C" void lance_namespace_error_free(lance_namespace_error_t *error) { + if (error == nullptr) { + return; + } + + std::free(error->message); + error->message = nullptr; +} + +// Helper functions for model types + +extern "C" lance_namespace_map_t lance_namespace_map_create(size_t capacity) { + lance_namespace_map_t map; + if (capacity == 0) { + map.keys = nullptr; + map.values = nullptr; + map.count = 0; + return map; + } + + map.keys = static_cast(std::calloc(capacity, sizeof(const char *))); + map.values = static_cast(std::calloc(capacity, sizeof(const char *))); + map.count = 0; + return map; +} + +extern "C" void lance_namespace_map_free(lance_namespace_map_t *map) { + if (map == nullptr) { + return; + } + + if (map->keys != nullptr) { + for (size_t i = 0; i < map->count; ++i) { + std::free(const_cast(map->keys[i])); + } + std::free(map->keys); + map->keys = nullptr; + } + + if (map->values != nullptr) { + for (size_t i = 0; i < map->count; ++i) { + std::free(const_cast(map->values[i])); + } + std::free(map->values); + map->values = nullptr; + } + + map->count = 0; +} + +extern "C" int lance_namespace_map_set(lance_namespace_map_t *map, const char *key, const char *value) { + if (map == nullptr || key == nullptr) { + return 0; + } + + // Check if key already exists + for (size_t i = 0; i < map->count; ++i) { + if (std::strcmp(map->keys[i], key) == 0) { + std::free(const_cast(map->values[i])); + map->values[i] = value ? strdup(value) : nullptr; + return 1; + } + } + + // Add new key-value pair + char *key_copy = strdup(key); + char *value_copy = value ? strdup(value) : nullptr; + + if (key_copy == nullptr || (value != nullptr && value_copy == nullptr)) { + std::free(key_copy); + std::free(value_copy); + return 0; + } + + // Resize arrays if needed (simple approach - could be optimized) + const char **new_keys = static_cast( + std::realloc(map->keys, (map->count + 1) * sizeof(const char *))); + const char **new_values = static_cast( + std::realloc(map->values, (map->count + 1) * sizeof(const char *))); + + if (new_keys == nullptr || new_values == nullptr) { + std::free(key_copy); + std::free(value_copy); + return 0; + } + + map->keys = new_keys; + map->values = new_values; + map->keys[map->count] = key_copy; + map->values[map->count] = value_copy; + map->count++; + + return 1; +} + +extern "C" lance_namespace_buffer_t lance_namespace_buffer_create(size_t size) { + lance_namespace_buffer_t buffer; + if (size == 0) { + buffer.data = nullptr; + buffer.size = 0; + return buffer; + } + + buffer.data = static_cast(std::calloc(size, sizeof(uint8_t))); + buffer.size = buffer.data != nullptr ? size : 0; + return buffer; +} + +extern "C" void lance_namespace_buffer_free(lance_namespace_buffer_t *buffer) { + if (buffer == nullptr) { + return; + } + + if (buffer->data != nullptr) { + std::free(buffer->data); + buffer->data = nullptr; + } + buffer->size = 0; +} + +extern "C" const char *lance_namespace_error_code_to_string( + lance_namespace_error_code_t code) { + switch (code) { + case LANCE_NAMESPACE_ERROR_UNSUPPORTED: + return "unsupported"; + case LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_FOUND: + return "namespace_not_found"; + case LANCE_NAMESPACE_ERROR_NAMESPACE_ALREADY_EXISTS: + return "namespace_already_exists"; + case LANCE_NAMESPACE_ERROR_NAMESPACE_NOT_EMPTY: + return "namespace_not_empty"; + case LANCE_NAMESPACE_ERROR_TABLE_NOT_FOUND: + return "table_not_found"; + case LANCE_NAMESPACE_ERROR_TABLE_ALREADY_EXISTS: + return "table_already_exists"; + case LANCE_NAMESPACE_ERROR_TABLE_INDEX_NOT_FOUND: + return "table_index_not_found"; + case LANCE_NAMESPACE_ERROR_TABLE_INDEX_ALREADY_EXISTS: + return "table_index_already_exists"; + case LANCE_NAMESPACE_ERROR_TABLE_TAG_NOT_FOUND: + return "table_tag_not_found"; + case LANCE_NAMESPACE_ERROR_TABLE_TAG_ALREADY_EXISTS: + return "table_tag_already_exists"; + case LANCE_NAMESPACE_ERROR_TRANSACTION_NOT_FOUND: + return "transaction_not_found"; + case LANCE_NAMESPACE_ERROR_TABLE_VERSION_NOT_FOUND: + return "table_version_not_found"; + case LANCE_NAMESPACE_ERROR_TABLE_COLUMN_NOT_FOUND: + return "table_column_not_found"; + case LANCE_NAMESPACE_ERROR_INVALID_INPUT: + return "invalid_input"; + case LANCE_NAMESPACE_ERROR_CONCURRENT_MODIFICATION: + return "concurrent_modification"; + case LANCE_NAMESPACE_ERROR_PERMISSION_DENIED: + return "permission_denied"; + case LANCE_NAMESPACE_ERROR_UNAUTHENTICATED: + return "unauthenticated"; + case LANCE_NAMESPACE_ERROR_SERVICE_UNAVAILABLE: + return "service_unavailable"; + case LANCE_NAMESPACE_ERROR_INTERNAL: + return "internal"; + case LANCE_NAMESPACE_ERROR_INVALID_TABLE_STATE: + return "invalid_table_state"; + case LANCE_NAMESPACE_ERROR_TABLE_SCHEMA_VALIDATION_ERROR: + return "table_schema_validation_error"; + case LANCE_NAMESPACE_ERROR_THROTTLING: + return "throttling"; + case LANCE_NAMESPACE_ERROR_TABLE_BRANCH_NOT_FOUND: + return "table_branch_not_found"; + case LANCE_NAMESPACE_ERROR_TABLE_BRANCH_ALREADY_EXISTS: + return "table_branch_already_exists"; + default: + return "internal"; + } +} diff --git a/cpp/lance_namespace/src/operations.cpp b/cpp/lance_namespace/src/operations.cpp new file mode 100644 index 000000000..51203a5cf --- /dev/null +++ b/cpp/lance_namespace/src/operations.cpp @@ -0,0 +1,667 @@ +#include "lance_namespace/operations.h" + +#include "lance_namespace/errors.h" + +#include +#include + +namespace { + +void set_error( + lance_namespace_error_t *error, + lance_namespace_status_t code, + const char *message) { + if (error == nullptr) { + return; + } + + std::free(error->message); + error->message = nullptr; + error->code = code; + if (message != nullptr) { + error->message = strdup(message); + } +} + +lance_namespace_status_t unsupported( + lance_namespace_error_t *error, + const char *operation) { + set_error(error, LANCE_NAMESPACE_STATUS_UNSUPPORTED, operation); + return LANCE_NAMESPACE_STATUS_UNSUPPORTED; +} + +} // namespace + +// ============================================================================ +// Namespace Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_list_namespaces( + lance_namespace_handle_t *handle, + const lance_namespace_list_namespaces_request_t *request, + lance_namespace_list_namespaces_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_namespaces"); +} + +extern "C" lance_namespace_status_t lance_namespace_describe_namespace( + lance_namespace_handle_t *handle, + const lance_namespace_describe_namespace_request_t *request, + lance_namespace_describe_namespace_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: describe_namespace"); +} + +extern "C" lance_namespace_status_t lance_namespace_create_namespace( + lance_namespace_handle_t *handle, + const lance_namespace_create_namespace_request_t *request, + lance_namespace_create_namespace_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_namespace"); +} + +extern "C" lance_namespace_status_t lance_namespace_drop_namespace( + lance_namespace_handle_t *handle, + const lance_namespace_drop_namespace_request_t *request, + lance_namespace_drop_namespace_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: drop_namespace"); +} + +extern "C" lance_namespace_status_t lance_namespace_namespace_exists( + lance_namespace_handle_t *handle, + const lance_namespace_namespace_exists_request_t *request, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + return unsupported(error, "Not supported: namespace_exists"); +} + +extern "C" lance_namespace_status_t lance_namespace_list_tables( + lance_namespace_handle_t *handle, + const lance_namespace_list_tables_request_t *request, + lance_namespace_list_tables_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_tables"); +} + +// ============================================================================ +// Table Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_describe_table( + lance_namespace_handle_t *handle, + const lance_namespace_describe_table_request_t *request, + lance_namespace_describe_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: describe_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_register_table( + lance_namespace_handle_t *handle, + const lance_namespace_register_table_request_t *request, + lance_namespace_register_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: register_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_table_exists( + lance_namespace_handle_t *handle, + const lance_namespace_table_exists_request_t *request, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + return unsupported(error, "Not supported: table_exists"); +} + +extern "C" lance_namespace_status_t lance_namespace_drop_table( + lance_namespace_handle_t *handle, + const lance_namespace_drop_table_request_t *request, + lance_namespace_drop_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: drop_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_deregister_table( + lance_namespace_handle_t *handle, + const lance_namespace_deregister_table_request_t *request, + lance_namespace_deregister_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: deregister_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_count_table_rows( + lance_namespace_handle_t *handle, + const lance_namespace_count_table_rows_request_t *request, + int64_t *out_count, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)out_count; + return unsupported(error, "Not supported: count_table_rows"); +} + +extern "C" lance_namespace_status_t lance_namespace_create_table( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_request_t *request, + lance_namespace_create_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_declare_table( + lance_namespace_handle_t *handle, + const lance_namespace_declare_table_request_t *request, + lance_namespace_declare_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: declare_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_insert_into_table( + lance_namespace_handle_t *handle, + const lance_namespace_insert_into_table_request_t *request, + lance_namespace_insert_into_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: insert_into_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_merge_insert_into_table( + lance_namespace_handle_t *handle, + const lance_namespace_merge_insert_into_table_request_t *request, + lance_namespace_merge_insert_into_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: merge_insert_into_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_update_table( + lance_namespace_handle_t *handle, + const lance_namespace_update_table_request_t *request, + lance_namespace_update_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: update_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_delete_from_table( + lance_namespace_handle_t *handle, + const lance_namespace_delete_from_table_request_t *request, + lance_namespace_delete_from_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: delete_from_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_query_table( + lance_namespace_handle_t *handle, + const lance_namespace_query_table_request_t *request, + lance_namespace_buffer_t *out_data, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)out_data; + return unsupported(error, "Not supported: query_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_list_all_tables( + lance_namespace_handle_t *handle, + const lance_namespace_list_all_tables_request_t *request, + lance_namespace_list_tables_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_all_tables"); +} + +extern "C" lance_namespace_status_t lance_namespace_rename_table( + lance_namespace_handle_t *handle, + const lance_namespace_rename_table_request_t *request, + lance_namespace_rename_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: rename_table"); +} + +extern "C" lance_namespace_status_t lance_namespace_restore_table( + lance_namespace_handle_t *handle, + const lance_namespace_restore_table_request_t *request, + lance_namespace_restore_table_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: restore_table"); +} + +// ============================================================================ +// Table Index Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_create_table_index( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_index_request_t *request, + lance_namespace_create_table_index_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_table_index"); +} + +extern "C" lance_namespace_status_t lance_namespace_create_table_scalar_index( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_index_request_t *request, + lance_namespace_create_table_scalar_index_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_table_scalar_index"); +} + +extern "C" lance_namespace_status_t lance_namespace_list_table_indices( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_indices_request_t *request, + lance_namespace_list_table_indices_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_table_indices"); +} + +extern "C" lance_namespace_status_t lance_namespace_describe_table_index_stats( + lance_namespace_handle_t *handle, + const lance_namespace_describe_table_index_stats_request_t *request, + lance_namespace_describe_table_index_stats_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: describe_table_index_stats"); +} + +extern "C" lance_namespace_status_t lance_namespace_drop_table_index( + lance_namespace_handle_t *handle, + const lance_namespace_drop_table_index_request_t *request, + lance_namespace_drop_table_index_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: drop_table_index"); +} + +// ============================================================================ +// Table Version Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_list_table_versions( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_versions_request_t *request, + lance_namespace_list_table_versions_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_table_versions"); +} + +extern "C" lance_namespace_status_t lance_namespace_create_table_version( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_version_request_t *request, + lance_namespace_create_table_version_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_table_version"); +} + +extern "C" lance_namespace_status_t lance_namespace_describe_table_version( + lance_namespace_handle_t *handle, + const lance_namespace_describe_table_version_request_t *request, + lance_namespace_describe_table_version_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: describe_table_version"); +} + +extern "C" lance_namespace_status_t lance_namespace_batch_delete_table_versions( + lance_namespace_handle_t *handle, + const lance_namespace_batch_delete_table_versions_request_t *request, + lance_namespace_batch_delete_table_versions_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: batch_delete_table_versions"); +} + +extern "C" lance_namespace_status_t lance_namespace_batch_create_table_versions( + lance_namespace_handle_t *handle, + const lance_namespace_batch_create_table_versions_request_t *request, + lance_namespace_batch_create_table_versions_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: batch_create_table_versions"); +} + +extern "C" lance_namespace_status_t lance_namespace_batch_commit_tables( + lance_namespace_handle_t *handle, + const lance_namespace_batch_commit_tables_request_t *request, + lance_namespace_batch_commit_tables_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: batch_commit_tables"); +} + +// ============================================================================ +// Table Schema Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_alter_table_add_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_add_columns_request_t *request, + lance_namespace_alter_table_add_columns_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: alter_table_add_columns"); +} + +extern "C" lance_namespace_status_t lance_namespace_alter_table_alter_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_alter_columns_request_t *request, + lance_namespace_alter_table_alter_columns_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: alter_table_alter_columns"); +} + +extern "C" lance_namespace_status_t lance_namespace_alter_table_drop_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_drop_columns_request_t *request, + lance_namespace_alter_table_drop_columns_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: alter_table_drop_columns"); +} + +extern "C" lance_namespace_status_t lance_namespace_alter_table_backfill_columns( + lance_namespace_handle_t *handle, + const lance_namespace_alter_table_backfill_columns_request_t *request, + lance_namespace_alter_table_backfill_columns_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: alter_table_backfill_columns"); +} + +// ============================================================================ +// Table Metadata Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_update_table_schema_metadata( + lance_namespace_handle_t *handle, + const lance_namespace_update_table_schema_metadata_request_t *request, + lance_namespace_update_table_schema_metadata_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: update_table_schema_metadata"); +} + +extern "C" lance_namespace_status_t lance_namespace_update_field_metadata( + lance_namespace_handle_t *handle, + const lance_namespace_update_field_metadata_request_t *request, + lance_namespace_update_field_metadata_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: update_field_metadata"); +} + +extern "C" lance_namespace_status_t lance_namespace_get_table_stats( + lance_namespace_handle_t *handle, + const lance_namespace_get_table_stats_request_t *request, + lance_namespace_get_table_stats_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: get_table_stats"); +} + +// ============================================================================ +// Query Plan Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_explain_table_query_plan( + lance_namespace_handle_t *handle, + const lance_namespace_explain_table_query_plan_request_t *request, + char **out_plan, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)out_plan; + return unsupported(error, "Not supported: explain_table_query_plan"); +} + +extern "C" lance_namespace_status_t lance_namespace_analyze_table_query_plan( + lance_namespace_handle_t *handle, + const lance_namespace_analyze_table_query_plan_request_t *request, + char **out_analysis, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)out_analysis; + return unsupported(error, "Not supported: analyze_table_query_plan"); +} + +// ============================================================================ +// Table Tag Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_list_table_tags( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_tags_request_t *request, + lance_namespace_list_table_tags_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_table_tags"); +} + +extern "C" lance_namespace_status_t lance_namespace_get_table_tag_version( + lance_namespace_handle_t *handle, + const lance_namespace_get_table_tag_version_request_t *request, + lance_namespace_get_table_tag_version_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: get_table_tag_version"); +} + +extern "C" lance_namespace_status_t lance_namespace_create_table_tag( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_tag_request_t *request, + lance_namespace_create_table_tag_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_table_tag"); +} + +extern "C" lance_namespace_status_t lance_namespace_delete_table_tag( + lance_namespace_handle_t *handle, + const lance_namespace_delete_table_tag_request_t *request, + lance_namespace_delete_table_tag_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: delete_table_tag"); +} + +extern "C" lance_namespace_status_t lance_namespace_update_table_tag( + lance_namespace_handle_t *handle, + const lance_namespace_update_table_tag_request_t *request, + lance_namespace_update_table_tag_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: update_table_tag"); +} + +// ============================================================================ +// Table Branch Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_create_table_branch( + lance_namespace_handle_t *handle, + const lance_namespace_create_table_branch_request_t *request, + lance_namespace_create_table_branch_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_table_branch"); +} + +extern "C" lance_namespace_status_t lance_namespace_list_table_branches( + lance_namespace_handle_t *handle, + const lance_namespace_list_table_branches_request_t *request, + lance_namespace_list_table_branches_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: list_table_branches"); +} + +extern "C" lance_namespace_status_t lance_namespace_delete_table_branch( + lance_namespace_handle_t *handle, + const lance_namespace_delete_table_branch_request_t *request, + lance_namespace_delete_table_branch_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: delete_table_branch"); +} + +// ============================================================================ +// Materialized View Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_create_materialized_view( + lance_namespace_handle_t *handle, + const lance_namespace_create_materialized_view_request_t *request, + lance_namespace_create_materialized_view_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: create_materialized_view"); +} + +extern "C" lance_namespace_status_t lance_namespace_refresh_materialized_view( + lance_namespace_handle_t *handle, + const lance_namespace_refresh_materialized_view_request_t *request, + lance_namespace_refresh_materialized_view_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: refresh_materialized_view"); +} + +// ============================================================================ +// Transaction Operations +// ============================================================================ + +extern "C" lance_namespace_status_t lance_namespace_describe_transaction( + lance_namespace_handle_t *handle, + const lance_namespace_describe_transaction_request_t *request, + lance_namespace_describe_transaction_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: describe_transaction"); +} + +extern "C" lance_namespace_status_t lance_namespace_alter_transaction( + lance_namespace_handle_t *handle, + const lance_namespace_alter_transaction_request_t *request, + lance_namespace_alter_transaction_response_t *response, + lance_namespace_error_t *error) { + (void)handle; + (void)request; + (void)response; + return unsupported(error, "Not supported: alter_transaction"); +} diff --git a/cpp/lance_namespace/tests/smoke.cpp b/cpp/lance_namespace/tests/smoke.cpp new file mode 100644 index 000000000..2ab4b4c33 --- /dev/null +++ b/cpp/lance_namespace/tests/smoke.cpp @@ -0,0 +1,140 @@ +#include +#include +#include +#include + +#include "lance_namespace/lance_namespace.h" +#include "lance_namespace/lance_namespace.hpp" + +namespace { + +struct CState { + std::string id; +}; + +const char *c_namespace_id(const lance_namespace_handle_t *handle) { + auto *state = static_cast(lance_namespace_handle_instance(handle)); + return state ? state->id.c_str() : nullptr; +} + +void c_destroy(void *instance) { + delete static_cast(instance); +} + +lance_namespace_status_t c_create( + const lance_namespace_options_t *options, + lance_namespace_handle_t **out_namespace, + lance_namespace_error_t *error) { + const char *suffix = lance_namespace_option_get(options, "suffix"); + auto *state = new CState{std::string("c://") + (suffix ? suffix : "default")}; + static const lance_namespace_vtable_t vtable{c_namespace_id, c_destroy}; + auto *handle = lance_namespace_handle_create(&vtable, state); + if (handle == nullptr) { + if (error != nullptr) { + error->code = LANCE_NAMESPACE_STATUS_INTERNAL; + } + delete state; + return LANCE_NAMESPACE_STATUS_INTERNAL; + } + *out_namespace = handle; + return LANCE_NAMESPACE_STATUS_OK; +} + +class CppNamespace final : public lance_namespace::Namespace { + public: + explicit CppNamespace(std::string id) : id_(std::move(id)) {} + + std::string namespace_id() const override { return id_; } + + private: + std::string id_; +}; + +void test_unsupported_operations() { + auto ns = std::make_unique("test://ns"); + + bool caught = false; + try { + ns->list_namespaces(nullptr); + } catch (const lance_namespace::UnsupportedOperationError &e) { + caught = true; + } + assert(caught); + + caught = false; + try { + ns->create_table(nullptr, {}); + } catch (const lance_namespace::UnsupportedOperationError &e) { + caught = true; + } + assert(caught); + + caught = false; + try { + ns->query_table(nullptr); + } catch (const lance_namespace::UnsupportedOperationError &e) { + caught = true; + } + assert(caught); + + caught = false; + try { + ns->count_table_rows(nullptr); + } catch (const lance_namespace::UnsupportedOperationError &e) { + caught = true; + } + assert(caught); +} + +} // namespace + +int main() { + test_unsupported_operations(); + + { + auto status = lance_namespace_register_impl("c-dummy", c_create); + assert(status == LANCE_NAMESPACE_STATUS_OK); + + lance_namespace_property_t properties[] = { + {"suffix", "dummy"}, + }; + lance_namespace_options_t options{properties, 1}; + lance_namespace_handle_t *handle = nullptr; + lance_namespace_error_t error{LANCE_NAMESPACE_STATUS_OK, nullptr}; + + status = lance_namespace_connect("c-dummy", &options, &handle, &error); + assert(status == LANCE_NAMESPACE_STATUS_OK); + assert(handle != nullptr); + assert(std::strcmp(lance_namespace_namespace_id(handle), "c://dummy") == 0); + + lance_namespace_handle_release(handle); + lance_namespace_error_free(&error); + status = lance_namespace_unregister_impl("c-dummy"); + assert(status == LANCE_NAMESPACE_STATUS_OK); + } + + { + lance_namespace_header_t headers[] = { + {"x-lance-test", "passed"}, + }; + lance_namespace_headers_t header_list{headers, 1}; + assert(std::strcmp(lance_namespace_header_get(&header_list, "x-lance-test"), "passed") == 0); + assert(lance_namespace_header_get(&header_list, "missing") == nullptr); + } + + { + lance_namespace::register_namespace_impl( + "cpp-dummy", + [](const lance_namespace::Properties &) { + return std::make_unique("cpp://dummy"); + }); + + auto namespace_ptr = lance_namespace::connect("cpp-dummy", {}); + assert(namespace_ptr != nullptr); + assert(namespace_ptr->namespace_id() == "cpp://dummy"); + + lance_namespace::unregister_namespace_impl("cpp-dummy"); + } + + return 0; +} diff --git a/cpp/lance_namespace_rest_client/CMakeLists.txt b/cpp/lance_namespace_rest_client/CMakeLists.txt new file mode 100644 index 000000000..8ce9446cb --- /dev/null +++ b/cpp/lance_namespace_rest_client/CMakeLists.txt @@ -0,0 +1,105 @@ +# +# Lance Namespace Specification +# This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. +# +# The version of the OpenAPI document: 1.0.0 +# +# https://openapi-generator.tech +# +# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech). + +cmake_minimum_required (VERSION 3.20) + +project(lance_namespace_rest_client CXX) + +# Force -fPIC even if the project is configured for building a static library. +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) +if(NOT CMAKE_CXX_STANDARD) + if(DEFINED CMAKE_CXX20_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX20_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 20) + elseif(DEFINED CMAKE_CXX17_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX17_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 17) + elseif(DEFINED CMAKE_CXX14_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX14_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 14) + else() + set(CMAKE_CXX_STANDARD 11) + endif() +endif() + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +find_package(cpprestsdk REQUIRED) +find_package(Boost REQUIRED) + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +file(GLOB_RECURSE HEADER_FILES "include/*.h") +file(GLOB_RECURSE SOURCE_FILES "src/*.cpp") + +add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) + +target_compile_options(${PROJECT_NAME} + PRIVATE + $<$,$,$>: + -Wall -Wno-unused-variable -Wno-unused-lambda-capture> +) + +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ +) + +if (UNIX) + message(STATUS "Building client library for Linux/Unix") + if (BUILD_SHARED_LIBS) + target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest) + else() + target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest crypto) + endif() +else() + message(STATUS "Building client library for Windows") + if (BUILD_SHARED_LIBS) + target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest) + else() + target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest bcrypt) + endif() +endif() + +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) + +install( + TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}Targets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) + +install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +) + +install( + EXPORT ${PROJECT_NAME}Targets + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +) diff --git a/cpp/lance_namespace_rest_client/Config.cmake.in b/cpp/lance_namespace_rest_client/Config.cmake.in new file mode 100644 index 000000000..9015c2ba5 --- /dev/null +++ b/cpp/lance_namespace_rest_client/Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake) + +check_required_components("@PROJECT_NAME@") diff --git a/cpp/lance_namespace_rest_client/README.md b/cpp/lance_namespace_rest_client/README.md new file mode 100644 index 000000000..3939b0ad9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/README.md @@ -0,0 +1,60 @@ +# C++ API client + +This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: + +The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define +the request and response shape for each operation in a Lance Namespace across all implementations. +See https://lance.org/format/namespace/operations for more details. + +The `servers`, `security`, `paths`, `components/parameters` sections are for the +Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. +See https://lance.org/format/namespace/rest for more details. + + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 0.8.7-beta.1 +- Generator version: 7.12.0 +- Build package: org.openapitools.codegen.languages.CppRestSdkClientCodegen + +- API namespace: org.openapitools.client.api +- Model namespace: org.openapitools.client.model + +## Installation + +### Prerequisites + +Install [cpprestsdk](https://github.com/Microsoft/cpprestsdk). + +- Windows: `vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows` +- Mac: `brew install cpprestsdk` +- Linux: `sudo apt-get install libcpprest-dev` + +### Build + +```sh +cmake -DCPPREST_ROOT=/usr -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib" +make +``` + +### Build on Windows with Visual Studio (VS2017) + +- Right click on folder containing source code +- Select 'Open in visual studio' +- Once visual studio opens, CMake should show up in top menu bar. +- Select CMake > Build All. + +*Note: If the CMake menu item doesn't show up in Visual Studio, CMake +for Visual Studio must be installed. In this case, open the 'Visual Studio +Installer' application. Select 'modify' Visual Studio 2017. Make sure +'Desktop Development with C++' is installed, and specifically that 'Visual +C++ tools for CMake' is selected in the 'Installation Details' section. + +Also be sure to review the CMakeLists.txt file. Edits are likely required.* + +## Author + + + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/AnyType.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/AnyType.h new file mode 100644 index 000000000..aaa6278cb --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/AnyType.h @@ -0,0 +1,58 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AnyType.h + * + * This is the implementation of an any JSON type. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AnyType_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AnyType_H_ + + +#include "lance_namespace_rest_client/Object.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AnyType : public Object { +public: + AnyType(); + virtual ~AnyType(); + + ///////////////////////////////////////////// + /// ModelBase overrides + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value &json) override; + + void toMultipart(std::shared_ptr multipart, + const utility::string_t &namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, + const utility::string_t &namePrefix) override; + +private: + web::json::value m_value; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AnyType_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiClient.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiClient.h new file mode 100644 index 000000000..c7af473d7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiClient.h @@ -0,0 +1,114 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ApiClient.h + * + * This is an API client responsible for stating the HTTP calls + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_ApiClient_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_ApiClient_H_ + + +#include "lance_namespace_rest_client/ApiConfiguration.h" +#include "lance_namespace_rest_client/ApiException.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/HttpContent.h" + +#if defined (_WIN32) || defined (_WIN64) +#undef U +#endif + +#include +#include + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +class ApiClient +{ +public: + ApiClient( std::shared_ptr configuration = nullptr ); + virtual ~ApiClient(); + + typedef std::function ResponseHandlerType; + + const ResponseHandlerType& getResponseHandler() const; + void setResponseHandler(const ResponseHandlerType& responseHandler); + + std::shared_ptr getConfiguration() const; + void setConfiguration(std::shared_ptr configuration); + + static utility::string_t parameterToString(utility::string_t value); + static utility::string_t parameterToString(int32_t value); + static utility::string_t parameterToString(int64_t value); + static utility::string_t parameterToString(float value); + static utility::string_t parameterToString(double value); + static utility::string_t parameterToString(const utility::datetime &value); + static utility::string_t parameterToString(bool value); + template + static utility::string_t parameterToString(const std::vector& value); + template + static utility::string_t parameterToString(const std::shared_ptr& value); + + pplx::task callApi( + const utility::string_t& path, + const utility::string_t& method, + const std::map& queryParams, + const std::shared_ptr postBody, + const std::map& headerParams, + const std::map& formParams, + const std::map>& fileParams, + const utility::string_t& contentType + ) const; + +protected: + + ResponseHandlerType m_ResponseHandler; + std::shared_ptr m_Configuration; +}; + +template +utility::string_t ApiClient::parameterToString(const std::vector& value) +{ + utility::stringstream_t ss; + + for( size_t i = 0; i < value.size(); i++) + { + if( i > 0) ss << utility::conversions::to_string_t(", "); + ss << ApiClient::parameterToString(value[i]); + } + + return ss.str(); +} + +template +utility::string_t ApiClient::parameterToString(const std::shared_ptr& value) +{ + return parameterToString(*value.get()); +} + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_ApiClient_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiConfiguration.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiConfiguration.h new file mode 100644 index 000000000..ca95cc165 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiConfiguration.h @@ -0,0 +1,66 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ApiConfiguration.h + * + * This class represents a single item of a multipart-formdata request. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_ApiConfiguration_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_ApiConfiguration_H_ + + + +#include +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +class ApiConfiguration +{ +public: + ApiConfiguration(); + virtual ~ApiConfiguration(); + + const web::http::client::http_client_config& getHttpConfig() const; + void setHttpConfig( web::http::client::http_client_config& value ); + + utility::string_t getBaseUrl() const; + void setBaseUrl( const utility::string_t value ); + + utility::string_t getUserAgent() const; + void setUserAgent( const utility::string_t value ); + + std::map& getDefaultHeaders(); + const std::map& getDefaultHeaders() const; + + utility::string_t getApiKey( const utility::string_t& prefix) const; + void setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey ); + +protected: + utility::string_t m_BaseUrl; + std::map m_DefaultHeaders; + std::map m_ApiKeys; + web::http::client::http_client_config m_HttpConfig; + utility::string_t m_UserAgent; +}; + +} +} +} +} +#endif /* ORG_OPENAPITOOLS_CLIENT_API_ApiConfiguration_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiException.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiException.h new file mode 100644 index 000000000..d8f2fce7b --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ApiException.h @@ -0,0 +1,60 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ApiException.h + * + * This is the exception being thrown in case the api call was not successful + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_ApiException_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_ApiException_H_ + + + +#include +#include + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +class ApiException + : public web::http::http_exception +{ +public: + ApiException( int errorCode + , const utility::string_t& message + , std::shared_ptr content = nullptr ); + ApiException( int errorCode + , const utility::string_t& message + , std::map& headers + , std::shared_ptr content = nullptr ); + virtual ~ApiException(); + + std::map& getHeaders(); + std::shared_ptr getContent() const; + +protected: + std::shared_ptr m_Content; + std::map m_Headers; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_ApiBase_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/HttpContent.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/HttpContent.h new file mode 100644 index 000000000..c19eabd39 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/HttpContent.h @@ -0,0 +1,69 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * HttpContent.h + * + * This class represents a single item of a multipart-formdata request. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_HttpContent_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_HttpContent_H_ + + + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class HttpContent +{ +public: + HttpContent(); + virtual ~HttpContent(); + + virtual utility::string_t getContentDisposition() const; + virtual void setContentDisposition( const utility::string_t& value ); + + virtual utility::string_t getName() const; + virtual void setName( const utility::string_t& value ); + + virtual utility::string_t getFileName() const; + virtual void setFileName( const utility::string_t& value ); + + virtual utility::string_t getContentType() const; + virtual void setContentType( const utility::string_t& value ); + + virtual std::shared_ptr getData() const; + virtual void setData( std::shared_ptr value ); + + virtual void writeTo( std::ostream& stream ); + +protected: + // NOTE: no utility::string_t here because those strings can only contain ascii + utility::string_t m_ContentDisposition; + utility::string_t m_Name; + utility::string_t m_FileName; + utility::string_t m_ContentType; + std::shared_ptr m_Data; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_HttpContent_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/IHttpBody.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/IHttpBody.h new file mode 100644 index 000000000..8f9fa2a7e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/IHttpBody.h @@ -0,0 +1,42 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * IHttpBody.h + * + * This is the interface for contents that can be sent to a remote HTTP server. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_IHttpBody_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_IHttpBody_H_ + + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class IHttpBody +{ +public: + virtual ~IHttpBody() { } + + virtual void writeTo( std::ostream& stream ) = 0; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_IHttpBody_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/JsonBody.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/JsonBody.h new file mode 100644 index 000000000..0983717c0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/JsonBody.h @@ -0,0 +1,49 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * JsonBody.h + * + * This is a JSON http body which can be submitted via http + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_JsonBody_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_JsonBody_H_ + + +#include "lance_namespace_rest_client/IHttpBody.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class JsonBody + : public IHttpBody +{ +public: + JsonBody( const web::json::value& value ); + virtual ~JsonBody(); + + void writeTo( std::ostream& target ) override; + +protected: + web::json::value m_Json; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_JsonBody_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ModelBase.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ModelBase.h new file mode 100644 index 000000000..17ba2bb24 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/ModelBase.h @@ -0,0 +1,505 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ModelBase.h + * + * This is the base class for all model classes + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ModelBase_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ModelBase_H_ + + + +#include "lance_namespace_rest_client/HttpContent.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include +#include + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class ModelBase +{ +public: + ModelBase(); + virtual ~ModelBase(); + + virtual void validate() = 0; + + virtual web::json::value toJson() const = 0; + virtual bool fromJson( const web::json::value& json ) = 0; + + virtual void toMultipart( std::shared_ptr multipart, const utility::string_t& namePrefix ) const = 0; + virtual bool fromMultiPart( std::shared_ptr multipart, const utility::string_t& namePrefix ) = 0; + + virtual bool isSet() const; + + static utility::string_t toString( const bool val ); + static utility::string_t toString( const float val ); + static utility::string_t toString( const double val ); + static utility::string_t toString( const int32_t val ); + static utility::string_t toString( const int64_t val ); + static utility::string_t toString( const utility::string_t &val ); + static utility::string_t toString( const utility::datetime &val ); + static utility::string_t toString( const web::json::value &val ); + static utility::string_t toString( const std::shared_ptr& val ); + template + static utility::string_t toString( const std::shared_ptr& val ); + template + static utility::string_t toString( const std::vector & val ); + template + static utility::string_t toString( const std::set & val ); + + static web::json::value toJson( bool val ); + static web::json::value toJson( float val ); + static web::json::value toJson( double val ); + static web::json::value toJson( int32_t val ); + static web::json::value toJson( int64_t val ); + static web::json::value toJson( const utility::string_t& val ); + static web::json::value toJson( const utility::datetime& val ); + static web::json::value toJson( const web::json::value& val ); + static web::json::value toJson( const std::shared_ptr& val ); + template + static web::json::value toJson( const std::shared_ptr& val ); + static web::json::value toJson( const std::shared_ptr& val ); + template + static web::json::value toJson( const std::vector& val ); + template + static web::json::value toJson( const std::set& val ); + template + static web::json::value toJson( const std::map& val ); + + static bool fromString( const utility::string_t& val, bool & ); + static bool fromString( const utility::string_t& val, float & ); + static bool fromString( const utility::string_t& val, double & ); + static bool fromString( const utility::string_t& val, int32_t & ); + static bool fromString( const utility::string_t& val, int64_t & ); + static bool fromString( const utility::string_t& val, utility::string_t & ); + static bool fromString( const utility::string_t& val, utility::datetime & ); + static bool fromString( const utility::string_t& val, web::json::value & ); + static bool fromString( const utility::string_t& val, std::shared_ptr & ); + template + static bool fromString( const utility::string_t& val, std::shared_ptr& ); + static bool fromString( const utility::string_t& val, std::shared_ptr& outVal ); + template + static bool fromString( const utility::string_t& val, std::vector & ); + template + static bool fromString( const utility::string_t& val, std::set & ); + template + static bool fromString( const utility::string_t& val, std::map & ); + + static bool fromJson( const web::json::value& val, bool & ); + static bool fromJson( const web::json::value& val, float & ); + static bool fromJson( const web::json::value& val, double & ); + static bool fromJson( const web::json::value& val, int32_t & ); + static bool fromJson( const web::json::value& val, int64_t & ); + static bool fromJson( const web::json::value& val, utility::string_t & ); + static bool fromJson( const web::json::value& val, utility::datetime & ); + static bool fromJson( const web::json::value& val, web::json::value & ); + static bool fromJson( const web::json::value& val, std::shared_ptr & ); + template + static bool fromJson( const web::json::value& val, std::shared_ptr& ); + static bool fromJson( const web::json::value& val, std::shared_ptr &outVal ); + template + static bool fromJson( const web::json::value& val, std::vector & ); + template + static bool fromJson( const web::json::value& val, std::set & ); + template + static bool fromJson( const web::json::value& val, std::map & ); + + + static std::shared_ptr toHttpContent( const utility::string_t& name, bool value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + static std::shared_ptr toHttpContent( const utility::string_t& name, float value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + static std::shared_ptr toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + static std::shared_ptr toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + static std::shared_ptr toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + static std::shared_ptr toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType = utility::conversions::to_string_t("")); + static std::shared_ptr toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType = utility::conversions::to_string_t("")); + static std::shared_ptr toHttpContent( const utility::string_t& name, const web::json::value& value, const utility::string_t& contentType = utility::conversions::to_string_t("application/json") ); + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::shared_ptr& ); + template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::shared_ptr& , const utility::string_t& contentType = utility::conversions::to_string_t("application/json") ); + static std::shared_ptr toHttpContent(const utility::string_t& name, const std::shared_ptr& value , const utility::string_t& contentType = utility::conversions::to_string_t("application/json") ); + template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::set& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::map& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + + static bool fromHttpContent( std::shared_ptr val, bool & ); + static bool fromHttpContent( std::shared_ptr val, float & ); + static bool fromHttpContent( std::shared_ptr val, double & ); + static bool fromHttpContent( std::shared_ptr val, int64_t & ); + static bool fromHttpContent( std::shared_ptr val, int32_t & ); + static bool fromHttpContent( std::shared_ptr val, utility::string_t & ); + static bool fromHttpContent( std::shared_ptr val, utility::datetime & ); + static bool fromHttpContent( std::shared_ptr val, web::json::value & ); + static bool fromHttpContent( std::shared_ptr val, std::shared_ptr& ); + template + static bool fromHttpContent( std::shared_ptr val, std::shared_ptr& ); + template + static bool fromHttpContent( std::shared_ptr val, std::vector & ); + template + static bool fromHttpContent( std::shared_ptr val, std::set & ); + template + static bool fromHttpContent( std::shared_ptr val, std::map & ); + + static utility::string_t toBase64( utility::string_t value ); + static utility::string_t toBase64( std::shared_ptr value ); + static std::shared_ptr fromBase64( const utility::string_t& encoded ); +protected: + bool m_IsSet; +}; + +template +utility::string_t ModelBase::toString( const std::shared_ptr& val ) +{ + utility::stringstream_t ss; + if( val != nullptr ) + { + val->toJson().serialize(ss); + } + return utility::string_t(ss.str()); +} + +// std::vector to string +template +utility::string_t ModelBase::toString( const std::vector & val ) +{ + utility::string_t strArray; + for ( const auto &item : val ) + { + strArray.append( toString(item) + "," ); + } + if (val.count() > 0) + { + strArray.pop_back(); + } + return strArray; +} + +// std::set to string +template +utility::string_t ModelBase::toString( const std::set & val ) +{ + utility::string_t strArray; + for ( const auto &item : val ) + { + strArray.append( toString(item) + "," ); + } + if (val.count() > 0) + { + strArray.pop_back(); + } + return strArray; +} + + +template +web::json::value ModelBase::toJson( const std::shared_ptr& val ) +{ + web::json::value retVal; + if(val != nullptr) + { + retVal = val->toJson(); + } + return retVal; +} + +// std::vector to json +template +web::json::value ModelBase::toJson( const std::vector& value ) +{ + std::vector ret; + for ( const auto& x : value ) + { + ret.push_back( toJson(x) ); + } + return web::json::value::array(ret); +} + +// std::set to json +template +web::json::value ModelBase::toJson( const std::set& value ) +{ + // There's no prototype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array. + std::vector ret; + for ( const auto& x : value ) + { + ret.push_back( toJson(x) ); + } + return web::json::value::array(ret); +} + + +template +web::json::value ModelBase::toJson( const std::map& val ) +{ + web::json::value obj; + for ( const auto &itemkey : val ) + { + obj[itemkey.first] = toJson( itemkey.second ); + } + return obj; +} +template +bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr& outVal ) +{ + bool ok = false; + if(outVal == nullptr) + { + outVal = std::make_shared(); + } + if( outVal != nullptr ) + { + ok = outVal->fromJson(web::json::value::parse(val)); + } + return ok; +} +template +bool ModelBase::fromString(const utility::string_t& val, std::vector& outVal ) +{ + bool ok = true; + web::json::value jsonValue = web::json::value::parse(val); + if (jsonValue.is_array()) + { + for (const web::json::value& jitem : jsonValue.as_array()) + { + T item; + ok &= fromJson(jitem, item); + outVal.push_back(item); + } + } + else + { + T item; + ok = fromJson(jsonValue, item); + outVal.push_back(item); + } + return ok; +} +template +bool ModelBase::fromString(const utility::string_t& val, std::set& outVal ) +{ + bool ok = true; + web::json::value jsonValue = web::json::value::parse(val); + if (jsonValue.is_array()) + { + for (const web::json::value& jitem : jsonValue.as_array()) + { + T item; + ok &= fromJson(jitem, item); + outVal.insert(item); + } + } + else + { + T item; + ok = fromJson(jsonValue, item); + outVal.insert(item); + } + return ok; +} +template +bool ModelBase::fromString(const utility::string_t& val, std::map& outVal ) +{ + bool ok = false; + web::json::value jsonValue = web::json::value::parse(val); + if (jsonValue.is_array()) + { + for (const web::json::value& jitem : jsonValue.as_array()) + { + T item; + ok &= fromJson(jitem, item); + outVal.insert({ val, item }); + } + } + else + { + T item; + ok = fromJson(jsonValue, item); + outVal.insert({ val, item }); + } + return ok; +} +template +bool ModelBase::fromJson( const web::json::value& val, std::shared_ptr &outVal ) +{ + bool ok = false; + if(outVal == nullptr) + { + outVal = std::make_shared(); + } + if( outVal != nullptr ) + { + ok = outVal->fromJson(val); + } + return ok; +} +template +bool ModelBase::fromJson( const web::json::value& val, std::vector &outVal ) +{ + bool ok = true; + if (val.is_array()) + { + for (const web::json::value & jitem : val.as_array()) + { + T item; + ok &= fromJson(jitem, item); + outVal.push_back(item); + } + } + else + { + ok = false; + } + return ok; +} +template +bool ModelBase::fromJson(const web::json::value& val, std::set& outVal ) +{ + bool ok = true; + if (val.is_array()) + { + for (const web::json::value& jitem : val.as_array()) + { + T item; + ok &= fromJson(jitem, item); + outVal.insert(item); + } + } + else + { + T item; + ok = fromJson(val, item); + outVal.insert(item); + } + return ok; +} +template +bool ModelBase::fromJson( const web::json::value& jval, std::map &outVal ) +{ + bool ok = true; + if ( jval.is_object() ) + { + auto obj = jval.as_object(); + for( auto objItr = obj.begin() ; objItr != obj.end() ; objItr++ ) + { + T itemVal; + ok &= fromJson(objItr->second, itemVal); + outVal.insert(std::pair(objItr->first, itemVal)); + } + } + else + { + ok = false; + } + return ok; +} +template +std::shared_ptr ModelBase::toHttpContent(const utility::string_t& name, const std::shared_ptr& value , const utility::string_t& contentType ) +{ + std::shared_ptr content = std::make_shared(); + if (value != nullptr ) + { + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::make_shared( utility::conversions::to_utf8string(value->toJson().serialize()) ) ); + } + return content; +} + +template +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType ) +{ + web::json::value json_array = ModelBase::toJson(value); + std::shared_ptr content = std::make_shared(); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::make_shared( utility::conversions::to_utf8string(json_array.serialize()) ) ); + return content; +} +template +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::set& value, const utility::string_t& contentType ) +{ + web::json::value json_array = ModelBase::toJson(value); + std::shared_ptr content = std::make_shared(); + content->setName(name); + content->setContentDisposition(utility::conversions::to_string_t("form-data")); + content->setContentType(contentType); + content->setData( std::make_shared( utility::conversions::to_utf8string(json_array.serialize()) ) ); + return content; +} +template +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::map& value, const utility::string_t& contentType ) +{ + web::json::value jobj = ModelBase::toJson(value); + std::shared_ptr content = std::make_shared(); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::make_shared( utility::conversions::to_utf8string(jobj.serialize()) ) ); + return content; +} +template +bool ModelBase::fromHttpContent( std::shared_ptr val, std::shared_ptr& outVal ) +{ + utility::string_t str; + if(val == nullptr) return false; + if( outVal == nullptr ) + { + outVal = std::make_shared(); + } + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +template +bool ModelBase::fromHttpContent( std::shared_ptr val, std::vector & outVal ) +{ + utility::string_t str; + if (val == nullptr) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +template +bool ModelBase::fromHttpContent(std::shared_ptr val, std::set& outVal ) +{ + utility::string_t str; + if (val == nullptr) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +template +bool ModelBase::fromHttpContent( std::shared_ptr val, std::map & outVal ) +{ + utility::string_t str; + if (val == nullptr) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ModelBase_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/MultipartFormData.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/MultipartFormData.h new file mode 100644 index 000000000..0d6ff5ec3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/MultipartFormData.h @@ -0,0 +1,61 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MultipartFormData.h + * + * This class represents a container for building application/x-multipart-formdata requests. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MultipartFormData_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_MultipartFormData_H_ + + +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/HttpContent.h" + +#include + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class MultipartFormData + : public IHttpBody +{ +public: + MultipartFormData(); + MultipartFormData(const utility::string_t& boundary); + virtual ~MultipartFormData(); + + virtual void add( std::shared_ptr content ); + virtual utility::string_t getBoundary(); + virtual std::shared_ptr getContent(const utility::string_t& name) const; + virtual bool hasContent(const utility::string_t& name) const; + virtual void writeTo( std::ostream& target ); + +protected: + std::vector> m_Contents; + utility::string_t m_Boundary; + std::map> m_ContentLookup; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MultipartFormData_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/Object.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/Object.h new file mode 100644 index 000000000..8351a6466 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/Object.h @@ -0,0 +1,62 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Object.h + * + * This is the implementation of a JSON object. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Object_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_Object_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Object : public ModelBase +{ +public: + Object(); + virtual ~Object(); + + ///////////////////////////////////////////// + /// ModelBase overrides + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + ///////////////////////////////////////////// + /// Object manipulation + web::json::value getValue(const utility::string_t& key) const; + void setValue(const utility::string_t& key, const web::json::value& value); + +private: + web::json::value m_object; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Object_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/BranchApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/BranchApi.h new file mode 100644 index 000000000..cbea937a7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/BranchApi.h @@ -0,0 +1,106 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BranchApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_BranchApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_BranchApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/CreateTableBranchRequest.h" +#include "lance_namespace_rest_client/model/CreateTableBranchResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/ListTableBranchesResponse.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class BranchApi +{ +public: + + explicit BranchApi( std::shared_ptr apiClient ); + + virtual ~BranchApi(); + + /// + /// Create a new branch + /// + /// + /// Create a new branch for table `id` starting from a source ref (another branch and/or version), defaulting to the latest version of the main branch. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableBranch( + utility::string_t id, + std::shared_ptr createTableBranchRequest, + boost::optional delimiter + ) const; + /// + /// Delete a branch + /// + /// + /// Delete an existing branch from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteTableBranch( + utility::string_t id, + std::shared_ptr deleteTableBranchRequest, + boost::optional delimiter + ) const; + /// + /// List all branches for a table + /// + /// + /// List all branches that have been created for table `id`. Returns a map of branch names to their contents. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableBranchesRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listTableBranches( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_BranchApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/DataApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/DataApi.h new file mode 100644 index 000000000..877342f83 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/DataApi.h @@ -0,0 +1,287 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DataApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_DataApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_DataApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h" +#include "lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h" +#include "lance_namespace_rest_client/model/CountTableRowsRequest.h" +#include "lance_namespace_rest_client/model/CreateMaterializedViewRequest.h" +#include "lance_namespace_rest_client/model/CreateMaterializedViewResponse.h" +#include "lance_namespace_rest_client/model/CreateTableResponse.h" +#include "lance_namespace_rest_client/model/DeleteFromTableRequest.h" +#include "lance_namespace_rest_client/model/DeleteFromTableResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h" +#include "lance_namespace_rest_client/HttpContent.h" +#include "lance_namespace_rest_client/model/InsertIntoTableResponse.h" +#include "lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h" +#include "lance_namespace_rest_client/model/QueryTableRequest.h" +#include "lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h" +#include "lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableResponse.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class DataApi +{ +public: + + explicit DataApi( std::shared_ptr apiClient ); + + virtual ~DataApi(); + + /// + /// Add new columns to table schema + /// + /// + /// Add new columns to table `id` using SQL expressions or default values. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableAddColumns( + utility::string_t id, + std::shared_ptr alterTableAddColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Trigger an async column backfill job + /// + /// + /// Trigger an asynchronous backfill job for a computed column on table `id`. The column must be a virtual (UDF-backed) column. Returns a job ID for tracking. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableBackfillColumns( + utility::string_t id, + std::shared_ptr alterTableBackfillColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Analyze query execution plan + /// + /// + /// Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task analyzeTableQueryPlan( + utility::string_t id, + std::shared_ptr analyzeTableQueryPlanRequest, + boost::optional delimiter + ) const; + /// + /// Count rows in a table + /// + /// + /// Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task countTableRows( + utility::string_t id, + std::shared_ptr countTableRowsRequest, + boost::optional delimiter + ) const; + /// + /// Create a materialized view + /// + /// + /// Create a materialized view at identifier `id`. The view may be query-backed, UDTF-backed, or chunker-backed, controlled by the `kind` discriminator. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createMaterializedView( + utility::string_t id, + std::shared_ptr createMaterializedViewRequest, + boost::optional delimiter + ) const; + /// + /// Create a table with the given name + /// + /// + /// Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Arrow IPC data + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// (optional, default to utility::conversions::to_string_t("")) + /// Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. (optional, default to utility::conversions::to_string_t("")) + /// Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTable( + utility::string_t id, + std::shared_ptr body, + boost::optional delimiter, + boost::optional mode, + boost::optional properties, + boost::optional storageOptions + ) const; + /// + /// Delete rows from a table + /// + /// + /// Delete rows from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Delete request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteFromTable( + utility::string_t id, + std::shared_ptr deleteFromTableRequest, + boost::optional delimiter + ) const; + /// + /// Get query execution plan explanation + /// + /// + /// Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task explainTableQueryPlan( + utility::string_t id, + std::shared_ptr explainTableQueryPlanRequest, + boost::optional delimiter + ) const; + /// + /// Insert records into a table + /// + /// + /// Insert new records into table `id`. For tables that have been declared but not yet created on storage (is_only_declared=true), this operation will create the table with the provided data. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Arrow IPC stream containing the records to insert + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + /// How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it (optional, default to utility::conversions::to_string_t("")) + pplx::task> insertIntoTable( + utility::string_t id, + std::shared_ptr body, + boost::optional delimiter, + boost::optional branch, + boost::optional mode + ) const; + /// + /// Merge insert (upsert) records into a table + /// + /// + /// Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don't match. It returns the number of rows inserted and updated. For tables that have been declared but not yet created on storage (is_only_declared=true), this operation will create the table with the provided data (since there are no existing rows to merge with). REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Lance field path to use for matching rows. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// Arrow IPC stream containing the records to merge + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + /// Update all columns when rows match (optional, default to false) + /// The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. (optional, default to utility::conversions::to_string_t("")) + /// Insert all columns when rows don't match (optional, default to false) + /// Delete all rows from target table that don't match a row in the source table (optional, default to false) + /// Delete rows from the target table if there is no match AND the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. (optional, default to utility::conversions::to_string_t("")) + /// Timeout for the operation (e.g., \"30s\", \"5m\") (optional, default to utility::conversions::to_string_t("")) + /// Whether to use index for matching rows (optional, default to false) + pplx::task> mergeInsertIntoTable( + utility::string_t id, + utility::string_t on, + std::shared_ptr body, + boost::optional delimiter, + boost::optional branch, + boost::optional whenMatchedUpdateAll, + boost::optional whenMatchedUpdateAllFilt, + boost::optional whenNotMatchedInsertAll, + boost::optional whenNotMatchedBySourceDelete, + boost::optional whenNotMatchedBySourceDeleteFilt, + boost::optional timeout, + boost::optional useIndex + ) const; + /// + /// Query a table + /// + /// + /// Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Query request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> queryTable( + utility::string_t id, + std::shared_ptr queryTableRequest, + boost::optional delimiter + ) const; + /// + /// Trigger an async materialized view refresh + /// + /// + /// Trigger an asynchronous refresh job for materialized view `id`. Returns a job ID for tracking. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// (optional) + pplx::task> refreshMaterializedView( + utility::string_t id, + boost::optional delimiter, + boost::optional> refreshMaterializedViewRequest + ) const; + /// + /// Update rows in a table + /// + /// + /// Update existing rows in table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Update request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTable( + utility::string_t id, + std::shared_ptr updateTableRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_DataApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/IndexApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/IndexApi.h new file mode 100644 index 000000000..ab89d633e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/IndexApi.h @@ -0,0 +1,139 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * IndexApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_IndexApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_IndexApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/CreateTableIndexRequest.h" +#include "lance_namespace_rest_client/model/CreateTableIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h" +#include "lance_namespace_rest_client/model/DropTableIndexResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/ListTableIndicesRequest.h" +#include "lance_namespace_rest_client/model/ListTableIndicesResponse.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class IndexApi +{ +public: + + explicit IndexApi( std::shared_ptr apiClient ); + + virtual ~IndexApi(); + + /// + /// Create an index on a table + /// + /// + /// Create an index on a table field for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Index creation request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableIndex( + utility::string_t id, + std::shared_ptr createTableIndexRequest, + boost::optional delimiter + ) const; + /// + /// Create a scalar index on a table + /// + /// + /// Create a scalar index on a table field for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Scalar index creation request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableScalarIndex( + utility::string_t id, + std::shared_ptr createTableIndexRequest, + boost::optional delimiter + ) const; + /// + /// Get table index statistics + /// + /// + /// Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Name of the index to get stats for + /// Index stats request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTableIndexStats( + utility::string_t id, + utility::string_t indexName, + std::shared_ptr describeTableIndexStatsRequest, + boost::optional delimiter + ) const; + /// + /// Drop a specific index + /// + /// + /// Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Name of the index to drop + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropTableIndex( + utility::string_t id, + utility::string_t indexName, + boost::optional delimiter, + boost::optional branch + ) const; + /// + /// List indexes on a table + /// + /// + /// List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Index list request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> listTableIndices( + utility::string_t id, + std::shared_ptr listTableIndicesRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_IndexApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MaterializedViewApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MaterializedViewApi.h new file mode 100644 index 000000000..de938cf28 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MaterializedViewApi.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MaterializedViewApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_MaterializedViewApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_MaterializedViewApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/CreateMaterializedViewRequest.h" +#include "lance_namespace_rest_client/model/CreateMaterializedViewResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h" +#include "lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class MaterializedViewApi +{ +public: + + explicit MaterializedViewApi( std::shared_ptr apiClient ); + + virtual ~MaterializedViewApi(); + + /// + /// Create a materialized view + /// + /// + /// Create a materialized view at identifier `id`. The view may be query-backed, UDTF-backed, or chunker-backed, controlled by the `kind` discriminator. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createMaterializedView( + utility::string_t id, + std::shared_ptr createMaterializedViewRequest, + boost::optional delimiter + ) const; + /// + /// Trigger an async materialized view refresh + /// + /// + /// Trigger an asynchronous refresh job for materialized view `id`. Returns a job ID for tracking. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// (optional) + pplx::task> refreshMaterializedView( + utility::string_t id, + boost::optional delimiter, + boost::optional> refreshMaterializedViewRequest + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_MaterializedViewApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MetadataApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MetadataApi.h new file mode 100644 index 000000000..86592daaf --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/MetadataApi.h @@ -0,0 +1,708 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MetadataApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_MetadataApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_MetadataApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTransactionRequest.h" +#include "lance_namespace_rest_client/model/AlterTransactionResponse.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesRequest.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesResponse.h" +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/CreateNamespaceRequest.h" +#include "lance_namespace_rest_client/model/CreateNamespaceResponse.h" +#include "lance_namespace_rest_client/model/CreateTableBranchRequest.h" +#include "lance_namespace_rest_client/model/CreateTableBranchResponse.h" +#include "lance_namespace_rest_client/model/CreateTableIndexRequest.h" +#include "lance_namespace_rest_client/model/CreateTableIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableTagRequest.h" +#include "lance_namespace_rest_client/model/CreateTableTagResponse.h" +#include "lance_namespace_rest_client/model/CreateTableVersionRequest.h" +#include "lance_namespace_rest_client/model/CreateTableVersionResponse.h" +#include "lance_namespace_rest_client/model/DeclareTableRequest.h" +#include "lance_namespace_rest_client/model/DeclareTableResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableTagRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableTagResponse.h" +#include "lance_namespace_rest_client/model/DeregisterTableRequest.h" +#include "lance_namespace_rest_client/model/DeregisterTableResponse.h" +#include "lance_namespace_rest_client/model/DescribeNamespaceRequest.h" +#include "lance_namespace_rest_client/model/DescribeNamespaceResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableVersionRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableVersionResponse.h" +#include "lance_namespace_rest_client/model/DescribeTransactionRequest.h" +#include "lance_namespace_rest_client/model/DescribeTransactionResponse.h" +#include "lance_namespace_rest_client/model/DropNamespaceRequest.h" +#include "lance_namespace_rest_client/model/DropNamespaceResponse.h" +#include "lance_namespace_rest_client/model/DropTableIndexResponse.h" +#include "lance_namespace_rest_client/model/DropTableResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/GetTableStatsRequest.h" +#include "lance_namespace_rest_client/model/GetTableStatsResponse.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionRequest.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionResponse.h" +#include "lance_namespace_rest_client/model/ListNamespacesResponse.h" +#include "lance_namespace_rest_client/model/ListTableBranchesResponse.h" +#include "lance_namespace_rest_client/model/ListTableIndicesRequest.h" +#include "lance_namespace_rest_client/model/ListTableIndicesResponse.h" +#include "lance_namespace_rest_client/model/ListTableTagsResponse.h" +#include "lance_namespace_rest_client/model/ListTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/ListTablesResponse.h" +#include "lance_namespace_rest_client/model/NamespaceExistsRequest.h" +#include "lance_namespace_rest_client/model/RegisterTableRequest.h" +#include "lance_namespace_rest_client/model/RegisterTableResponse.h" +#include "lance_namespace_rest_client/model/RenameTableRequest.h" +#include "lance_namespace_rest_client/model/RenameTableResponse.h" +#include "lance_namespace_rest_client/model/RestoreTableRequest.h" +#include "lance_namespace_rest_client/model/RestoreTableResponse.h" +#include "lance_namespace_rest_client/model/TableExistsRequest.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableTagRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableTagResponse.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class MetadataApi +{ +public: + + explicit MetadataApi( std::shared_ptr apiClient ); + + virtual ~MetadataApi(); + + /// + /// Modify existing columns + /// + /// + /// Modify existing columns in table `id`, such as renaming or changing data types. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableAlterColumns( + utility::string_t id, + std::shared_ptr alterTableAlterColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Remove columns from table + /// + /// + /// Remove specified columns from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableDropColumns( + utility::string_t id, + std::shared_ptr alterTableDropColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Alter information of a transaction. + /// + /// + /// Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTransaction( + utility::string_t id, + std::shared_ptr alterTransactionRequest, + boost::optional delimiter + ) const; + /// + /// Atomically commit a batch of mixed table operations + /// + /// + /// Atomically commit a batch of table operations. This is a generalized version of `BatchCreateTableVersions` that supports mixed operation types within a single atomic transaction at the metadata layer. Supported operation types: - `DeclareTable`: Declare (reserve) a new table - `CreateTableVersion`: Create a new version entry for a table - `DeleteTableVersions`: Delete version ranges from a table - `DeregisterTable`: Deregister (soft-delete) a table All operations are committed atomically: either all succeed or none are applied. + /// + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchCommitTables( + std::shared_ptr batchCommitTablesRequest, + boost::optional delimiter + ) const; + /// + /// Atomically create versions for multiple tables + /// + /// + /// Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + /// + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchCreateTableVersions( + std::shared_ptr batchCreateTableVersionsRequest, + boost::optional delimiter + ) const; + /// + /// Delete table version records + /// + /// + /// Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchDeleteTableVersions( + utility::string_t id, + std::shared_ptr batchDeleteTableVersionsRequest, + boost::optional delimiter + ) const; + /// + /// Create a new namespace + /// + /// + /// Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createNamespace( + utility::string_t id, + std::shared_ptr createNamespaceRequest, + boost::optional delimiter + ) const; + /// + /// Create a new branch + /// + /// + /// Create a new branch for table `id` starting from a source ref (another branch and/or version), defaulting to the latest version of the main branch. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableBranch( + utility::string_t id, + std::shared_ptr createTableBranchRequest, + boost::optional delimiter + ) const; + /// + /// Create an index on a table + /// + /// + /// Create an index on a table field for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Index creation request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableIndex( + utility::string_t id, + std::shared_ptr createTableIndexRequest, + boost::optional delimiter + ) const; + /// + /// Create a scalar index on a table + /// + /// + /// Create a scalar index on a table field for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Scalar index creation request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableScalarIndex( + utility::string_t id, + std::shared_ptr createTableIndexRequest, + boost::optional delimiter + ) const; + /// + /// Create a new tag + /// + /// + /// Create a new tag for table `id` that points to a specific version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableTag( + utility::string_t id, + std::shared_ptr createTableTagRequest, + boost::optional delimiter + ) const; + /// + /// Create a new table version + /// + /// + /// Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableVersion( + utility::string_t id, + std::shared_ptr createTableVersionRequest, + boost::optional delimiter + ) const; + /// + /// Declare a table + /// + /// + /// Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> declareTable( + utility::string_t id, + std::shared_ptr declareTableRequest, + boost::optional delimiter + ) const; + /// + /// Delete a branch + /// + /// + /// Delete an existing branch from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteTableBranch( + utility::string_t id, + std::shared_ptr deleteTableBranchRequest, + boost::optional delimiter + ) const; + /// + /// Delete a tag + /// + /// + /// Delete an existing tag from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteTableTag( + utility::string_t id, + std::shared_ptr deleteTableTagRequest, + boost::optional delimiter + ) const; + /// + /// Deregister a table + /// + /// + /// Deregister table `id` from its namespace. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deregisterTable( + utility::string_t id, + std::shared_ptr deregisterTableRequest, + boost::optional delimiter + ) const; + /// + /// Describe a namespace + /// + /// + /// Describe the detailed information for namespace `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeNamespace( + utility::string_t id, + std::shared_ptr describeNamespaceRequest, + boost::optional delimiter + ) const; + /// + /// Describe information of a table + /// + /// + /// Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri`, `load_detailed_metadata`, and `check_declared` as query parameters instead of in the request body. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Whether to include the table URI in the response (optional, default to false) + /// Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. (optional, default to false) + /// Whether to check if the table exists only as a namespace declaration without storage data. When false (default), the response should return null for `is_only_declared` unless another option such as `load_detailed_metadata` requires the check. (optional, default to false) + pplx::task> describeTable( + utility::string_t id, + std::shared_ptr describeTableRequest, + boost::optional delimiter, + boost::optional withTableUri, + boost::optional loadDetailedMetadata, + boost::optional checkDeclared + ) const; + /// + /// Get table index statistics + /// + /// + /// Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Name of the index to get stats for + /// Index stats request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTableIndexStats( + utility::string_t id, + utility::string_t indexName, + std::shared_ptr describeTableIndexStatsRequest, + boost::optional delimiter + ) const; + /// + /// Describe a specific table version + /// + /// + /// Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTableVersion( + utility::string_t id, + std::shared_ptr describeTableVersionRequest, + boost::optional delimiter + ) const; + /// + /// Describe information about a transaction + /// + /// + /// Return a detailed information for a given transaction + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTransaction( + utility::string_t id, + std::shared_ptr describeTransactionRequest, + boost::optional delimiter + ) const; + /// + /// Drop a namespace + /// + /// + /// Drop namespace `id` from its parent namespace. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropNamespace( + utility::string_t id, + std::shared_ptr dropNamespaceRequest, + boost::optional delimiter + ) const; + /// + /// Drop a table + /// + /// + /// Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropTable( + utility::string_t id, + boost::optional delimiter + ) const; + /// + /// Drop a specific index + /// + /// + /// Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Name of the index to drop + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropTableIndex( + utility::string_t id, + utility::string_t indexName, + boost::optional delimiter, + boost::optional branch + ) const; + /// + /// Get table statistics + /// + /// + /// Get statistics for table `id`, including row counts, data sizes, and column statistics. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> getTableStats( + utility::string_t id, + std::shared_ptr getTableStatsRequest, + boost::optional delimiter + ) const; + /// + /// Get version for a specific tag + /// + /// + /// Get the version number that a specific tag points to for table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> getTableTagVersion( + utility::string_t id, + std::shared_ptr getTableTagVersionRequest, + boost::optional delimiter + ) const; + /// + /// List namespaces + /// + /// + /// List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listNamespaces( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// List all branches for a table + /// + /// + /// List all branches that have been created for table `id`. Returns a map of branch names to their contents. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableBranchesRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listTableBranches( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// List indexes on a table + /// + /// + /// List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Index list request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> listTableIndices( + utility::string_t id, + std::shared_ptr listTableIndicesRequest, + boost::optional delimiter + ) const; + /// + /// List all tags for a table + /// + /// + /// List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listTableTags( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// List all versions of a table + /// + /// + /// List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + /// When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. (optional, default to false) + pplx::task> listTableVersions( + utility::string_t id, + boost::optional delimiter, + boost::optional branch, + boost::optional pageToken, + boost::optional limit, + boost::optional descending + ) const; + /// + /// List tables in a namespace + /// + /// + /// List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `include_declared`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + /// When true (default), includes tables that have been declared in the namespace but not yet created on storage, in addition to tables that have been created. When false, only tables with storage components are returned. (optional, default to false) + pplx::task> listTables( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit, + boost::optional includeDeclared + ) const; + /// + /// Check if a namespace exists + /// + /// + /// Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task namespaceExists( + utility::string_t id, + std::shared_ptr namespaceExistsRequest, + boost::optional delimiter + ) const; + /// + /// Register a table to a namespace + /// + /// + /// Register an existing table at a given storage location as `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> registerTable( + utility::string_t id, + std::shared_ptr registerTableRequest, + boost::optional delimiter + ) const; + /// + /// Rename a table + /// + /// + /// Rename table `id` to a new name. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> renameTable( + utility::string_t id, + std::shared_ptr renameTableRequest, + boost::optional delimiter + ) const; + /// + /// Restore table to a specific version + /// + /// + /// Restore table `id` to a specific version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> restoreTable( + utility::string_t id, + std::shared_ptr restoreTableRequest, + boost::optional delimiter + ) const; + /// + /// Check if a table exists + /// + /// + /// Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task tableExists( + utility::string_t id, + std::shared_ptr tableExistsRequest, + boost::optional delimiter + ) const; + /// + /// Update per-field metadata + /// + /// + /// Update the Arrow field (column) metadata for table `id`. Each entry targets a field by `path` and merges the provided key-value pairs into that field's existing metadata, or replaces it when `replace` is true. A null metadata value deletes that key. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateFieldMetadata( + utility::string_t id, + std::shared_ptr updateFieldMetadataRequest, + boost::optional delimiter + ) const; + /// + /// Update table schema metadata + /// + /// + /// Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTableSchemaMetadata( + utility::string_t id, + std::map requestBody, + boost::optional delimiter, + boost::optional branch + ) const; + /// + /// Update a tag to point to a different version + /// + /// + /// Update an existing tag for table `id` to point to a different version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTableTag( + utility::string_t id, + std::shared_ptr updateTableTagRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_MetadataApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/NamespaceApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/NamespaceApi.h new file mode 100644 index 000000000..800219820 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/NamespaceApi.h @@ -0,0 +1,156 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * NamespaceApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_NamespaceApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_NamespaceApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/CreateNamespaceRequest.h" +#include "lance_namespace_rest_client/model/CreateNamespaceResponse.h" +#include "lance_namespace_rest_client/model/DescribeNamespaceRequest.h" +#include "lance_namespace_rest_client/model/DescribeNamespaceResponse.h" +#include "lance_namespace_rest_client/model/DropNamespaceRequest.h" +#include "lance_namespace_rest_client/model/DropNamespaceResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/ListNamespacesResponse.h" +#include "lance_namespace_rest_client/model/ListTablesResponse.h" +#include "lance_namespace_rest_client/model/NamespaceExistsRequest.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class NamespaceApi +{ +public: + + explicit NamespaceApi( std::shared_ptr apiClient ); + + virtual ~NamespaceApi(); + + /// + /// Create a new namespace + /// + /// + /// Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createNamespace( + utility::string_t id, + std::shared_ptr createNamespaceRequest, + boost::optional delimiter + ) const; + /// + /// Describe a namespace + /// + /// + /// Describe the detailed information for namespace `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeNamespace( + utility::string_t id, + std::shared_ptr describeNamespaceRequest, + boost::optional delimiter + ) const; + /// + /// Drop a namespace + /// + /// + /// Drop namespace `id` from its parent namespace. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropNamespace( + utility::string_t id, + std::shared_ptr dropNamespaceRequest, + boost::optional delimiter + ) const; + /// + /// List namespaces + /// + /// + /// List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listNamespaces( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// List tables in a namespace + /// + /// + /// List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `include_declared`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + /// When true (default), includes tables that have been declared in the namespace but not yet created on storage, in addition to tables that have been created. When false, only tables with storage components are returned. (optional, default to false) + pplx::task> listTables( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit, + boost::optional includeDeclared + ) const; + /// + /// Check if a namespace exists + /// + /// + /// Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task namespaceExists( + utility::string_t id, + std::shared_ptr namespaceExistsRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_NamespaceApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TableApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TableApi.h new file mode 100644 index 000000000..e18576806 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TableApi.h @@ -0,0 +1,810 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TableApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_TableApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_TableApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h" +#include "lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesRequest.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesResponse.h" +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/CountTableRowsRequest.h" +#include "lance_namespace_rest_client/model/CreateTableBranchRequest.h" +#include "lance_namespace_rest_client/model/CreateTableBranchResponse.h" +#include "lance_namespace_rest_client/model/CreateTableIndexRequest.h" +#include "lance_namespace_rest_client/model/CreateTableIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableResponse.h" +#include "lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableTagRequest.h" +#include "lance_namespace_rest_client/model/CreateTableTagResponse.h" +#include "lance_namespace_rest_client/model/CreateTableVersionRequest.h" +#include "lance_namespace_rest_client/model/CreateTableVersionResponse.h" +#include "lance_namespace_rest_client/model/DeclareTableRequest.h" +#include "lance_namespace_rest_client/model/DeclareTableResponse.h" +#include "lance_namespace_rest_client/model/DeleteFromTableRequest.h" +#include "lance_namespace_rest_client/model/DeleteFromTableResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableTagRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableTagResponse.h" +#include "lance_namespace_rest_client/model/DeregisterTableRequest.h" +#include "lance_namespace_rest_client/model/DeregisterTableResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableVersionRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableVersionResponse.h" +#include "lance_namespace_rest_client/model/DropTableIndexResponse.h" +#include "lance_namespace_rest_client/model/DropTableResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h" +#include "lance_namespace_rest_client/model/GetTableStatsRequest.h" +#include "lance_namespace_rest_client/model/GetTableStatsResponse.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionRequest.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionResponse.h" +#include "lance_namespace_rest_client/HttpContent.h" +#include "lance_namespace_rest_client/model/InsertIntoTableResponse.h" +#include "lance_namespace_rest_client/model/ListTableBranchesResponse.h" +#include "lance_namespace_rest_client/model/ListTableIndicesRequest.h" +#include "lance_namespace_rest_client/model/ListTableIndicesResponse.h" +#include "lance_namespace_rest_client/model/ListTableTagsResponse.h" +#include "lance_namespace_rest_client/model/ListTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/ListTablesResponse.h" +#include "lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h" +#include "lance_namespace_rest_client/model/QueryTableRequest.h" +#include "lance_namespace_rest_client/model/RegisterTableRequest.h" +#include "lance_namespace_rest_client/model/RegisterTableResponse.h" +#include "lance_namespace_rest_client/model/RenameTableRequest.h" +#include "lance_namespace_rest_client/model/RenameTableResponse.h" +#include "lance_namespace_rest_client/model/RestoreTableRequest.h" +#include "lance_namespace_rest_client/model/RestoreTableResponse.h" +#include "lance_namespace_rest_client/model/TableExistsRequest.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableTagRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableTagResponse.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class TableApi +{ +public: + + explicit TableApi( std::shared_ptr apiClient ); + + virtual ~TableApi(); + + /// + /// Add new columns to table schema + /// + /// + /// Add new columns to table `id` using SQL expressions or default values. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableAddColumns( + utility::string_t id, + std::shared_ptr alterTableAddColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Modify existing columns + /// + /// + /// Modify existing columns in table `id`, such as renaming or changing data types. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableAlterColumns( + utility::string_t id, + std::shared_ptr alterTableAlterColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Trigger an async column backfill job + /// + /// + /// Trigger an asynchronous backfill job for a computed column on table `id`. The column must be a virtual (UDF-backed) column. Returns a job ID for tracking. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableBackfillColumns( + utility::string_t id, + std::shared_ptr alterTableBackfillColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Remove columns from table + /// + /// + /// Remove specified columns from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTableDropColumns( + utility::string_t id, + std::shared_ptr alterTableDropColumnsRequest, + boost::optional delimiter + ) const; + /// + /// Analyze query execution plan + /// + /// + /// Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task analyzeTableQueryPlan( + utility::string_t id, + std::shared_ptr analyzeTableQueryPlanRequest, + boost::optional delimiter + ) const; + /// + /// Atomically commit a batch of mixed table operations + /// + /// + /// Atomically commit a batch of table operations. This is a generalized version of `BatchCreateTableVersions` that supports mixed operation types within a single atomic transaction at the metadata layer. Supported operation types: - `DeclareTable`: Declare (reserve) a new table - `CreateTableVersion`: Create a new version entry for a table - `DeleteTableVersions`: Delete version ranges from a table - `DeregisterTable`: Deregister (soft-delete) a table All operations are committed atomically: either all succeed or none are applied. + /// + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchCommitTables( + std::shared_ptr batchCommitTablesRequest, + boost::optional delimiter + ) const; + /// + /// Atomically create versions for multiple tables + /// + /// + /// Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + /// + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchCreateTableVersions( + std::shared_ptr batchCreateTableVersionsRequest, + boost::optional delimiter + ) const; + /// + /// Delete table version records + /// + /// + /// Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchDeleteTableVersions( + utility::string_t id, + std::shared_ptr batchDeleteTableVersionsRequest, + boost::optional delimiter + ) const; + /// + /// Count rows in a table + /// + /// + /// Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task countTableRows( + utility::string_t id, + std::shared_ptr countTableRowsRequest, + boost::optional delimiter + ) const; + /// + /// Create a table with the given name + /// + /// + /// Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Arrow IPC data + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// (optional, default to utility::conversions::to_string_t("")) + /// Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. (optional, default to utility::conversions::to_string_t("")) + /// Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTable( + utility::string_t id, + std::shared_ptr body, + boost::optional delimiter, + boost::optional mode, + boost::optional properties, + boost::optional storageOptions + ) const; + /// + /// Create a new branch + /// + /// + /// Create a new branch for table `id` starting from a source ref (another branch and/or version), defaulting to the latest version of the main branch. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableBranch( + utility::string_t id, + std::shared_ptr createTableBranchRequest, + boost::optional delimiter + ) const; + /// + /// Create an index on a table + /// + /// + /// Create an index on a table field for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Index creation request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableIndex( + utility::string_t id, + std::shared_ptr createTableIndexRequest, + boost::optional delimiter + ) const; + /// + /// Create a scalar index on a table + /// + /// + /// Create a scalar index on a table field for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Scalar index creation request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableScalarIndex( + utility::string_t id, + std::shared_ptr createTableIndexRequest, + boost::optional delimiter + ) const; + /// + /// Create a new tag + /// + /// + /// Create a new tag for table `id` that points to a specific version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableTag( + utility::string_t id, + std::shared_ptr createTableTagRequest, + boost::optional delimiter + ) const; + /// + /// Create a new table version + /// + /// + /// Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableVersion( + utility::string_t id, + std::shared_ptr createTableVersionRequest, + boost::optional delimiter + ) const; + /// + /// Declare a table + /// + /// + /// Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> declareTable( + utility::string_t id, + std::shared_ptr declareTableRequest, + boost::optional delimiter + ) const; + /// + /// Delete rows from a table + /// + /// + /// Delete rows from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Delete request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteFromTable( + utility::string_t id, + std::shared_ptr deleteFromTableRequest, + boost::optional delimiter + ) const; + /// + /// Delete a branch + /// + /// + /// Delete an existing branch from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteTableBranch( + utility::string_t id, + std::shared_ptr deleteTableBranchRequest, + boost::optional delimiter + ) const; + /// + /// Delete a tag + /// + /// + /// Delete an existing tag from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteTableTag( + utility::string_t id, + std::shared_ptr deleteTableTagRequest, + boost::optional delimiter + ) const; + /// + /// Deregister a table + /// + /// + /// Deregister table `id` from its namespace. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deregisterTable( + utility::string_t id, + std::shared_ptr deregisterTableRequest, + boost::optional delimiter + ) const; + /// + /// Describe information of a table + /// + /// + /// Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri`, `load_detailed_metadata`, and `check_declared` as query parameters instead of in the request body. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Whether to include the table URI in the response (optional, default to false) + /// Whether to load detailed metadata that requires opening the dataset. When false (default), only `location` is required in the response. When true, the response includes additional metadata such as `version`, `schema`, and `stats`. (optional, default to false) + /// Whether to check if the table exists only as a namespace declaration without storage data. When false (default), the response should return null for `is_only_declared` unless another option such as `load_detailed_metadata` requires the check. (optional, default to false) + pplx::task> describeTable( + utility::string_t id, + std::shared_ptr describeTableRequest, + boost::optional delimiter, + boost::optional withTableUri, + boost::optional loadDetailedMetadata, + boost::optional checkDeclared + ) const; + /// + /// Get table index statistics + /// + /// + /// Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Name of the index to get stats for + /// Index stats request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTableIndexStats( + utility::string_t id, + utility::string_t indexName, + std::shared_ptr describeTableIndexStatsRequest, + boost::optional delimiter + ) const; + /// + /// Describe a specific table version + /// + /// + /// Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTableVersion( + utility::string_t id, + std::shared_ptr describeTableVersionRequest, + boost::optional delimiter + ) const; + /// + /// Drop a table + /// + /// + /// Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropTable( + utility::string_t id, + boost::optional delimiter + ) const; + /// + /// Drop a specific index + /// + /// + /// Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Name of the index to drop + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + pplx::task> dropTableIndex( + utility::string_t id, + utility::string_t indexName, + boost::optional delimiter, + boost::optional branch + ) const; + /// + /// Get query execution plan explanation + /// + /// + /// Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task explainTableQueryPlan( + utility::string_t id, + std::shared_ptr explainTableQueryPlanRequest, + boost::optional delimiter + ) const; + /// + /// Get table statistics + /// + /// + /// Get statistics for table `id`, including row counts, data sizes, and column statistics. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> getTableStats( + utility::string_t id, + std::shared_ptr getTableStatsRequest, + boost::optional delimiter + ) const; + /// + /// Get version for a specific tag + /// + /// + /// Get the version number that a specific tag points to for table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> getTableTagVersion( + utility::string_t id, + std::shared_ptr getTableTagVersionRequest, + boost::optional delimiter + ) const; + /// + /// Insert records into a table + /// + /// + /// Insert new records into table `id`. For tables that have been declared but not yet created on storage (is_only_declared=true), this operation will create the table with the provided data. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Arrow IPC stream containing the records to insert + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + /// How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it (optional, default to utility::conversions::to_string_t("")) + pplx::task> insertIntoTable( + utility::string_t id, + std::shared_ptr body, + boost::optional delimiter, + boost::optional branch, + boost::optional mode + ) const; + /// + /// List all tables + /// + /// + /// List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListAllTablesRequest` information in the following way: - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `delimiter`: pass through query parameter of the same name - `include_declared`: pass through query parameter of the same name + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + /// When true (default), includes tables that have been declared in the namespace but not yet created on storage, in addition to tables that have been created. When false, only tables with storage components are returned. (optional, default to false) + pplx::task> listAllTables( + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit, + boost::optional includeDeclared + ) const; + /// + /// List all branches for a table + /// + /// + /// List all branches that have been created for table `id`. Returns a map of branch names to their contents. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableBranchesRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listTableBranches( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// List indexes on a table + /// + /// + /// List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Index list request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> listTableIndices( + utility::string_t id, + std::shared_ptr listTableIndicesRequest, + boost::optional delimiter + ) const; + /// + /// List all tags for a table + /// + /// + /// List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listTableTags( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// List all versions of a table + /// + /// + /// List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + /// When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. (optional, default to false) + pplx::task> listTableVersions( + utility::string_t id, + boost::optional delimiter, + boost::optional branch, + boost::optional pageToken, + boost::optional limit, + boost::optional descending + ) const; + /// + /// List tables in a namespace + /// + /// + /// List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `include_declared`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + /// When true (default), includes tables that have been declared in the namespace but not yet created on storage, in addition to tables that have been created. When false, only tables with storage components are returned. (optional, default to false) + pplx::task> listTables( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit, + boost::optional includeDeclared + ) const; + /// + /// Merge insert (upsert) records into a table + /// + /// + /// Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don't match. It returns the number of rows inserted and updated. For tables that have been declared but not yet created on storage (is_only_declared=true), this operation will create the table with the provided data (since there are no existing rows to merge with). REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Lance field path to use for matching rows. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// Arrow IPC stream containing the records to merge + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + /// Update all columns when rows match (optional, default to false) + /// The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. (optional, default to utility::conversions::to_string_t("")) + /// Insert all columns when rows don't match (optional, default to false) + /// Delete all rows from target table that don't match a row in the source table (optional, default to false) + /// Delete rows from the target table if there is no match AND the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. (optional, default to utility::conversions::to_string_t("")) + /// Timeout for the operation (e.g., \"30s\", \"5m\") (optional, default to utility::conversions::to_string_t("")) + /// Whether to use index for matching rows (optional, default to false) + pplx::task> mergeInsertIntoTable( + utility::string_t id, + utility::string_t on, + std::shared_ptr body, + boost::optional delimiter, + boost::optional branch, + boost::optional whenMatchedUpdateAll, + boost::optional whenMatchedUpdateAllFilt, + boost::optional whenNotMatchedInsertAll, + boost::optional whenNotMatchedBySourceDelete, + boost::optional whenNotMatchedBySourceDeleteFilt, + boost::optional timeout, + boost::optional useIndex + ) const; + /// + /// Query a table + /// + /// + /// Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Query request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> queryTable( + utility::string_t id, + std::shared_ptr queryTableRequest, + boost::optional delimiter + ) const; + /// + /// Register a table to a namespace + /// + /// + /// Register an existing table at a given storage location as `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> registerTable( + utility::string_t id, + std::shared_ptr registerTableRequest, + boost::optional delimiter + ) const; + /// + /// Rename a table + /// + /// + /// Rename table `id` to a new name. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> renameTable( + utility::string_t id, + std::shared_ptr renameTableRequest, + boost::optional delimiter + ) const; + /// + /// Restore table to a specific version + /// + /// + /// Restore table `id` to a specific version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> restoreTable( + utility::string_t id, + std::shared_ptr restoreTableRequest, + boost::optional delimiter + ) const; + /// + /// Check if a table exists + /// + /// + /// Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task tableExists( + utility::string_t id, + std::shared_ptr tableExistsRequest, + boost::optional delimiter + ) const; + /// + /// Update per-field metadata + /// + /// + /// Update the Arrow field (column) metadata for table `id`. Each entry targets a field by `path` and merges the provided key-value pairs into that field's existing metadata, or replaces it when `replace` is true. A null metadata value deletes that key. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateFieldMetadata( + utility::string_t id, + std::shared_ptr updateFieldMetadataRequest, + boost::optional delimiter + ) const; + /// + /// Update rows in a table + /// + /// + /// Update existing rows in table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// Update request + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTable( + utility::string_t id, + std::shared_ptr updateTableRequest, + boost::optional delimiter + ) const; + /// + /// Update table schema metadata + /// + /// + /// Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Optional branch to target. When not specified, the main branch is used. Used by branch-scoped operations that cannot carry a `branch` field in their request body (Arrow IPC stream and bodyless operations). Operations with a JSON request body carry `branch` as a body field instead. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTableSchemaMetadata( + utility::string_t id, + std::map requestBody, + boost::optional delimiter, + boost::optional branch + ) const; + /// + /// Update a tag to point to a different version + /// + /// + /// Update an existing tag for table `id` to point to a different version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTableTag( + utility::string_t id, + std::shared_ptr updateTableTagRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_TableApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TagApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TagApi.h new file mode 100644 index 000000000..0eaa962f7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TagApi.h @@ -0,0 +1,138 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TagApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_TagApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_TagApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/CreateTableTagRequest.h" +#include "lance_namespace_rest_client/model/CreateTableTagResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableTagRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableTagResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionRequest.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionResponse.h" +#include "lance_namespace_rest_client/model/ListTableTagsResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableTagRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableTagResponse.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class TagApi +{ +public: + + explicit TagApi( std::shared_ptr apiClient ); + + virtual ~TagApi(); + + /// + /// Create a new tag + /// + /// + /// Create a new tag for table `id` that points to a specific version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> createTableTag( + utility::string_t id, + std::shared_ptr createTableTagRequest, + boost::optional delimiter + ) const; + /// + /// Delete a tag + /// + /// + /// Delete an existing tag from table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> deleteTableTag( + utility::string_t id, + std::shared_ptr deleteTableTagRequest, + boost::optional delimiter + ) const; + /// + /// Get version for a specific tag + /// + /// + /// Get the version number that a specific tag points to for table `id`. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> getTableTagVersion( + utility::string_t id, + std::shared_ptr getTableTagVersionRequest, + boost::optional delimiter + ) const; + /// + /// List all tags for a table + /// + /// + /// List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + /// Pagination token from a previous request (optional, default to utility::conversions::to_string_t("")) + /// Maximum number of items to return (optional, default to 0) + pplx::task> listTableTags( + utility::string_t id, + boost::optional delimiter, + boost::optional pageToken, + boost::optional limit + ) const; + /// + /// Update a tag to point to a different version + /// + /// + /// Update an existing tag for table `id` to point to a different version. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> updateTableTag( + utility::string_t id, + std::shared_ptr updateTableTagRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_TagApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TransactionApi.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TransactionApi.h new file mode 100644 index 000000000..bac091451 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/api/TransactionApi.h @@ -0,0 +1,103 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TransactionApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_TransactionApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_TransactionApi_H_ + + + +#include "lance_namespace_rest_client/ApiClient.h" + +#include "lance_namespace_rest_client/model/AlterTransactionRequest.h" +#include "lance_namespace_rest_client/model/AlterTransactionResponse.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesRequest.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesResponse.h" +#include "lance_namespace_rest_client/model/DescribeTransactionRequest.h" +#include "lance_namespace_rest_client/model/DescribeTransactionResponse.h" +#include "lance_namespace_rest_client/model/ErrorResponse.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class TransactionApi +{ +public: + + explicit TransactionApi( std::shared_ptr apiClient ); + + virtual ~TransactionApi(); + + /// + /// Alter information of a transaction. + /// + /// + /// Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> alterTransaction( + utility::string_t id, + std::shared_ptr alterTransactionRequest, + boost::optional delimiter + ) const; + /// + /// Atomically commit a batch of mixed table operations + /// + /// + /// Atomically commit a batch of table operations. This is a generalized version of `BatchCreateTableVersions` that supports mixed operation types within a single atomic transaction at the metadata layer. Supported operation types: - `DeclareTable`: Declare (reserve) a new table - `CreateTableVersion`: Create a new version entry for a table - `DeleteTableVersions`: Delete version ranges from a table - `DeregisterTable`: Deregister (soft-delete) a table All operations are committed atomically: either all succeed or none are applied. + /// + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> batchCommitTables( + std::shared_ptr batchCommitTablesRequest, + boost::optional delimiter + ) const; + /// + /// Describe information about a transaction + /// + /// + /// Return a detailed information for a given transaction + /// + /// `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. + /// + /// An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional, default to utility::conversions::to_string_t("")) + pplx::task> describeTransaction( + utility::string_t id, + std::shared_ptr describeTransactionRequest, + boost::optional delimiter + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_TransactionApi_H_ */ + diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddColumnsEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddColumnsEntry.h new file mode 100644 index 000000000..645375d23 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddColumnsEntry.h @@ -0,0 +1,98 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AddColumnsEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AddColumnsEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AddColumnsEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/AddVirtualColumnEntry.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AddVirtualColumnEntry; + + +class AddColumnsEntry + : public ModelBase +{ +public: + AddColumnsEntry(); + virtual ~AddColumnsEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AddColumnsEntry members + + + /// + /// Name of the new column + /// + utility::string_t getName() const; + bool nameIsSet() const; + void unsetName(); + void setName(const utility::string_t& value); + + /// + /// SQL expression for the column (optional if virtual_column is specified) + /// + utility::string_t getExpression() const; + bool expressionIsSet() const; + void unsetExpression(); + void setExpression(const utility::string_t& value); + + std::shared_ptr getVirtualColumn() const; + bool virtualColumnIsSet() const; + void unsetVirtual_column(); + void setVirtualColumn(const std::shared_ptr& value); + + +protected: + utility::string_t m_Name; + bool m_NameIsSet; + + utility::string_t m_Expression; + bool m_ExpressionIsSet; + + std::shared_ptr m_Virtual_column; + bool m_Virtual_columnIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AddColumnsEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnEntry.h new file mode 100644 index 000000000..9ea3cb19f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnEntry.h @@ -0,0 +1,191 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AddVirtualColumnEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AddVirtualColumnEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AddVirtualColumnEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AddVirtualColumnOutputEntry; + + +class AddVirtualColumnEntry + : public ModelBase +{ +public: + AddVirtualColumnEntry(); + virtual ~AddVirtualColumnEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AddVirtualColumnEntry members + + + /// + /// List of input Lance field paths for the virtual column. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. + /// + std::vector getInputColumns() const; + bool inputColumnsIsSet() const; + void unsetInput_columns(); + void setInputColumns(const std::vector& value); + + /// + /// Output columns produced by the virtual column UDF + /// + std::vector> getOutputs() const; + bool outputsIsSet() const; + void unsetOutputs(); + void setOutputs(const std::vector>& value); + + /// + /// Docker image to use for the UDF + /// + utility::string_t getImage() const; + bool imageIsSet() const; + void unsetImage(); + void setImage(const utility::string_t& value); + + /// + /// Base64 encoded pickled UDF + /// + utility::string_t getUdf() const; + bool udfIsSet() const; + void unsetUdf(); + void setUdf(const utility::string_t& value); + + /// + /// Name of the UDF + /// + utility::string_t getUdfName() const; + bool udfNameIsSet() const; + void unsetUdf_name(); + void setUdfName(const utility::string_t& value); + + /// + /// Version of the UDF + /// + utility::string_t getUdfVersion() const; + bool udfVersionIsSet() const; + void unsetUdf_version(); + void setUdfVersion(const utility::string_t& value); + + /// + /// UDF backend type (e.g. DockerUDFSpecV1) + /// + utility::string_t getUdfBackend() const; + bool udfBackendIsSet() const; + void unsetUdf_backend(); + void setUdfBackend(const utility::string_t& value); + + /// + /// Whether to automatically backfill the column after creation + /// + bool isAutoBackfill() const; + bool autoBackfillIsSet() const; + void unsetAuto_backfill(); + void setAutoBackfill(bool value); + + /// + /// JSON-serialized manifest for the UDF environment + /// + utility::string_t getManifest() const; + bool manifestIsSet() const; + void unsetManifest(); + void setManifest(const utility::string_t& value); + + /// + /// SHA-256 checksum of the manifest content + /// + utility::string_t getManifestChecksum() const; + bool manifestChecksumIsSet() const; + void unsetManifest_checksum(); + void setManifestChecksum(const utility::string_t& value); + + /// + /// User-supplied field metadata (string key-value pairs) + /// + std::map getFieldMetadata() const; + bool fieldMetadataIsSet() const; + void unsetField_metadata(); + void setFieldMetadata(const std::map& value); + + +protected: + std::vector m_Input_columns; + bool m_Input_columnsIsSet; + + std::vector> m_Outputs; + bool m_OutputsIsSet; + + utility::string_t m_Image; + bool m_ImageIsSet; + + utility::string_t m_Udf; + bool m_UdfIsSet; + + utility::string_t m_Udf_name; + bool m_Udf_nameIsSet; + + utility::string_t m_Udf_version; + bool m_Udf_versionIsSet; + + utility::string_t m_Udf_backend; + bool m_Udf_backendIsSet; + + bool m_Auto_backfill; + bool m_Auto_backfillIsSet; + + utility::string_t m_Manifest; + bool m_ManifestIsSet; + + utility::string_t m_Manifest_checksum; + bool m_Manifest_checksumIsSet; + + std::map m_Field_metadata; + bool m_Field_metadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AddVirtualColumnEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h new file mode 100644 index 000000000..9b7d2bf8d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AddVirtualColumnOutputEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AddVirtualColumnOutputEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AddVirtualColumnOutputEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/Object.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AddVirtualColumnOutputEntry + : public ModelBase +{ +public: + AddVirtualColumnOutputEntry(); + virtual ~AddVirtualColumnOutputEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AddVirtualColumnOutputEntry members + + + /// + /// Physical output column name + /// + utility::string_t getColumn() const; + bool columnIsSet() const; + void unsetColumn(); + void setColumn(const utility::string_t& value); + + /// + /// Field name in the UDF output struct + /// + utility::string_t getStructField() const; + bool structFieldIsSet() const; + void unsetStruct_field(); + void setStructField(const utility::string_t& value); + + /// + /// Data type of the output column using JSON representation + /// + std::shared_ptr getDataType() const; + bool dataTypeIsSet() const; + void unsetData_type(); + void setDataType(const std::shared_ptr& value); + + /// + /// Whether the output column is nullable + /// + bool isNullable() const; + bool nullableIsSet() const; + void unsetNullable(); + void setNullable(bool value); + + /// + /// User-supplied output field metadata (string key-value pairs) + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + +protected: + utility::string_t m_Column; + bool m_ColumnIsSet; + + utility::string_t m_Struct_field; + bool m_Struct_fieldIsSet; + + std::shared_ptr m_Data_type; + bool m_Data_typeIsSet; + + bool m_Nullable; + bool m_NullableIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AddVirtualColumnOutputEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterColumnsEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterColumnsEntry.h new file mode 100644 index 000000000..e1d0c63cd --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterColumnsEntry.h @@ -0,0 +1,121 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterColumnsEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterColumnsEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterColumnsEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/Object.h" +#include "lance_namespace_rest_client/model/AlterVirtualColumnEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AlterVirtualColumnEntry; + + +class AlterColumnsEntry + : public ModelBase +{ +public: + AlterColumnsEntry(); + virtual ~AlterColumnsEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterColumnsEntry members + + + /// + /// Lance field path to alter. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getPath() const; + bool pathIsSet() const; + void unsetPath(); + void setPath(const utility::string_t& value); + + /// + /// New data type for the column using JSON representation (optional) + /// + std::shared_ptr getDataType() const; + bool dataTypeIsSet() const; + void unsetData_type(); + void setDataType(const std::shared_ptr& value); + + /// + /// New name for the column (optional) + /// + utility::string_t getRename() const; + bool renameIsSet() const; + void unsetRename(); + void setRename(const utility::string_t& value); + + /// + /// Whether the column should be nullable (optional) + /// + bool isNullable() const; + bool nullableIsSet() const; + void unsetNullable(); + void setNullable(bool value); + + std::shared_ptr getVirtualColumn() const; + bool virtualColumnIsSet() const; + void unsetVirtual_column(); + void setVirtualColumn(const std::shared_ptr& value); + + +protected: + utility::string_t m_Path; + bool m_PathIsSet; + + std::shared_ptr m_Data_type; + bool m_Data_typeIsSet; + + utility::string_t m_Rename; + bool m_RenameIsSet; + + bool m_Nullable; + bool m_NullableIsSet; + + std::shared_ptr m_Virtual_column; + bool m_Virtual_columnIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterColumnsEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h new file mode 100644 index 000000000..b5d23b573 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h @@ -0,0 +1,112 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableAddColumnsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAddColumnsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAddColumnsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include "lance_namespace_rest_client/model/AddColumnsEntry.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class AddColumnsEntry; + + +class AlterTableAddColumnsRequest + : public ModelBase +{ +public: + AlterTableAddColumnsRequest(); + virtual ~AlterTableAddColumnsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableAddColumnsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Table identifier path (namespace + table name) + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// List of new columns to add to the table + /// + std::vector> getNewColumns() const; + bool newColumnsIsSet() const; + void unsetNew_columns(); + void setNewColumns(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::vector> m_New_columns; + bool m_New_columnsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAddColumnsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h new file mode 100644 index 000000000..f39c503a3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h @@ -0,0 +1,76 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableAddColumnsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAddColumnsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAddColumnsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTableAddColumnsResponse + : public ModelBase +{ +public: + AlterTableAddColumnsResponse(); + virtual ~AlterTableAddColumnsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableAddColumnsResponse members + + + /// + /// The commit version associated with the operation + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + +protected: + int64_t m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAddColumnsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h new file mode 100644 index 000000000..e3ed8ad9e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h @@ -0,0 +1,112 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableAlterColumnsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAlterColumnsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAlterColumnsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include "lance_namespace_rest_client/model/AlterColumnsEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class AlterColumnsEntry; + + +class AlterTableAlterColumnsRequest + : public ModelBase +{ +public: + AlterTableAlterColumnsRequest(); + virtual ~AlterTableAlterColumnsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableAlterColumnsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Table identifier path (namespace + table name) + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// List of column alterations to apply to the table + /// + std::vector> getAlterations() const; + bool alterationsIsSet() const; + void unsetAlterations(); + void setAlterations(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::vector> m_Alterations; + bool m_AlterationsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAlterColumnsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h new file mode 100644 index 000000000..f2697f2eb --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h @@ -0,0 +1,76 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableAlterColumnsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAlterColumnsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAlterColumnsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTableAlterColumnsResponse + : public ModelBase +{ +public: + AlterTableAlterColumnsResponse(); + virtual ~AlterTableAlterColumnsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableAlterColumnsResponse members + + + /// + /// The commit version associated with the operation + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + +protected: + int64_t m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableAlterColumnsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h new file mode 100644 index 000000000..0a2a58189 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h @@ -0,0 +1,253 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableBackfillColumnsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableBackfillColumnsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableBackfillColumnsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class AlterTableBackfillColumnsRequest + : public ModelBase +{ +public: + AlterTableBackfillColumnsRequest(); + virtual ~AlterTableBackfillColumnsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableBackfillColumnsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Table identifier path (namespace + table name) + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Lance field path to backfill. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getColumn() const; + bool columnIsSet() const; + void unsetColumn(); + void setColumn(const utility::string_t& value); + + /// + /// Optional WHERE clause filter + /// + utility::string_t getWhere() const; + bool whereIsSet() const; + void unsetWhere(); + void setWhere(const utility::string_t& value); + + /// + /// Optional concurrency override + /// + int32_t getConcurrency() const; + bool concurrencyIsSet() const; + void unsetConcurrency(); + void setConcurrency(int32_t value); + + /// + /// Optional intra-applier concurrency override + /// + int32_t getIntraApplierConcurrency() const; + bool intraApplierConcurrencyIsSet() const; + void unsetIntra_applier_concurrency(); + void setIntraApplierConcurrency(int32_t value); + + /// + /// Optional minimum checkpoint size + /// + int32_t getMinCheckpointSize() const; + bool minCheckpointSizeIsSet() const; + void unsetMin_checkpoint_size(); + void setMinCheckpointSize(int32_t value); + + /// + /// Optional maximum checkpoint size + /// + int32_t getMaxCheckpointSize() const; + bool maxCheckpointSizeIsSet() const; + void unsetMax_checkpoint_size(); + void setMaxCheckpointSize(int32_t value); + + /// + /// Optional batch checkpoint flush interval in seconds + /// + double getBatchCheckpointFlushIntervalSeconds() const; + bool batchCheckpointFlushIntervalSecondsIsSet() const; + void unsetBatch_checkpoint_flush_interval_seconds(); + void setBatchCheckpointFlushIntervalSeconds(double value); + + /// + /// Optional table version to read from + /// + int32_t getReadVersion() const; + bool readVersionIsSet() const; + void unsetRead_version(); + void setReadVersion(int32_t value); + + /// + /// Optional task size + /// + int32_t getTaskSize() const; + bool taskSizeIsSet() const; + void unsetTask_size(); + void setTaskSize(int32_t value); + + /// + /// Optional number of fragments + /// + int32_t getNumFrags() const; + bool numFragsIsSet() const; + void unsetNum_frags(); + void setNumFrags(int32_t value); + + /// + /// Optional checkpoint size + /// + int32_t getCheckpointSize() const; + bool checkpointSizeIsSet() const; + void unsetCheckpoint_size(); + void setCheckpointSize(int32_t value); + + /// + /// Optional commit granularity + /// + int32_t getCommitGranularity() const; + bool commitGranularityIsSet() const; + void unsetCommit_granularity(); + void setCommitGranularity(int32_t value); + + /// + /// Optional cluster name + /// + utility::string_t getCluster() const; + bool clusterIsSet() const; + void unsetCluster(); + void setCluster(const utility::string_t& value); + + /// + /// Optional manifest name + /// + utility::string_t getManifest() const; + bool manifestIsSet() const; + void unsetManifest(); + void setManifest(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Column; + bool m_ColumnIsSet; + + utility::string_t m_Where; + bool m_WhereIsSet; + + int32_t m_Concurrency; + bool m_ConcurrencyIsSet; + + int32_t m_Intra_applier_concurrency; + bool m_Intra_applier_concurrencyIsSet; + + int32_t m_Min_checkpoint_size; + bool m_Min_checkpoint_sizeIsSet; + + int32_t m_Max_checkpoint_size; + bool m_Max_checkpoint_sizeIsSet; + + double m_Batch_checkpoint_flush_interval_seconds; + bool m_Batch_checkpoint_flush_interval_secondsIsSet; + + int32_t m_Read_version; + bool m_Read_versionIsSet; + + int32_t m_Task_size; + bool m_Task_sizeIsSet; + + int32_t m_Num_frags; + bool m_Num_fragsIsSet; + + int32_t m_Checkpoint_size; + bool m_Checkpoint_sizeIsSet; + + int32_t m_Commit_granularity; + bool m_Commit_granularityIsSet; + + utility::string_t m_Cluster; + bool m_ClusterIsSet; + + utility::string_t m_Manifest; + bool m_ManifestIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableBackfillColumnsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h new file mode 100644 index 000000000..586d12e06 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h @@ -0,0 +1,77 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableBackfillColumnsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableBackfillColumnsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableBackfillColumnsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTableBackfillColumnsResponse + : public ModelBase +{ +public: + AlterTableBackfillColumnsResponse(); + virtual ~AlterTableBackfillColumnsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableBackfillColumnsResponse members + + + /// + /// The job ID for tracking the backfill job + /// + utility::string_t getJobId() const; + bool jobIdIsSet() const; + void unsetJob_id(); + void setJobId(const utility::string_t& value); + + +protected: + utility::string_t m_Job_id; + bool m_Job_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableBackfillColumnsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h new file mode 100644 index 000000000..38452ac0c --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h @@ -0,0 +1,119 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableDropColumnsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableDropColumnsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableDropColumnsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class AlterTableDropColumnsRequest + : public ModelBase +{ +public: + AlterTableDropColumnsRequest(); + virtual ~AlterTableDropColumnsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableDropColumnsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Lance field paths to drop. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + std::vector getColumns() const; + bool columnsIsSet() const; + void unsetColumns(); + void setColumns(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::vector m_Columns; + bool m_ColumnsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableDropColumnsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h new file mode 100644 index 000000000..17b29d4cb --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h @@ -0,0 +1,88 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTableDropColumnsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableDropColumnsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableDropColumnsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTableDropColumnsResponse + : public ModelBase +{ +public: + AlterTableDropColumnsResponse(); + virtual ~AlterTableDropColumnsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTableDropColumnsResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// Version of the table after dropping columns + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTableDropColumnsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionAction.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionAction.h new file mode 100644 index 000000000..7ece87afa --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionAction.h @@ -0,0 +1,98 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTransactionAction.h + * + * A single action that could be performed to alter a transaction. This action holds the model definition for all types of specific actions models, this is to minimize difference and compatibility issue across codegen in different languages. When used, only one of the actions should be non-null for each action. If you would like to perform multiple actions, set a list of actions in the AlterTransactionRequest. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionAction_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionAction_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/AlterTransactionSetProperty.h" +#include "lance_namespace_rest_client/model/AlterTransactionSetStatus.h" +#include "lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AlterTransactionSetStatus; +class AlterTransactionSetProperty; +class AlterTransactionUnsetProperty; + + +/// +/// A single action that could be performed to alter a transaction. This action holds the model definition for all types of specific actions models, this is to minimize difference and compatibility issue across codegen in different languages. When used, only one of the actions should be non-null for each action. If you would like to perform multiple actions, set a list of actions in the AlterTransactionRequest. +/// +class AlterTransactionAction + : public ModelBase +{ +public: + AlterTransactionAction(); + virtual ~AlterTransactionAction(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTransactionAction members + + + std::shared_ptr getSetStatusAction() const; + bool setStatusActionIsSet() const; + void unsetSetStatusAction(); + void setSetStatusAction(const std::shared_ptr& value); + + std::shared_ptr getSetPropertyAction() const; + bool setPropertyActionIsSet() const; + void unsetSetPropertyAction(); + void setSetPropertyAction(const std::shared_ptr& value); + + std::shared_ptr getUnsetPropertyAction() const; + bool unsetPropertyActionIsSet() const; + void unsetUnsetPropertyAction(); + void setUnsetPropertyAction(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_SetStatusAction; + bool m_SetStatusActionIsSet; + + std::shared_ptr m_SetPropertyAction; + bool m_SetPropertyActionIsSet; + + std::shared_ptr m_UnsetPropertyAction; + bool m_UnsetPropertyActionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionAction_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionRequest.h new file mode 100644 index 000000000..6ce968a7a --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionRequest.h @@ -0,0 +1,110 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTransactionRequest.h + * + * Alter a transaction with a list of actions. The server should either succeed and apply all actions, or fail and apply no action. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include "lance_namespace_rest_client/model/AlterTransactionAction.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class AlterTransactionAction; + + +/// +/// Alter a transaction with a list of actions. The server should either succeed and apply all actions, or fail and apply no action. +/// +class AlterTransactionRequest + : public ModelBase +{ +public: + AlterTransactionRequest(); + virtual ~AlterTransactionRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTransactionRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + std::vector> getActions() const; + bool actionsIsSet() const; + void unsetActions(); + void setActions(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + std::vector> m_Actions; + bool m_ActionsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionResponse.h new file mode 100644 index 000000000..613552c6e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionResponse.h @@ -0,0 +1,86 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTransactionResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTransactionResponse + : public ModelBase +{ +public: + AlterTransactionResponse(); + virtual ~AlterTransactionResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTransactionResponse members + + + /// + /// The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Queued: the transaction is queued and not yet started - Running: the transaction is currently running - Succeeded: the transaction has completed successfully - Failed: the transaction has failed - Canceled: the transaction was canceled + /// + utility::string_t getStatus() const; + bool statusIsSet() const; + void unsetStatus(); + void setStatus(const utility::string_t& value); + + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Status; + bool m_StatusIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetProperty.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetProperty.h new file mode 100644 index 000000000..7a91649ed --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetProperty.h @@ -0,0 +1,93 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTransactionSetProperty.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionSetProperty_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionSetProperty_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTransactionSetProperty + : public ModelBase +{ +public: + AlterTransactionSetProperty(); + virtual ~AlterTransactionSetProperty(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTransactionSetProperty members + + + utility::string_t getKey() const; + bool keyIsSet() const; + void unsetKey(); + void setKey(const utility::string_t& value); + + utility::string_t getValue() const; + bool valueIsSet() const; + void unsetValue(); + void setValue(const utility::string_t& value); + + /// + /// The behavior if the property key already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Overwrite (default): overwrite the existing value with the provided value - Fail: fail the entire operation - Skip: keep the existing value and skip setting the provided value + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + +protected: + utility::string_t m_Key; + bool m_KeyIsSet; + + utility::string_t m_Value; + bool m_ValueIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionSetProperty_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetStatus.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetStatus.h new file mode 100644 index 000000000..321a10ee0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionSetStatus.h @@ -0,0 +1,77 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTransactionSetStatus.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionSetStatus_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionSetStatus_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTransactionSetStatus + : public ModelBase +{ +public: + AlterTransactionSetStatus(); + virtual ~AlterTransactionSetStatus(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTransactionSetStatus members + + + /// + /// The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Queued: the transaction is queued and not yet started - Running: the transaction is currently running - Succeeded: the transaction has completed successfully - Failed: the transaction has failed - Canceled: the transaction was canceled + /// + utility::string_t getStatus() const; + bool statusIsSet() const; + void unsetStatus(); + void setStatus(const utility::string_t& value); + + +protected: + utility::string_t m_Status; + bool m_StatusIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionSetStatus_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h new file mode 100644 index 000000000..ec25b2d81 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h @@ -0,0 +1,85 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterTransactionUnsetProperty.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionUnsetProperty_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionUnsetProperty_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterTransactionUnsetProperty + : public ModelBase +{ +public: + AlterTransactionUnsetProperty(); + virtual ~AlterTransactionUnsetProperty(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterTransactionUnsetProperty members + + + utility::string_t getKey() const; + bool keyIsSet() const; + void unsetKey(); + void setKey(const utility::string_t& value); + + /// + /// The behavior if the property key to unset does not exist. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Skip (default): skip the property to unset - Fail: fail the entire operation + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + +protected: + utility::string_t m_Key; + bool m_KeyIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterTransactionUnsetProperty_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterVirtualColumnEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterVirtualColumnEntry.h new file mode 100644 index 000000000..bff330e93 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AlterVirtualColumnEntry.h @@ -0,0 +1,178 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AlterVirtualColumnEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AlterVirtualColumnEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AlterVirtualColumnEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AlterVirtualColumnEntry + : public ModelBase +{ +public: + AlterVirtualColumnEntry(); + virtual ~AlterVirtualColumnEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AlterVirtualColumnEntry members + + + /// + /// List of input Lance field paths for the virtual column. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Optional. + /// + std::vector getInputColumns() const; + bool inputColumnsIsSet() const; + void unsetInput_columns(); + void setInputColumns(const std::vector& value); + + /// + /// Docker image to use for the UDF (optional) + /// + utility::string_t getImage() const; + bool imageIsSet() const; + void unsetImage(); + void setImage(const utility::string_t& value); + + /// + /// Base64 encoded pickled UDF (optional) + /// + utility::string_t getUdf() const; + bool udfIsSet() const; + void unsetUdf(); + void setUdf(const utility::string_t& value); + + /// + /// Name of the UDF (optional) + /// + utility::string_t getUdfName() const; + bool udfNameIsSet() const; + void unsetUdf_name(); + void setUdfName(const utility::string_t& value); + + /// + /// Version of the UDF (optional) + /// + utility::string_t getUdfVersion() const; + bool udfVersionIsSet() const; + void unsetUdf_version(); + void setUdfVersion(const utility::string_t& value); + + /// + /// UDF backend type (e.g. DockerUDFSpecV1) (optional) + /// + utility::string_t getUdfBackend() const; + bool udfBackendIsSet() const; + void unsetUdf_backend(); + void setUdfBackend(const utility::string_t& value); + + /// + /// Whether to automatically backfill the column (optional) + /// + bool isAutoBackfill() const; + bool autoBackfillIsSet() const; + void unsetAuto_backfill(); + void setAutoBackfill(bool value); + + /// + /// JSON-serialized manifest for the UDF environment (optional) + /// + utility::string_t getManifest() const; + bool manifestIsSet() const; + void unsetManifest(); + void setManifest(const utility::string_t& value); + + /// + /// SHA-256 checksum of the manifest content (optional) + /// + utility::string_t getManifestChecksum() const; + bool manifestChecksumIsSet() const; + void unsetManifest_checksum(); + void setManifestChecksum(const utility::string_t& value); + + /// + /// User-supplied field metadata (optional) + /// + std::map getFieldMetadata() const; + bool fieldMetadataIsSet() const; + void unsetField_metadata(); + void setFieldMetadata(const std::map& value); + + +protected: + std::vector m_Input_columns; + bool m_Input_columnsIsSet; + + utility::string_t m_Image; + bool m_ImageIsSet; + + utility::string_t m_Udf; + bool m_UdfIsSet; + + utility::string_t m_Udf_name; + bool m_Udf_nameIsSet; + + utility::string_t m_Udf_version; + bool m_Udf_versionIsSet; + + utility::string_t m_Udf_backend; + bool m_Udf_backendIsSet; + + bool m_Auto_backfill; + bool m_Auto_backfillIsSet; + + utility::string_t m_Manifest; + bool m_ManifestIsSet; + + utility::string_t m_Manifest_checksum; + bool m_Manifest_checksumIsSet; + + std::map m_Field_metadata; + bool m_Field_metadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AlterVirtualColumnEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h new file mode 100644 index 000000000..f718f4e90 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h @@ -0,0 +1,303 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AnalyzeTableQueryPlanRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AnalyzeTableQueryPlanRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AnalyzeTableQueryPlanRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include "lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h" +#include +#include "lance_namespace_rest_client/model/QueryTableRequest_vector.h" +#include +#include +#include "lance_namespace_rest_client/model/QueryTableRequest_columns.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class QueryTableRequest_columns; +class QueryTableRequest_full_text_query; +class QueryTableRequest_vector; + + +class AnalyzeTableQueryPlanRequest + : public ModelBase +{ +public: + AnalyzeTableQueryPlanRequest(); + virtual ~AnalyzeTableQueryPlanRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AnalyzeTableQueryPlanRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Whether to bypass vector index + /// + bool isBypassVectorIndex() const; + bool bypassVectorIndexIsSet() const; + void unsetBypass_vector_index(); + void setBypassVectorIndex(bool value); + + std::shared_ptr getColumns() const; + bool columnsIsSet() const; + void unsetColumns(); + void setColumns(const std::shared_ptr& value); + + /// + /// Distance metric to use + /// + utility::string_t getDistanceType() const; + bool distanceTypeIsSet() const; + void unsetDistance_type(); + void setDistanceType(const utility::string_t& value); + + /// + /// Search effort parameter for HNSW index + /// + int32_t getEf() const; + bool efIsSet() const; + void unsetEf(); + void setEf(int32_t value); + + /// + /// Whether to use fast search + /// + bool isFastSearch() const; + bool fastSearchIsSet() const; + void unsetFast_search(); + void setFastSearch(bool value); + + /// + /// Optional SQL filter expression. Field references in the expression must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getFilter() const; + bool filterIsSet() const; + void unsetFilter(); + void setFilter(const utility::string_t& value); + + std::shared_ptr getFullTextQuery() const; + bool fullTextQueryIsSet() const; + void unsetFull_text_query(); + void setFullTextQuery(const std::shared_ptr& value); + + /// + /// Number of results to return + /// + int32_t getK() const; + bool KIsSet() const; + void unsetk(); + void setK(int32_t value); + + /// + /// Lower bound for search + /// + float getLowerBound() const; + bool lowerBoundIsSet() const; + void unsetLower_bound(); + void setLowerBound(float value); + + /// + /// Number of probes for IVF index + /// + int32_t getNprobes() const; + bool nprobesIsSet() const; + void unsetNprobes(); + void setNprobes(int32_t value); + + /// + /// Number of results to skip + /// + int32_t getOffset() const; + bool offsetIsSet() const; + void unsetOffset(); + void setOffset(int32_t value); + + /// + /// Whether to apply filtering before vector search + /// + bool isPrefilter() const; + bool prefilterIsSet() const; + void unsetPrefilter(); + void setPrefilter(bool value); + + /// + /// Refine factor for search + /// + int32_t getRefineFactor() const; + bool refineFactorIsSet() const; + void unsetRefine_factor(); + void setRefineFactor(int32_t value); + + /// + /// Upper bound for search + /// + float getUpperBound() const; + bool upperBoundIsSet() const; + void unsetUpper_bound(); + void setUpperBound(float value); + + std::shared_ptr getVector() const; + bool vectorIsSet() const; + void unsetVector(); + void setVector(const std::shared_ptr& value); + + /// + /// Lance field path of the vector field to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getVectorColumn() const; + bool vectorColumnIsSet() const; + void unsetVector_column(); + void setVectorColumn(const utility::string_t& value); + + /// + /// Table version to query + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// If true, return the row id as a column called `_rowid` + /// + bool isWithRowId() const; + bool withRowIdIsSet() const; + void unsetWith_row_id(); + void setWithRowId(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + bool m_Bypass_vector_index; + bool m_Bypass_vector_indexIsSet; + + std::shared_ptr m_Columns; + bool m_ColumnsIsSet; + + utility::string_t m_Distance_type; + bool m_Distance_typeIsSet; + + int32_t m_Ef; + bool m_EfIsSet; + + bool m_Fast_search; + bool m_Fast_searchIsSet; + + utility::string_t m_Filter; + bool m_FilterIsSet; + + std::shared_ptr m_Full_text_query; + bool m_Full_text_queryIsSet; + + int32_t m_k; + bool m_kIsSet; + + float m_Lower_bound; + bool m_Lower_boundIsSet; + + int32_t m_Nprobes; + bool m_NprobesIsSet; + + int32_t m_Offset; + bool m_OffsetIsSet; + + bool m_Prefilter; + bool m_PrefilterIsSet; + + int32_t m_Refine_factor; + bool m_Refine_factorIsSet; + + float m_Upper_bound; + bool m_Upper_boundIsSet; + + std::shared_ptr m_Vector; + bool m_VectorIsSet; + + utility::string_t m_Vector_column; + bool m_Vector_columnIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + bool m_With_row_id; + bool m_With_row_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AnalyzeTableQueryPlanRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanResponse.h new file mode 100644 index 000000000..8c97df232 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/AnalyzeTableQueryPlanResponse.h @@ -0,0 +1,77 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AnalyzeTableQueryPlanResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AnalyzeTableQueryPlanResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AnalyzeTableQueryPlanResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class AnalyzeTableQueryPlanResponse + : public ModelBase +{ +public: + AnalyzeTableQueryPlanResponse(); + virtual ~AnalyzeTableQueryPlanResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// AnalyzeTableQueryPlanResponse members + + + /// + /// Detailed analysis of the query execution plan + /// + utility::string_t getAnalysis() const; + bool analysisIsSet() const; + void unsetAnalysis(); + void setAnalysis(const utility::string_t& value); + + +protected: + utility::string_t m_Analysis; + bool m_AnalysisIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AnalyzeTableQueryPlanResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesRequest.h new file mode 100644 index 000000000..b48d383c6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesRequest.h @@ -0,0 +1,105 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BatchCommitTablesRequest.h + * + * Request to atomically commit a batch of table operations. This replaces `BatchCreateTableVersionsRequest` with a more general interface that supports mixed operations (DeclareTable, CreateTableVersion, DeleteTableVersions, DeregisterTable) within a single atomic transaction at the metadata layer. All operations are committed atomically: either all succeed or none are applied. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCommitTablesRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCommitTablesRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include "lance_namespace_rest_client/model/CommitTableOperation.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class CommitTableOperation; + + +/// +/// Request to atomically commit a batch of table operations. This replaces `BatchCreateTableVersionsRequest` with a more general interface that supports mixed operations (DeclareTable, CreateTableVersion, DeleteTableVersions, DeregisterTable) within a single atomic transaction at the metadata layer. All operations are committed atomically: either all succeed or none are applied. +/// +class BatchCommitTablesRequest + : public ModelBase +{ +public: + BatchCommitTablesRequest(); + virtual ~BatchCommitTablesRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BatchCommitTablesRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// List of operations to commit atomically. Supported operation types: DeclareTable, CreateTableVersion, DeleteTableVersions, DeregisterTable. + /// + std::vector> getOperations() const; + bool operationsIsSet() const; + void unsetOperations(); + void setOperations(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector> m_Operations; + bool m_OperationsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCommitTablesRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesResponse.h new file mode 100644 index 000000000..ff3437de0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCommitTablesResponse.h @@ -0,0 +1,94 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BatchCommitTablesResponse.h + * + * Response for a batch commit of table operations. Contains the results of each operation in the same order as the request. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCommitTablesResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCommitTablesResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/model/CommitTableResult.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class CommitTableResult; + + +/// +/// Response for a batch commit of table operations. Contains the results of each operation in the same order as the request. +/// +class BatchCommitTablesResponse + : public ModelBase +{ +public: + BatchCommitTablesResponse(); + virtual ~BatchCommitTablesResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BatchCommitTablesResponse members + + + /// + /// Optional transaction identifier for the batch commit + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// Results for each operation, in the same order as the request operations. Each result contains the outcome of the corresponding operation. + /// + std::vector> getResults() const; + bool resultsIsSet() const; + void unsetResults(); + void setResults(const std::vector>& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + std::vector> m_Results; + bool m_ResultsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCommitTablesResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h new file mode 100644 index 000000000..18504a2c9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h @@ -0,0 +1,105 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BatchCreateTableVersionsRequest.h + * + * Request to atomically create new version entries for multiple tables. The operation is atomic: all versions are created or none are. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCreateTableVersionsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCreateTableVersionsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/CreateTableVersionEntry.h" +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class CreateTableVersionEntry; + + +/// +/// Request to atomically create new version entries for multiple tables. The operation is atomic: all versions are created or none are. +/// +class BatchCreateTableVersionsRequest + : public ModelBase +{ +public: + BatchCreateTableVersionsRequest(); + virtual ~BatchCreateTableVersionsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BatchCreateTableVersionsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// List of table version entries to create atomically + /// + std::vector> getEntries() const; + bool entriesIsSet() const; + void unsetEntries(); + void setEntries(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector> m_Entries; + bool m_EntriesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCreateTableVersionsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h new file mode 100644 index 000000000..1551dd577 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h @@ -0,0 +1,94 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BatchCreateTableVersionsResponse.h + * + * Response for batch creating table versions. Contains the created versions for each table in the same order as the request. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCreateTableVersionsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCreateTableVersionsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/TableVersion.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class TableVersion; + + +/// +/// Response for batch creating table versions. Contains the created versions for each table in the same order as the request. +/// +class BatchCreateTableVersionsResponse + : public ModelBase +{ +public: + BatchCreateTableVersionsResponse(); + virtual ~BatchCreateTableVersionsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BatchCreateTableVersionsResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// List of created table versions in the same order as the request entries + /// + std::vector> getVersions() const; + bool versionsIsSet() const; + void unsetVersions(); + void setVersions(const std::vector>& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + std::vector> m_Versions; + bool m_VersionsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BatchCreateTableVersionsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h new file mode 100644 index 000000000..10538f615 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h @@ -0,0 +1,127 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BatchDeleteTableVersionsRequest.h + * + * Request to delete table version records. Supports deleting ranges of versions for efficient bulk cleanup. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BatchDeleteTableVersionsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BatchDeleteTableVersionsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include "lance_namespace_rest_client/model/VersionRange.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class VersionRange; + + +/// +/// Request to delete table version records. Supports deleting ranges of versions for efficient bulk cleanup. +/// +class BatchDeleteTableVersionsRequest + : public ModelBase +{ +public: + BatchDeleteTableVersionsRequest(); + virtual ~BatchDeleteTableVersionsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BatchDeleteTableVersionsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// List of version ranges to delete. Each range specifies start (inclusive) and end (exclusive) versions. + /// + std::vector> getRanges() const; + bool rangesIsSet() const; + void unsetRanges(); + void setRanges(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::vector> m_Ranges; + bool m_RangesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BatchDeleteTableVersionsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h new file mode 100644 index 000000000..65cbd5730 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h @@ -0,0 +1,91 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BatchDeleteTableVersionsResponse.h + * + * Response for deleting table version records + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BatchDeleteTableVersionsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BatchDeleteTableVersionsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for deleting table version records +/// +class BatchDeleteTableVersionsResponse + : public ModelBase +{ +public: + BatchDeleteTableVersionsResponse(); + virtual ~BatchDeleteTableVersionsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BatchDeleteTableVersionsResponse members + + + /// + /// Number of version records deleted + /// + int64_t getDeletedCount() const; + bool deletedCountIsSet() const; + void unsetDeleted_count(); + void setDeletedCount(int64_t value); + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + int64_t m_Deleted_count; + bool m_Deleted_countIsSet; + + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BatchDeleteTableVersionsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BooleanQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BooleanQuery.h new file mode 100644 index 000000000..2a8c05363 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BooleanQuery.h @@ -0,0 +1,104 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BooleanQuery.h + * + * Boolean query with must, should, and must_not clauses + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BooleanQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BooleanQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/FtsQuery.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class FtsQuery; + + +/// +/// Boolean query with must, should, and must_not clauses +/// +class BooleanQuery + : public ModelBase +{ +public: + BooleanQuery(); + virtual ~BooleanQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BooleanQuery members + + + /// + /// Queries that must match (AND) + /// + std::vector> getMust() const; + bool mustIsSet() const; + void unsetMust(); + void setMust(const std::vector>& value); + + /// + /// Queries that must not match (NOT) + /// + std::vector> getMustNot() const; + bool mustNotIsSet() const; + void unsetMust_not(); + void setMustNot(const std::vector>& value); + + /// + /// Queries that should match (OR) + /// + std::vector> getShould() const; + bool shouldIsSet() const; + void unsetShould(); + void setShould(const std::vector>& value); + + +protected: + std::vector> m_Must; + bool m_MustIsSet; + + std::vector> m_Must_not; + bool m_Must_notIsSet; + + std::vector> m_Should; + bool m_ShouldIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BooleanQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BoostQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BoostQuery.h new file mode 100644 index 000000000..f2ca0b711 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BoostQuery.h @@ -0,0 +1,97 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BoostQuery.h + * + * Boost query that scores documents matching positive query higher and negative query lower + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BoostQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BoostQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/FtsQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class FtsQuery; + + +/// +/// Boost query that scores documents matching positive query higher and negative query lower +/// +class BoostQuery + : public ModelBase +{ +public: + BoostQuery(); + virtual ~BoostQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BoostQuery members + + + std::shared_ptr getPositive() const; + bool positiveIsSet() const; + void unsetPositive(); + void setPositive(const std::shared_ptr& value); + + std::shared_ptr getNegative() const; + bool negativeIsSet() const; + void unsetNegative(); + void setNegative(const std::shared_ptr& value); + + /// + /// Boost factor for negative query (default: 0.5) + /// + float getNegativeBoost() const; + bool negativeBoostIsSet() const; + void unsetNegative_boost(); + void setNegativeBoost(float value); + + +protected: + std::shared_ptr m_Positive; + bool m_PositiveIsSet; + + std::shared_ptr m_Negative; + bool m_NegativeIsSet; + + float m_Negative_boost; + bool m_Negative_boostIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BoostQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BranchContents.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BranchContents.h new file mode 100644 index 000000000..52afc3307 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/BranchContents.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * BranchContents.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_BranchContents_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_BranchContents_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class BranchContents + : public ModelBase +{ +public: + BranchContents(); + virtual ~BranchContents(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// BranchContents members + + + /// + /// Name of the branch this branch was created from. Absent when the branch was created from the main branch. + /// + utility::string_t getParentBranch() const; + bool parentBranchIsSet() const; + void unsetParentBranch(); + void setParentBranch(const utility::string_t& value); + + /// + /// Version of the parent (branch or main) this branch was created from + /// + int64_t getParentVersion() const; + bool parentVersionIsSet() const; + void unsetParentVersion(); + void setParentVersion(int64_t value); + + /// + /// Unix timestamp (in seconds) when the branch was created + /// + int64_t getCreateAt() const; + bool createAtIsSet() const; + void unsetCreateAt(); + void setCreateAt(int64_t value); + + /// + /// Size of the branch's manifest file in bytes + /// + int64_t getManifestSize() const; + bool manifestSizeIsSet() const; + void unsetManifestSize(); + void setManifestSize(int64_t value); + + /// + /// Key-value metadata associated with the branch + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + +protected: + utility::string_t m_ParentBranch; + bool m_ParentBranchIsSet; + + int64_t m_ParentVersion; + bool m_ParentVersionIsSet; + + int64_t m_CreateAt; + bool m_CreateAtIsSet; + + int64_t m_ManifestSize; + bool m_ManifestSizeIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_BranchContents_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableOperation.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableOperation.h new file mode 100644 index 000000000..5adb75eca --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableOperation.h @@ -0,0 +1,120 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CommitTableOperation.h + * + * A single operation within a batch commit. Provide exactly one of the operation fields to specify the operation kind. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CommitTableOperation_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CommitTableOperation_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/DeregisterTableRequest.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/CreateTableVersionRequest.h" +#include "lance_namespace_rest_client/model/DeclareTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class DeclareTableRequest; +class CreateTableVersionRequest; +class BatchDeleteTableVersionsRequest; +class DeregisterTableRequest; + + +/// +/// A single operation within a batch commit. Provide exactly one of the operation fields to specify the operation kind. +/// +class CommitTableOperation + : public ModelBase +{ +public: + CommitTableOperation(); + virtual ~CommitTableOperation(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CommitTableOperation members + + + /// + /// Declare (reserve) a new table in the namespace + /// + std::shared_ptr getDeclareTable() const; + bool declareTableIsSet() const; + void unsetDeclare_table(); + void setDeclareTable(const std::shared_ptr& value); + + /// + /// Create a new version entry for a table + /// + std::shared_ptr getCreateTableVersion() const; + bool createTableVersionIsSet() const; + void unsetCreate_table_version(); + void setCreateTableVersion(const std::shared_ptr& value); + + /// + /// Delete version ranges from a table + /// + std::shared_ptr getDeleteTableVersions() const; + bool deleteTableVersionsIsSet() const; + void unsetDelete_table_versions(); + void setDeleteTableVersions(const std::shared_ptr& value); + + /// + /// Deregister (soft-delete) a table + /// + std::shared_ptr getDeregisterTable() const; + bool deregisterTableIsSet() const; + void unsetDeregister_table(); + void setDeregisterTable(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_Declare_table; + bool m_Declare_tableIsSet; + + std::shared_ptr m_Create_table_version; + bool m_Create_table_versionIsSet; + + std::shared_ptr m_Delete_table_versions; + bool m_Delete_table_versionsIsSet; + + std::shared_ptr m_Deregister_table; + bool m_Deregister_tableIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CommitTableOperation_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableResult.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableResult.h new file mode 100644 index 000000000..c4e189894 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CommitTableResult.h @@ -0,0 +1,120 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CommitTableResult.h + * + * Result of a single operation within a batch commit. Each result corresponds to one operation in the request, in the same order. Exactly one of the result fields will be set. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CommitTableResult_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CommitTableResult_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/DeregisterTableResponse.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/DeclareTableResponse.h" +#include "lance_namespace_rest_client/model/CreateTableVersionResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class DeclareTableResponse; +class CreateTableVersionResponse; +class BatchDeleteTableVersionsResponse; +class DeregisterTableResponse; + + +/// +/// Result of a single operation within a batch commit. Each result corresponds to one operation in the request, in the same order. Exactly one of the result fields will be set. +/// +class CommitTableResult + : public ModelBase +{ +public: + CommitTableResult(); + virtual ~CommitTableResult(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CommitTableResult members + + + /// + /// Result of a DeclareTable operation + /// + std::shared_ptr getDeclareTable() const; + bool declareTableIsSet() const; + void unsetDeclare_table(); + void setDeclareTable(const std::shared_ptr& value); + + /// + /// Result of a CreateTableVersion operation + /// + std::shared_ptr getCreateTableVersion() const; + bool createTableVersionIsSet() const; + void unsetCreate_table_version(); + void setCreateTableVersion(const std::shared_ptr& value); + + /// + /// Result of a DeleteTableVersions operation + /// + std::shared_ptr getDeleteTableVersions() const; + bool deleteTableVersionsIsSet() const; + void unsetDelete_table_versions(); + void setDeleteTableVersions(const std::shared_ptr& value); + + /// + /// Result of a DeregisterTable operation + /// + std::shared_ptr getDeregisterTable() const; + bool deregisterTableIsSet() const; + void unsetDeregister_table(); + void setDeregisterTable(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_Declare_table; + bool m_Declare_tableIsSet; + + std::shared_ptr m_Create_table_version; + bool m_Create_table_versionIsSet; + + std::shared_ptr m_Delete_table_versions; + bool m_Delete_table_versionsIsSet; + + std::shared_ptr m_Deregister_table; + bool m_Deregister_tableIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CommitTableResult_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CountTableRowsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CountTableRowsRequest.h new file mode 100644 index 000000000..5b98cf8d6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CountTableRowsRequest.h @@ -0,0 +1,130 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CountTableRowsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CountTableRowsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CountTableRowsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class CountTableRowsRequest + : public ModelBase +{ +public: + CountTableRowsRequest(); + virtual ~CountTableRowsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CountTableRowsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version of the table to describe. If not specified, server should resolve it to the latest version. + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Optional SQL predicate to filter rows for counting. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getPredicate() const; + bool predicateIsSet() const; + void unsetPredicate(); + void setPredicate(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Predicate; + bool m_PredicateIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CountTableRowsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewRequest.h new file mode 100644 index 000000000..1e4397cd2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewRequest.h @@ -0,0 +1,168 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateMaterializedViewRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateMaterializedViewRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateMaterializedViewRequest_H_ + +#include + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include "lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class MaterializedViewUdtfEntry; + + +class CreateMaterializedViewRequest + : public ModelBase +{ +public: + CreateMaterializedViewRequest(); + virtual ~CreateMaterializedViewRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateMaterializedViewRequest members + + enum class KindEnum + { + query, + udtf, + chunker, + + }; + /// + /// The materialized view kind. - `query` — plain query-backed view (no UDTF), 1:1 rows. - `udtf` — batch UDTF-backed view (N:M rows, full refresh). - `chunker`, aka 'scalar_udtf' — chunker view (1:N row expansion, incremental refresh). + /// + + KindEnum toKindEnum(const utility::string_t& value) const; + const utility::string_t fromKindEnum(const KindEnum value) const; + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// View identifier path (namespace + view name) + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// The materialized view kind. - `query` — plain query-backed view (no UDTF), 1:1 rows. - `udtf` — batch UDTF-backed view (N:M rows, full refresh). - `chunker`, aka 'scalar_udtf' — chunker view (1:N row expansion, incremental refresh). + /// + KindEnum getKind() const; + bool kindIsSet() const; + void unsetKind(); + void setKind(const KindEnum value); + + /// + /// Opaque serialized representation of the source query that defines the view's input. The format is defined by the client; the namespace server stores it without interpreting it. + /// + utility::string_t getSourceQuery() const; + bool sourceQueryIsSet() const; + void unsetSource_query(); + void setSourceQuery(const utility::string_t& value); + + /// + /// Base64-encoded Arrow schema of the view output + /// + utility::string_t getOutputSchema() const; + bool outputSchemaIsSet() const; + void unsetOutput_schema(); + void setOutputSchema(const utility::string_t& value); + + std::shared_ptr getUdtfSpec() const; + bool udtfSpecIsSet() const; + void unsetUdtf_spec(); + void setUdtfSpec(const std::shared_ptr& value); + + /// + /// If false, the server kicks off an initial refresh immediately after creating the view and the response includes a job ID. + /// + bool isWithNoData() const; + bool withNoDataIsSet() const; + void unsetWith_no_data(); + void setWithNoData(bool value); + + /// + /// If true, the view is automatically refreshed when source-table data changes past the deployment-level threshold. Boolean opt-in only; the threshold and cooldown are configured on the deployment, not per-view. + /// + bool isAutoRefresh() const; + bool autoRefreshIsSet() const; + void unsetAuto_refresh(); + void setAutoRefresh(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + KindEnum m_Kind; + bool m_KindIsSet; + + utility::string_t m_Source_query; + bool m_Source_queryIsSet; + + utility::string_t m_Output_schema; + bool m_Output_schemaIsSet; + + std::shared_ptr m_Udtf_spec; + bool m_Udtf_specIsSet; + + bool m_With_no_data; + bool m_With_no_dataIsSet; + + bool m_Auto_refresh; + bool m_Auto_refreshIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateMaterializedViewRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewResponse.h new file mode 100644 index 000000000..9967be88e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateMaterializedViewResponse.h @@ -0,0 +1,88 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateMaterializedViewResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateMaterializedViewResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateMaterializedViewResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class CreateMaterializedViewResponse + : public ModelBase +{ +public: + CreateMaterializedViewResponse(); + virtual ~CreateMaterializedViewResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateMaterializedViewResponse members + + + /// + /// The commit version that created the materialized view + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Refresh job ID, populated only when `with_no_data` was false. + /// + utility::string_t getJobId() const; + bool jobIdIsSet() const; + void unsetJob_id(); + void setJobId(const utility::string_t& value); + + +protected: + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Job_id; + bool m_Job_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateMaterializedViewResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceRequest.h new file mode 100644 index 000000000..1b6fd9b8b --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceRequest.h @@ -0,0 +1,119 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateNamespaceRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateNamespaceRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateNamespaceRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class CreateNamespaceRequest + : public ModelBase +{ +public: + CreateNamespaceRequest(); + virtual ~CreateNamespaceRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateNamespaceRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// There are three modes when trying to create a namespace, to differentiate the behavior when a namespace of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing namespace is kept. * Overwrite: the existing namespace is dropped and a new empty namespace with this name is created. + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + /// + /// Properties stored on the namespace, if supported by the implementation. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateNamespaceRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceResponse.h new file mode 100644 index 000000000..1ad5eb9a4 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateNamespaceResponse.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateNamespaceResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateNamespaceResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateNamespaceResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class CreateNamespaceResponse + : public ModelBase +{ +public: + CreateNamespaceResponse(); + virtual ~CreateNamespaceResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateNamespaceResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// Properties after the namespace is created. If the server does not support namespace properties, it should return null for this field. If namespace properties are supported, but none are set, it should return an empty object. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateNamespaceResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchRequest.h new file mode 100644 index 000000000..6c256293d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchRequest.h @@ -0,0 +1,130 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableBranchRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableBranchRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableBranchRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class CreateTableBranchRequest + : public ModelBase +{ +public: + CreateTableBranchRequest(); + virtual ~CreateTableBranchRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableBranchRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Name of the branch to create + /// + utility::string_t getName() const; + bool nameIsSet() const; + void unsetName(); + void setName(const utility::string_t& value); + + /// + /// Source branch to create the new branch from. When omitted, the new branch is created from the main branch. + /// + utility::string_t getFromBranch() const; + bool fromBranchIsSet() const; + void unsetFrom_branch(); + void setFromBranch(const utility::string_t& value); + + /// + /// Version of the source (branch or main) to create from. When omitted, the latest version of the source is used. + /// + int64_t getFromVersion() const; + bool fromVersionIsSet() const; + void unsetFrom_version(); + void setFromVersion(int64_t value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Name; + bool m_NameIsSet; + + utility::string_t m_From_branch; + bool m_From_branchIsSet; + + int64_t m_From_version; + bool m_From_versionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableBranchRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchResponse.h new file mode 100644 index 000000000..ec7b97e0e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableBranchResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableBranchResponse.h + * + * Response for create branch operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableBranchResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableBranchResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for create branch operation +/// +class CreateTableBranchResponse + : public ModelBase +{ +public: + CreateTableBranchResponse(); + virtual ~CreateTableBranchResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableBranchResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableBranchResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexRequest.h new file mode 100644 index 000000000..48404a730 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexRequest.h @@ -0,0 +1,240 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableIndexRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableIndexRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableIndexRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class CreateTableIndexRequest + : public ModelBase +{ +public: + CreateTableIndexRequest(); + virtual ~CreateTableIndexRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableIndexRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Lance field path to create the index on. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getColumn() const; + bool columnIsSet() const; + void unsetColumn(); + void setColumn(const utility::string_t& value); + + /// + /// Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS) + /// + utility::string_t getIndexType() const; + bool indexTypeIsSet() const; + void unsetIndex_type(); + void setIndexType(const utility::string_t& value); + + /// + /// Optional name for the index. If not provided, a name will be auto-generated. + /// + utility::string_t getName() const; + bool nameIsSet() const; + void unsetName(); + void setName(const utility::string_t& value); + + /// + /// Distance metric type for vector indexes (e.g., l2, cosine, dot) + /// + utility::string_t getDistanceType() const; + bool distanceTypeIsSet() const; + void unsetDistance_type(); + void setDistanceType(const utility::string_t& value); + + /// + /// Optional FTS parameter for position tracking + /// + bool isWithPosition() const; + bool withPositionIsSet() const; + void unsetWith_position(); + void setWithPosition(bool value); + + /// + /// Optional FTS parameter for base tokenizer + /// + utility::string_t getBaseTokenizer() const; + bool baseTokenizerIsSet() const; + void unsetBase_tokenizer(); + void setBaseTokenizer(const utility::string_t& value); + + /// + /// Optional FTS parameter for language + /// + utility::string_t getLanguage() const; + bool languageIsSet() const; + void unsetLanguage(); + void setLanguage(const utility::string_t& value); + + /// + /// Optional FTS parameter for maximum token length + /// + int32_t getMaxTokenLength() const; + bool maxTokenLengthIsSet() const; + void unsetMax_token_length(); + void setMaxTokenLength(int32_t value); + + /// + /// Optional FTS parameter for lowercase conversion + /// + bool isLowerCase() const; + bool lowerCaseIsSet() const; + void unsetLower_case(); + void setLowerCase(bool value); + + /// + /// Optional FTS parameter for stemming + /// + bool isStem() const; + bool stemIsSet() const; + void unsetStem(); + void setStem(bool value); + + /// + /// Optional FTS parameter for stop word removal + /// + bool isRemoveStopWords() const; + bool removeStopWordsIsSet() const; + void unsetRemove_stop_words(); + void setRemoveStopWords(bool value); + + /// + /// Optional FTS parameter for ASCII folding + /// + bool isAsciiFolding() const; + bool asciiFoldingIsSet() const; + void unsetAscii_folding(); + void setAsciiFolding(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Column; + bool m_ColumnIsSet; + + utility::string_t m_Index_type; + bool m_Index_typeIsSet; + + utility::string_t m_Name; + bool m_NameIsSet; + + utility::string_t m_Distance_type; + bool m_Distance_typeIsSet; + + bool m_With_position; + bool m_With_positionIsSet; + + utility::string_t m_Base_tokenizer; + bool m_Base_tokenizerIsSet; + + utility::string_t m_Language; + bool m_LanguageIsSet; + + int32_t m_Max_token_length; + bool m_Max_token_lengthIsSet; + + bool m_Lower_case; + bool m_Lower_caseIsSet; + + bool m_Stem; + bool m_StemIsSet; + + bool m_Remove_stop_words; + bool m_Remove_stop_wordsIsSet; + + bool m_Ascii_folding; + bool m_Ascii_foldingIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableIndexRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexResponse.h new file mode 100644 index 000000000..3cbbe2bed --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableIndexResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableIndexResponse.h + * + * Response for create index operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableIndexResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableIndexResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for create index operation +/// +class CreateTableIndexResponse + : public ModelBase +{ +public: + CreateTableIndexResponse(); + virtual ~CreateTableIndexResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableIndexResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableIndexResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableRequest.h new file mode 100644 index 000000000..1d1f6c699 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableRequest.h @@ -0,0 +1,133 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableRequest.h + * + * Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. +/// +class CreateTableRequest + : public ModelBase +{ +public: + CreateTableRequest(); + virtual ~CreateTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + /// + /// Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + /// + /// Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. + /// + std::map getStorageOptions() const; + bool storageOptionsIsSet() const; + void unsetStorage_options(); + void setStorageOptions(const std::map& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + + std::map m_Storage_options; + bool m_Storage_optionsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableResponse.h new file mode 100644 index 000000000..b79011e72 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableResponse.h @@ -0,0 +1,116 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class CreateTableResponse + : public ModelBase +{ +public: + CreateTableResponse(); + virtual ~CreateTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. + /// + std::map getStorageOptions() const; + bool storageOptionsIsSet() const; + void unsetStorage_options(); + void setStorageOptions(const std::map& value); + + /// + /// Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + std::map m_Storage_options; + bool m_Storage_optionsIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h new file mode 100644 index 000000000..e75cae709 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableScalarIndexResponse.h + * + * Response for create scalar index operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableScalarIndexResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableScalarIndexResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for create scalar index operation +/// +class CreateTableScalarIndexResponse + : public ModelBase +{ +public: + CreateTableScalarIndexResponse(); + virtual ~CreateTableScalarIndexResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableScalarIndexResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableScalarIndexResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagRequest.h new file mode 100644 index 000000000..34b65932d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagRequest.h @@ -0,0 +1,130 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableTagRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableTagRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableTagRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class CreateTableTagRequest + : public ModelBase +{ +public: + CreateTableTagRequest(); + virtual ~CreateTableTagRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableTagRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Name of the tag to create + /// + utility::string_t getTag() const; + bool tagIsSet() const; + void unsetTag(); + void setTag(const utility::string_t& value); + + /// + /// Version number for the tag to point to + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Tag; + bool m_TagIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableTagRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagResponse.h new file mode 100644 index 000000000..97260d754 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableTagResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableTagResponse.h + * + * Response for create tag operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableTagResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableTagResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for create tag operation +/// +class CreateTableTagResponse + : public ModelBase +{ +public: + CreateTableTagResponse(); + virtual ~CreateTableTagResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableTagResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableTagResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionEntry.h new file mode 100644 index 000000000..e244bdae1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionEntry.h @@ -0,0 +1,159 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableVersionEntry.h + * + * An entry for creating a new table version in a batch operation. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// An entry for creating a new table version in a batch operation. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists. +/// +class CreateTableVersionEntry + : public ModelBase +{ +public: + CreateTableVersionEntry(); + virtual ~CreateTableVersionEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableVersionEntry members + + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version number to create + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Path to the manifest file for this version + /// + utility::string_t getManifestPath() const; + bool manifestPathIsSet() const; + void unsetManifest_path(); + void setManifestPath(const utility::string_t& value); + + /// + /// Size of the manifest file in bytes + /// + int64_t getManifestSize() const; + bool manifestSizeIsSet() const; + void unsetManifest_size(); + void setManifestSize(int64_t value); + + /// + /// Optional ETag for the manifest file + /// + utility::string_t getETag() const; + bool eTagIsSet() const; + void unsetE_tag(); + void setETag(const utility::string_t& value); + + /// + /// Optional metadata for the version + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + /// + /// The naming scheme used for manifest files in the `_versions/` directory. Known values: - `V1`: `_versions/{version}.manifest` - Simple version-based naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores V2 is preferred for new tables as it enables efficient latest-version discovery without needing to list all versions. + /// + utility::string_t getNamingScheme() const; + bool namingSchemeIsSet() const; + void unsetNaming_scheme(); + void setNamingScheme(const utility::string_t& value); + + +protected: + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Manifest_path; + bool m_Manifest_pathIsSet; + + int64_t m_Manifest_size; + bool m_Manifest_sizeIsSet; + + utility::string_t m_E_tag; + bool m_E_tagIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + + utility::string_t m_Naming_scheme; + bool m_Naming_schemeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionRequest.h new file mode 100644 index 000000000..65f48c91b --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionRequest.h @@ -0,0 +1,180 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableVersionRequest.h + * + * Request to create a new table version entry. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Request to create a new table version entry. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists. +/// +class CreateTableVersionRequest + : public ModelBase +{ +public: + CreateTableVersionRequest(); + virtual ~CreateTableVersionRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableVersionRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version number to create + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Path to the manifest file for this version + /// + utility::string_t getManifestPath() const; + bool manifestPathIsSet() const; + void unsetManifest_path(); + void setManifestPath(const utility::string_t& value); + + /// + /// Size of the manifest file in bytes + /// + int64_t getManifestSize() const; + bool manifestSizeIsSet() const; + void unsetManifest_size(); + void setManifestSize(int64_t value); + + /// + /// Optional ETag for the manifest file + /// + utility::string_t getETag() const; + bool eTagIsSet() const; + void unsetE_tag(); + void setETag(const utility::string_t& value); + + /// + /// Optional metadata for the version + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + /// + /// The naming scheme used for manifest files in the `_versions/` directory. Known values: - `V1`: `_versions/{version}.manifest` - Simple version-based naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores V2 is preferred for new tables as it enables efficient latest-version discovery without needing to list all versions. + /// + utility::string_t getNamingScheme() const; + bool namingSchemeIsSet() const; + void unsetNaming_scheme(); + void setNamingScheme(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Manifest_path; + bool m_Manifest_pathIsSet; + + int64_t m_Manifest_size; + bool m_Manifest_sizeIsSet; + + utility::string_t m_E_tag; + bool m_E_tagIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + + utility::string_t m_Naming_scheme; + bool m_Naming_schemeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionResponse.h new file mode 100644 index 000000000..e74938341 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/CreateTableVersionResponse.h @@ -0,0 +1,90 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * CreateTableVersionResponse.h + * + * Response for creating a table version + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/TableVersion.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class TableVersion; + + +/// +/// Response for creating a table version +/// +class CreateTableVersionResponse + : public ModelBase +{ +public: + CreateTableVersionResponse(); + virtual ~CreateTableVersionResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// CreateTableVersionResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + std::shared_ptr getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(const std::shared_ptr& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + std::shared_ptr m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateTableVersionResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableRequest.h new file mode 100644 index 000000000..79a7d9b84 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableRequest.h @@ -0,0 +1,133 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeclareTableRequest.h + * + * Request for declaring a table. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeclareTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeclareTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Request for declaring a table. +/// +class DeclareTableRequest + : public ModelBase +{ +public: + DeclareTableRequest(); + virtual ~DeclareTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeclareTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Optional storage location for the table. If not provided, the namespace implementation should determine the table location. + /// + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. + /// + bool isVendCredentials() const; + bool vendCredentialsIsSet() const; + void unsetVend_credentials(); + void setVendCredentials(bool value); + + /// + /// Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + bool m_Vend_credentials; + bool m_Vend_credentialsIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeclareTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableResponse.h new file mode 100644 index 000000000..9aaddfc2b --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeclareTableResponse.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeclareTableResponse.h + * + * Response for declaring a table. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeclareTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeclareTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for declaring a table. +/// +class DeclareTableResponse + : public ModelBase +{ +public: + DeclareTableResponse(); + virtual ~DeclareTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeclareTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. + /// + std::map getStorageOptions() const; + bool storageOptionsIsSet() const; + void unsetStorage_options(); + void setStorageOptions(const std::map& value); + + /// + /// If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + /// + /// When true, the caller should use namespace table version operations (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) to manage table versions instead of relying on Lance's native version management. + /// + bool isManagedVersioning() const; + bool managedVersioningIsSet() const; + void unsetManaged_versioning(); + void setManagedVersioning(bool value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + std::map m_Storage_options; + bool m_Storage_optionsIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + + bool m_Managed_versioning; + bool m_Managed_versioningIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeclareTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableRequest.h new file mode 100644 index 000000000..ea84c14d1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableRequest.h @@ -0,0 +1,125 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeleteFromTableRequest.h + * + * Delete data from table based on a SQL predicate. Returns the number of rows that were deleted. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteFromTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteFromTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Delete data from table based on a SQL predicate. Returns the number of rows that were deleted. +/// +class DeleteFromTableRequest + : public ModelBase +{ +public: + DeleteFromTableRequest(); + virtual ~DeleteFromTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeleteFromTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The namespace identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// SQL predicate to filter rows for deletion. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getPredicate() const; + bool predicateIsSet() const; + void unsetPredicate(); + void setPredicate(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Predicate; + bool m_PredicateIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteFromTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableResponse.h new file mode 100644 index 000000000..8b0792c35 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteFromTableResponse.h @@ -0,0 +1,88 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeleteFromTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteFromTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteFromTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DeleteFromTableResponse + : public ModelBase +{ +public: + DeleteFromTableResponse(); + virtual ~DeleteFromTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeleteFromTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// The commit version associated with the operation + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteFromTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchRequest.h new file mode 100644 index 000000000..4d18bc6b5 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchRequest.h @@ -0,0 +1,108 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeleteTableBranchRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableBranchRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableBranchRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DeleteTableBranchRequest + : public ModelBase +{ +public: + DeleteTableBranchRequest(); + virtual ~DeleteTableBranchRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeleteTableBranchRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Name of the branch to delete + /// + utility::string_t getName() const; + bool nameIsSet() const; + void unsetName(); + void setName(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Name; + bool m_NameIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableBranchRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchResponse.h new file mode 100644 index 000000000..1108a5270 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableBranchResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeleteTableBranchResponse.h + * + * Response for delete branch operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableBranchResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableBranchResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for delete branch operation +/// +class DeleteTableBranchResponse + : public ModelBase +{ +public: + DeleteTableBranchResponse(); + virtual ~DeleteTableBranchResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeleteTableBranchResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableBranchResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagRequest.h new file mode 100644 index 000000000..8d1765653 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagRequest.h @@ -0,0 +1,108 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeleteTableTagRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableTagRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableTagRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DeleteTableTagRequest + : public ModelBase +{ +public: + DeleteTableTagRequest(); + virtual ~DeleteTableTagRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeleteTableTagRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Name of the tag to delete + /// + utility::string_t getTag() const; + bool tagIsSet() const; + void unsetTag(); + void setTag(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Tag; + bool m_TagIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableTagRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagResponse.h new file mode 100644 index 000000000..cb18e7d87 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeleteTableTagResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeleteTableTagResponse.h + * + * Response for delete tag operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableTagResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableTagResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for delete tag operation +/// +class DeleteTableTagResponse + : public ModelBase +{ +public: + DeleteTableTagResponse(); + virtual ~DeleteTableTagResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeleteTableTagResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeleteTableTagResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableRequest.h new file mode 100644 index 000000000..f040874d1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableRequest.h @@ -0,0 +1,100 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeregisterTableRequest.h + * + * The table content remains available in the storage. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeregisterTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeregisterTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// The table content remains available in the storage. +/// +class DeregisterTableRequest + : public ModelBase +{ +public: + DeregisterTableRequest(); + virtual ~DeregisterTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeregisterTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeregisterTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableResponse.h new file mode 100644 index 000000000..21ec9fe73 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DeregisterTableResponse.h @@ -0,0 +1,106 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DeregisterTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DeregisterTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DeregisterTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DeregisterTableResponse + : public ModelBase +{ +public: + DeregisterTableResponse(); + virtual ~DeregisterTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DeregisterTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DeregisterTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceRequest.h new file mode 100644 index 000000000..2ab6ecb21 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceRequest.h @@ -0,0 +1,97 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeNamespaceRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeNamespaceRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeNamespaceRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DescribeNamespaceRequest + : public ModelBase +{ +public: + DescribeNamespaceRequest(); + virtual ~DescribeNamespaceRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeNamespaceRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeNamespaceRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceResponse.h new file mode 100644 index 000000000..f05bd7bd6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeNamespaceResponse.h @@ -0,0 +1,78 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeNamespaceResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeNamespaceResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeNamespaceResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DescribeNamespaceResponse + : public ModelBase +{ +public: + DescribeNamespaceResponse(); + virtual ~DescribeNamespaceResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeNamespaceResponse members + + + /// + /// 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. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeNamespaceResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h new file mode 100644 index 000000000..5b9f6b965 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h @@ -0,0 +1,130 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTableIndexStatsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableIndexStatsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableIndexStatsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DescribeTableIndexStatsRequest + : public ModelBase +{ +public: + DescribeTableIndexStatsRequest(); + virtual ~DescribeTableIndexStatsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTableIndexStatsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Optional table version to get stats for + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Name of the index + /// + utility::string_t getIndexName() const; + bool indexNameIsSet() const; + void unsetIndex_name(); + void setIndexName(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Index_name; + bool m_Index_nameIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableIndexStatsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h new file mode 100644 index 000000000..56eed4e27 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h @@ -0,0 +1,121 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTableIndexStatsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableIndexStatsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableIndexStatsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DescribeTableIndexStatsResponse + : public ModelBase +{ +public: + DescribeTableIndexStatsResponse(); + virtual ~DescribeTableIndexStatsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTableIndexStatsResponse members + + + /// + /// Distance type for vector indexes + /// + utility::string_t getDistanceType() const; + bool distanceTypeIsSet() const; + void unsetDistance_type(); + void setDistanceType(const utility::string_t& value); + + /// + /// Type of the index + /// + utility::string_t getIndexType() const; + bool indexTypeIsSet() const; + void unsetIndex_type(); + void setIndexType(const utility::string_t& value); + + /// + /// Number of indexed rows + /// + int64_t getNumIndexedRows() const; + bool numIndexedRowsIsSet() const; + void unsetNum_indexed_rows(); + void setNumIndexedRows(int64_t value); + + /// + /// Number of unindexed rows + /// + int64_t getNumUnindexedRows() const; + bool numUnindexedRowsIsSet() const; + void unsetNum_unindexed_rows(); + void setNumUnindexedRows(int64_t value); + + /// + /// Number of indices + /// + int32_t getNumIndices() const; + bool numIndicesIsSet() const; + void unsetNum_indices(); + void setNumIndices(int32_t value); + + +protected: + utility::string_t m_Distance_type; + bool m_Distance_typeIsSet; + + utility::string_t m_Index_type; + bool m_Index_typeIsSet; + + int64_t m_Num_indexed_rows; + bool m_Num_indexed_rowsIsSet; + + int64_t m_Num_unindexed_rows; + bool m_Num_unindexed_rowsIsSet; + + int32_t m_Num_indices; + bool m_Num_indicesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableIndexStatsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableRequest.h new file mode 100644 index 000000000..7445ebd60 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableRequest.h @@ -0,0 +1,163 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTableRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DescribeTableRequest + : public ModelBase +{ +public: + DescribeTableRequest(); + virtual ~DescribeTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version of the table to describe. If not specified, server should resolve it to the latest version. + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Whether to include the table URI in the response. Default is false. + /// + bool isWithTableUri() const; + bool withTableUriIsSet() const; + void unsetWith_table_uri(); + void setWithTableUri(bool value); + + /// + /// Whether to load detailed metadata that requires opening the dataset. When true, the response must include all detailed metadata such as `version`, `schema`, and `stats` which require reading the dataset. When not set, the implementation can decide whether to return detailed metadata and which parts of detailed metadata to return. + /// + bool isLoadDetailedMetadata() const; + bool loadDetailedMetadataIsSet() const; + void unsetLoad_detailed_metadata(); + void setLoadDetailedMetadata(bool value); + + /// + /// Whether to check if the table exists only as a namespace declaration without storage data. Default is false. When true, the response should populate `is_only_declared`. When false, the implementation should return null for `is_only_declared` unless another option such as `load_detailed_metadata` requires checking declared-only table state. + /// + bool isCheckDeclared() const; + bool checkDeclaredIsSet() const; + void unsetCheck_declared(); + void setCheckDeclared(bool value); + + /// + /// Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. + /// + bool isVendCredentials() const; + bool vendCredentialsIsSet() const; + void unsetVend_credentials(); + void setVendCredentials(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + bool m_With_table_uri; + bool m_With_table_uriIsSet; + + bool m_Load_detailed_metadata; + bool m_Load_detailed_metadataIsSet; + + bool m_Check_declared; + bool m_Check_declaredIsSet; + + bool m_Vend_credentials; + bool m_Vend_credentialsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableResponse.h new file mode 100644 index 000000000..c3139ae5d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableResponse.h @@ -0,0 +1,204 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/JsonArrowSchema.h" +#include +#include +#include "lance_namespace_rest_client/model/TableBasicStats.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class JsonArrowSchema; +class TableBasicStats; + + +class DescribeTableResponse + : public ModelBase +{ +public: + DescribeTableResponse(); + virtual ~DescribeTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTableResponse members + + + /// + /// Table name. Only populated when `load_detailed_metadata` is true. + /// + utility::string_t getTable() const; + bool tableIsSet() const; + void unsetTable(); + void setTable(const utility::string_t& value); + + /// + /// The namespace identifier as a list of parts. Only populated when `load_detailed_metadata` is true. + /// + std::vector getRNamespace() const; + bool rNamespaceIsSet() const; + void unsetr_namespace(); + void setRNamespace(const std::vector& value); + + /// + /// Table version number. Only populated when `load_detailed_metadata` is true. + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Table storage location (e.g., S3/GCS path). + /// + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// Table URI. Unlike location, this field must be a complete and valid URI. Only returned when `with_table_uri` is true. + /// + utility::string_t getTableUri() const; + bool tableUriIsSet() const; + void unsetTable_uri(); + void setTableUri(const utility::string_t& value); + + /// + /// Table schema in JSON Arrow format. Only populated when `load_detailed_metadata` is true. + /// + std::shared_ptr getSchema() const; + bool schemaIsSet() const; + void unsetSchema(); + void setSchema(const std::shared_ptr& value); + + /// + /// Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. When `vend_credentials` is true, this field may include vended credentials. If the vended credentials are temporary, the `expires_at_millis` key should be included to indicate the millisecond timestamp when the credentials expire. + /// + std::map getStorageOptions() const; + bool storageOptionsIsSet() const; + void unsetStorage_options(); + void setStorageOptions(const std::map& value); + + /// + /// Table statistics. Only populated when `load_detailed_metadata` is true. + /// + std::shared_ptr getStats() const; + bool statsIsSet() const; + void unsetStats(); + void setStats(const std::shared_ptr& value); + + /// + /// Optional table metadata as key-value pairs. This records the information of the table and requires loading the table. It is only populated when `load_detailed_metadata` is true. + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + /// + /// Properties stored on the table, if supported by the server. This records the information managed by the namespace. If the server does not support table properties, it should return null for this field. If table properties are supported, but none are set, it should return an empty object. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + /// + /// When true, the caller should use namespace table version operations (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) to manage table versions instead of relying on Lance's native version management. + /// + bool isManagedVersioning() const; + bool managedVersioningIsSet() const; + void unsetManaged_versioning(); + void setManagedVersioning(bool value); + + /// + /// When true, indicates that the table has been declared in the namespace but not yet created on storage. This means the table exists in the namespace but has no data files on the underlying storage. When false, the table has storage components (data and metadata files). When null, the implementation did not check whether the table is only declared. Clients should treat an omitted value as null. Implementations should populate this field when `check_declared` is true or another option such as `load_detailed_metadata` requires checking declared-only table state. Operations like describe_table with load_detailed_metadata=true may fail for declared-only tables. + /// + bool isIsOnlyDeclared() const; + bool isOnlyDeclaredIsSet() const; + void unsetIs_only_declared(); + void setIsOnlyDeclared(bool value); + + +protected: + utility::string_t m_Table; + bool m_TableIsSet; + + std::vector m_r_namespace; + bool m_r_namespaceIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + utility::string_t m_Table_uri; + bool m_Table_uriIsSet; + + std::shared_ptr m_Schema; + bool m_SchemaIsSet; + + std::map m_Storage_options; + bool m_Storage_optionsIsSet; + + std::shared_ptr m_Stats; + bool m_StatsIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + + bool m_Managed_versioning; + bool m_Managed_versioningIsSet; + + bool m_Is_only_declared; + bool m_Is_only_declaredIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionRequest.h new file mode 100644 index 000000000..7ef2ca4a0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionRequest.h @@ -0,0 +1,125 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTableVersionRequest.h + * + * Request to describe a specific table version + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableVersionRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableVersionRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Request to describe a specific table version +/// +class DescribeTableVersionRequest + : public ModelBase +{ +public: + DescribeTableVersionRequest(); + virtual ~DescribeTableVersionRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTableVersionRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version number to describe + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableVersionRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionResponse.h new file mode 100644 index 000000000..552791827 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTableVersionResponse.h @@ -0,0 +1,81 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTableVersionResponse.h + * + * Response containing the table version information + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableVersionResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableVersionResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/TableVersion.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class TableVersion; + + +/// +/// Response containing the table version information +/// +class DescribeTableVersionResponse + : public ModelBase +{ +public: + DescribeTableVersionResponse(); + virtual ~DescribeTableVersionResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTableVersionResponse members + + + /// + /// The table version information + /// + std::shared_ptr getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTableVersionResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionRequest.h new file mode 100644 index 000000000..d51e94e55 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionRequest.h @@ -0,0 +1,97 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTransactionRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTransactionRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTransactionRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DescribeTransactionRequest + : public ModelBase +{ +public: + DescribeTransactionRequest(); + virtual ~DescribeTransactionRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTransactionRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTransactionRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionResponse.h new file mode 100644 index 000000000..0a64a1676 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DescribeTransactionResponse.h @@ -0,0 +1,86 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DescribeTransactionResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTransactionResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTransactionResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DescribeTransactionResponse + : public ModelBase +{ +public: + DescribeTransactionResponse(); + virtual ~DescribeTransactionResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DescribeTransactionResponse members + + + /// + /// The status of a transaction. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Queued: the transaction is queued and not yet started - Running: the transaction is currently running - Succeeded: the transaction has completed successfully - Failed: the transaction has failed - Canceled: the transaction was canceled + /// + utility::string_t getStatus() const; + bool statusIsSet() const; + void unsetStatus(); + void setStatus(const utility::string_t& value); + + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Status; + bool m_StatusIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DescribeTransactionResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceRequest.h new file mode 100644 index 000000000..4def25d8f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceRequest.h @@ -0,0 +1,119 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DropNamespaceRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DropNamespaceRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DropNamespaceRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DropNamespaceRequest + : public ModelBase +{ +public: + DropNamespaceRequest(); + virtual ~DropNamespaceRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DropNamespaceRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Fail (default): the server must return 400 indicating the namespace to drop does not exist. - Skip: the server must return 204 indicating the drop operation has succeeded. + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + /// + /// The behavior for dropping a namespace. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Restrict (default): the namespace should not contain any table or child namespace when drop is initiated. If tables are found, the server should return error and not drop the namespace. - Cascade: all tables and child namespaces in the namespace are dropped before the namespace is dropped. + /// + utility::string_t getBehavior() const; + bool behaviorIsSet() const; + void unsetBehavior(); + void setBehavior(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + + utility::string_t m_Behavior; + bool m_BehaviorIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DropNamespaceRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceResponse.h new file mode 100644 index 000000000..ea1bbb544 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropNamespaceResponse.h @@ -0,0 +1,90 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DropNamespaceResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DropNamespaceResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DropNamespaceResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DropNamespaceResponse + : public ModelBase +{ +public: + DropNamespaceResponse(); + virtual ~DropNamespaceResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DropNamespaceResponse members + + + /// + /// If the implementation does not support namespace properties, it should return null for this field. Otherwise it should return the properties. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + /// + /// If present, indicating the operation is long running and should be tracked using DescribeTransaction + /// + std::vector getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const std::vector& value); + + +protected: + std::map m_Properties; + bool m_PropertiesIsSet; + + std::vector m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DropNamespaceResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexRequest.h new file mode 100644 index 000000000..007094b26 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexRequest.h @@ -0,0 +1,119 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DropTableIndexRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableIndexRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableIndexRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class DropTableIndexRequest + : public ModelBase +{ +public: + DropTableIndexRequest(); + virtual ~DropTableIndexRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DropTableIndexRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Name of the index to drop + /// + utility::string_t getIndexName() const; + bool indexNameIsSet() const; + void unsetIndex_name(); + void setIndexName(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Index_name; + bool m_Index_nameIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableIndexRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexResponse.h new file mode 100644 index 000000000..b5060ba26 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableIndexResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DropTableIndexResponse.h + * + * Response for drop index operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableIndexResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableIndexResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for drop index operation +/// +class DropTableIndexResponse + : public ModelBase +{ +public: + DropTableIndexResponse(); + virtual ~DropTableIndexResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DropTableIndexResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableIndexResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableRequest.h new file mode 100644 index 000000000..5fc8771e7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableRequest.h @@ -0,0 +1,100 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DropTableRequest.h + * + * If the table and its data can be immediately deleted, return information of the deleted table. Otherwise, return a transaction ID that client can use to track deletion progress. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// If the table and its data can be immediately deleted, return information of the deleted table. Otherwise, return a transaction ID that client can use to track deletion progress. +/// +class DropTableRequest + : public ModelBase +{ +public: + DropTableRequest(); + virtual ~DropTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DropTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableResponse.h new file mode 100644 index 000000000..6d52c53b6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/DropTableResponse.h @@ -0,0 +1,106 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * DropTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class DropTableResponse + : public ModelBase +{ +public: + DropTableResponse(); + virtual ~DropTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// DropTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_DropTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ErrorResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ErrorResponse.h new file mode 100644 index 000000000..275a73dfe --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ErrorResponse.h @@ -0,0 +1,113 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ErrorResponse.h + * + * Common JSON error response model + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ErrorResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ErrorResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Common JSON error response model +/// +class ErrorResponse + : public ModelBase +{ +public: + ErrorResponse(); + virtual ~ErrorResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ErrorResponse members + + + /// + /// A brief, human-readable message about the error. + /// + utility::string_t getError() const; + bool errorIsSet() const; + void unsetError(); + void setError(const utility::string_t& value); + + /// + /// Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The specified transaction does not exist 11 - TableVersionNotFound: The specified table version does not exist 12 - TableColumnNotFound: The specified table field does not exist 13 - InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - InvalidTableState: Table is in an invalid state for the operation 20 - TableSchemaValidationError: Table schema validation failed 21 - Throttling: Request rate limit exceeded 22 - TableBranchNotFound: The specified table branch does not exist 23 - TableBranchAlreadyExists: A table branch with this name already exists + /// + int32_t getCode() const; + bool codeIsSet() const; + void unsetCode(); + void setCode(int32_t value); + + /// + /// An optional human-readable explanation of the error. This can be used to record additional information such as stack trace. + /// + utility::string_t getDetail() const; + bool detailIsSet() const; + void unsetDetail(); + void setDetail(const utility::string_t& value); + + /// + /// A string that identifies the specific occurrence of the error. This can be a URI, a request or response ID, or anything that the implementation can recognize to trace specific occurrence of the error. + /// + utility::string_t getInstance() const; + bool instanceIsSet() const; + void unsetInstance(); + void setInstance(const utility::string_t& value); + + +protected: + utility::string_t m_Error; + bool m_ErrorIsSet; + + int32_t m_Code; + bool m_CodeIsSet; + + utility::string_t m_Detail; + bool m_DetailIsSet; + + utility::string_t m_Instance; + bool m_InstanceIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ErrorResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h new file mode 100644 index 000000000..4508074db --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h @@ -0,0 +1,129 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ExplainTableQueryPlanRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ExplainTableQueryPlanRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ExplainTableQueryPlanRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include "lance_namespace_rest_client/model/QueryTableRequest.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class QueryTableRequest; + + +class ExplainTableQueryPlanRequest + : public ModelBase +{ +public: + ExplainTableQueryPlanRequest(); + virtual ~ExplainTableQueryPlanRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ExplainTableQueryPlanRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + std::shared_ptr getQuery() const; + bool queryIsSet() const; + void unsetQuery(); + void setQuery(const std::shared_ptr& value); + + /// + /// Whether to return verbose explanation + /// + bool isVerbose() const; + bool verboseIsSet() const; + void unsetVerbose(); + void setVerbose(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::shared_ptr m_Query; + bool m_QueryIsSet; + + bool m_Verbose; + bool m_VerboseIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ExplainTableQueryPlanRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanResponse.h new file mode 100644 index 000000000..5a1bac4ed --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ExplainTableQueryPlanResponse.h @@ -0,0 +1,77 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ExplainTableQueryPlanResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ExplainTableQueryPlanResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ExplainTableQueryPlanResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class ExplainTableQueryPlanResponse + : public ModelBase +{ +public: + ExplainTableQueryPlanResponse(); + virtual ~ExplainTableQueryPlanResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ExplainTableQueryPlanResponse members + + + /// + /// Human-readable query execution plan + /// + utility::string_t getPlan() const; + bool planIsSet() const; + void unsetPlan(); + void setPlan(const utility::string_t& value); + + +protected: + utility::string_t m_Plan; + bool m_PlanIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ExplainTableQueryPlanResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentStats.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentStats.h new file mode 100644 index 000000000..bdb0f4f5c --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentStats.h @@ -0,0 +1,100 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * FragmentStats.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_FragmentStats_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_FragmentStats_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/FragmentSummary.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class FragmentSummary; + + +class FragmentStats + : public ModelBase +{ +public: + FragmentStats(); + virtual ~FragmentStats(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// FragmentStats members + + + /// + /// The number of fragments in the table + /// + int64_t getNumFragments() const; + bool numFragmentsIsSet() const; + void unsetNum_fragments(); + void setNumFragments(int64_t value); + + /// + /// The number of uncompacted fragments in the table + /// + int64_t getNumSmallFragments() const; + bool numSmallFragmentsIsSet() const; + void unsetNum_small_fragments(); + void setNumSmallFragments(int64_t value); + + /// + /// Statistics on the number of rows in the table fragments + /// + std::shared_ptr getLengths() const; + bool lengthsIsSet() const; + void unsetLengths(); + void setLengths(const std::shared_ptr& value); + + +protected: + int64_t m_Num_fragments; + bool m_Num_fragmentsIsSet; + + int64_t m_Num_small_fragments; + bool m_Num_small_fragmentsIsSet; + + std::shared_ptr m_Lengths; + bool m_LengthsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_FragmentStats_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentSummary.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentSummary.h new file mode 100644 index 000000000..610aefcb2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FragmentSummary.h @@ -0,0 +1,121 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * FragmentSummary.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_FragmentSummary_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_FragmentSummary_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class FragmentSummary + : public ModelBase +{ +public: + FragmentSummary(); + virtual ~FragmentSummary(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// FragmentSummary members + + + int64_t getMin() const; + bool minIsSet() const; + void unsetMin(); + void setMin(int64_t value); + + int64_t getMax() const; + bool maxIsSet() const; + void unsetMax(); + void setMax(int64_t value); + + int64_t getMean() const; + bool meanIsSet() const; + void unsetMean(); + void setMean(int64_t value); + + int64_t getP25() const; + bool p25IsSet() const; + void unsetP25(); + void setP25(int64_t value); + + int64_t getP50() const; + bool p50IsSet() const; + void unsetP50(); + void setP50(int64_t value); + + int64_t getP75() const; + bool p75IsSet() const; + void unsetP75(); + void setP75(int64_t value); + + int64_t getP99() const; + bool p99IsSet() const; + void unsetP99(); + void setP99(int64_t value); + + +protected: + int64_t m_Min; + bool m_MinIsSet; + + int64_t m_Max; + bool m_MaxIsSet; + + int64_t m_Mean; + bool m_MeanIsSet; + + int64_t m_P25; + bool m_P25IsSet; + + int64_t m_P50; + bool m_P50IsSet; + + int64_t m_P75; + bool m_P75IsSet; + + int64_t m_P99; + bool m_P99IsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_FragmentSummary_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FtsQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FtsQuery.h new file mode 100644 index 000000000..dac43ea56 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/FtsQuery.h @@ -0,0 +1,118 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * FtsQuery.h + * + * Full-text search query. Exactly one query type field must be provided. This structure follows the same pattern as AlterTransactionAction to minimize differences and compatibility issues across codegen in different languages. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_FtsQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_FtsQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/MultiMatchQuery.h" +#include "lance_namespace_rest_client/model/MatchQuery.h" +#include "lance_namespace_rest_client/model/PhraseQuery.h" +#include "lance_namespace_rest_client/model/BooleanQuery.h" +#include "lance_namespace_rest_client/model/BoostQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class MatchQuery; +class PhraseQuery; +class BoostQuery; +class MultiMatchQuery; +class BooleanQuery; + + +/// +/// Full-text search query. Exactly one query type field must be provided. This structure follows the same pattern as AlterTransactionAction to minimize differences and compatibility issues across codegen in different languages. +/// +class FtsQuery + : public ModelBase +{ +public: + FtsQuery(); + virtual ~FtsQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// FtsQuery members + + + std::shared_ptr getMatch() const; + bool matchIsSet() const; + void unsetMatch(); + void setMatch(const std::shared_ptr& value); + + std::shared_ptr getPhrase() const; + bool phraseIsSet() const; + void unsetPhrase(); + void setPhrase(const std::shared_ptr& value); + + std::shared_ptr getBoost() const; + bool boostIsSet() const; + void unsetBoost(); + void setBoost(const std::shared_ptr& value); + + std::shared_ptr getMultiMatch() const; + bool multiMatchIsSet() const; + void unsetMulti_match(); + void setMultiMatch(const std::shared_ptr& value); + + std::shared_ptr getBoolean() const; + bool booleanIsSet() const; + void unsetboolean(); + void setBoolean(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_Match; + bool m_MatchIsSet; + + std::shared_ptr m_Phrase; + bool m_PhraseIsSet; + + std::shared_ptr m_Boost; + bool m_BoostIsSet; + + std::shared_ptr m_Multi_match; + bool m_Multi_matchIsSet; + + std::shared_ptr m_boolean; + bool m_booleanIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_FtsQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsRequest.h new file mode 100644 index 000000000..ac8da7a0c --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsRequest.h @@ -0,0 +1,108 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * GetTableStatsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableStatsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableStatsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class GetTableStatsRequest + : public ModelBase +{ +public: + GetTableStatsRequest(); + virtual ~GetTableStatsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// GetTableStatsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableStatsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsResponse.h new file mode 100644 index 000000000..b22cafc3c --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableStatsResponse.h @@ -0,0 +1,111 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * GetTableStatsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableStatsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableStatsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/FragmentStats.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class FragmentStats; + + +class GetTableStatsResponse + : public ModelBase +{ +public: + GetTableStatsResponse(); + virtual ~GetTableStatsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// GetTableStatsResponse members + + + /// + /// The total number of bytes in the table + /// + int64_t getTotalBytes() const; + bool totalBytesIsSet() const; + void unsetTotal_bytes(); + void setTotalBytes(int64_t value); + + /// + /// The number of rows in the table + /// + int64_t getNumRows() const; + bool numRowsIsSet() const; + void unsetNum_rows(); + void setNumRows(int64_t value); + + /// + /// The number of indices in the table + /// + int64_t getNumIndices() const; + bool numIndicesIsSet() const; + void unsetNum_indices(); + void setNumIndices(int64_t value); + + /// + /// Statistics on table fragments + /// + std::shared_ptr getFragmentStats() const; + bool fragmentStatsIsSet() const; + void unsetFragment_stats(); + void setFragmentStats(const std::shared_ptr& value); + + +protected: + int64_t m_Total_bytes; + bool m_Total_bytesIsSet; + + int64_t m_Num_rows; + bool m_Num_rowsIsSet; + + int64_t m_Num_indices; + bool m_Num_indicesIsSet; + + std::shared_ptr m_Fragment_stats; + bool m_Fragment_statsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableStatsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionRequest.h new file mode 100644 index 000000000..f22cf409f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionRequest.h @@ -0,0 +1,108 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * GetTableTagVersionRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableTagVersionRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableTagVersionRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class GetTableTagVersionRequest + : public ModelBase +{ +public: + GetTableTagVersionRequest(); + virtual ~GetTableTagVersionRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// GetTableTagVersionRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Name of the tag to get version for + /// + utility::string_t getTag() const; + bool tagIsSet() const; + void unsetTag(); + void setTag(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Tag; + bool m_TagIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableTagVersionRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionResponse.h new file mode 100644 index 000000000..040da5fb3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/GetTableTagVersionResponse.h @@ -0,0 +1,88 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * GetTableTagVersionResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableTagVersionResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableTagVersionResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class GetTableTagVersionResponse + : public ModelBase +{ +public: + GetTableTagVersionResponse(); + virtual ~GetTableTagVersionResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// GetTableTagVersionResponse members + + + /// + /// version number that the tag points to + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch the tag's version lives on. Absent when the tag points to the main branch. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + +protected: + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_GetTableTagVersionResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/Identity.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/Identity.h new file mode 100644 index 000000000..90324cc26 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/Identity.h @@ -0,0 +1,91 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Identity.h + * + * Identity information of a request. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Identity_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_Identity_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Identity information of a request. +/// +class Identity + : public ModelBase +{ +public: + Identity(); + virtual ~Identity(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// Identity members + + + /// + /// API key for authentication. REST NAMESPACE ONLY This is passed via the `x-api-key` header. + /// + utility::string_t getApiKey() const; + bool apiKeyIsSet() const; + void unsetApi_key(); + void setApiKey(const utility::string_t& value); + + /// + /// Bearer token for authentication. REST NAMESPACE ONLY This is passed via the `Authorization` header with the Bearer scheme (e.g., `Bearer <token>`). + /// + utility::string_t getAuthToken() const; + bool authTokenIsSet() const; + void unsetAuth_token(); + void setAuthToken(const utility::string_t& value); + + +protected: + utility::string_t m_Api_key; + bool m_Api_keyIsSet; + + utility::string_t m_Auth_token; + bool m_Auth_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Identity_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/IndexContent.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/IndexContent.h new file mode 100644 index 000000000..9350d6bea --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/IndexContent.h @@ -0,0 +1,210 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * IndexContent.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_IndexContent_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_IndexContent_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class IndexContent + : public ModelBase +{ +public: + IndexContent(); + virtual ~IndexContent(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// IndexContent members + + + /// + /// Name of the index + /// + utility::string_t getIndexName() const; + bool indexNameIsSet() const; + void unsetIndex_name(); + void setIndexName(const utility::string_t& value); + + /// + /// Unique identifier for the index + /// + utility::string_t getIndexUuid() const; + bool indexUuidIsSet() const; + void unsetIndex_uuid(); + void setIndexUuid(const utility::string_t& value); + + /// + /// Canonical Lance field paths covered by this index. Nested fields use dot-separated segments; segments containing literal dots are backtick-quoted, and backticks inside quoted segments are doubled. + /// + std::vector getColumns() const; + bool columnsIsSet() const; + void unsetColumns(); + void setColumns(const std::vector& value); + + /// + /// Current status of the index + /// + utility::string_t getStatus() const; + bool statusIsSet() const; + void unsetStatus(); + void setStatus(const utility::string_t& value); + + /// + /// Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index. + /// + utility::string_t getIndexType() const; + bool indexTypeIsSet() const; + void unsetIndex_type(); + void setIndexType(const utility::string_t& value); + + /// + /// Protobuf type URL, a precise type identifier for the index. + /// + utility::string_t getTypeUrl() const; + bool typeUrlIsSet() const; + void unsetType_url(); + void setTypeUrl(const utility::string_t& value); + + /// + /// Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted. + /// + int64_t getNumIndexedRows() const; + bool numIndexedRowsIsSet() const; + void unsetNum_indexed_rows(); + void setNumIndexedRows(int64_t value); + + /// + /// Number of rows that are not indexed. + /// + int64_t getNumUnindexedRows() const; + bool numUnindexedRowsIsSet() const; + void unsetNum_unindexed_rows(); + void setNumUnindexedRows(int64_t value); + + /// + /// Total index size in bytes across all segments. Null for indices predating file-size tracking. + /// + int64_t getSizeBytes() const; + bool sizeBytesIsSet() const; + void unsetSize_bytes(); + void setSizeBytes(int64_t value); + + /// + /// Number of index deltas/segments. + /// + int32_t getNumSegments() const; + bool numSegmentsIsSet() const; + void unsetNum_segments(); + void setNumSegments(int32_t value); + + /// + /// Creation time for indexes. Null for legacy indices. + /// + utility::datetime getCreatedAt() const; + bool createdAtIsSet() const; + void unsetCreated_at(); + void setCreatedAt(const utility::datetime& value); + + /// + /// On-disk index format version. + /// + int32_t getIndexVersion() const; + bool indexVersionIsSet() const; + void unsetIndex_version(); + void setIndexVersion(int32_t value); + + /// + /// Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters. + /// + utility::string_t getIndexDetails() const; + bool indexDetailsIsSet() const; + void unsetIndex_details(); + void setIndexDetails(const utility::string_t& value); + + +protected: + utility::string_t m_Index_name; + bool m_Index_nameIsSet; + + utility::string_t m_Index_uuid; + bool m_Index_uuidIsSet; + + std::vector m_Columns; + bool m_ColumnsIsSet; + + utility::string_t m_Status; + bool m_StatusIsSet; + + utility::string_t m_Index_type; + bool m_Index_typeIsSet; + + utility::string_t m_Type_url; + bool m_Type_urlIsSet; + + int64_t m_Num_indexed_rows; + bool m_Num_indexed_rowsIsSet; + + int64_t m_Num_unindexed_rows; + bool m_Num_unindexed_rowsIsSet; + + int64_t m_Size_bytes; + bool m_Size_bytesIsSet; + + int32_t m_Num_segments; + bool m_Num_segmentsIsSet; + + utility::datetime m_Created_at; + bool m_Created_atIsSet; + + int32_t m_Index_version; + bool m_Index_versionIsSet; + + utility::string_t m_Index_details; + bool m_Index_detailsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_IndexContent_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableRequest.h new file mode 100644 index 000000000..8f2d25e55 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableRequest.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * InsertIntoTableRequest.h + * + * Request for inserting records into a table, excluding the Arrow IPC stream. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_InsertIntoTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_InsertIntoTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Request for inserting records into a table, excluding the Arrow IPC stream. +/// +class InsertIntoTableRequest + : public ModelBase +{ +public: + InsertIntoTableRequest(); + virtual ~InsertIntoTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// InsertIntoTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: - Append (default): insert data to the existing table - Overwrite: remove all data in the table and then insert data to it + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_InsertIntoTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableResponse.h new file mode 100644 index 000000000..2aef8112f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/InsertIntoTableResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * InsertIntoTableResponse.h + * + * Response from inserting records into a table + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_InsertIntoTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_InsertIntoTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response from inserting records into a table +/// +class InsertIntoTableResponse + : public ModelBase +{ +public: + InsertIntoTableResponse(); + virtual ~InsertIntoTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// InsertIntoTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_InsertIntoTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowDataType.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowDataType.h new file mode 100644 index 000000000..56f1bc4b9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowDataType.h @@ -0,0 +1,105 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * JsonArrowDataType.h + * + * JSON representation of an Apache Arrow DataType + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowDataType_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowDataType_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/model/JsonArrowField.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class JsonArrowField; + + +/// +/// JSON representation of an Apache Arrow DataType +/// +class JsonArrowDataType + : public ModelBase +{ +public: + JsonArrowDataType(); + virtual ~JsonArrowDataType(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// JsonArrowDataType members + + + /// + /// Fields for complex types like Struct, Union, etc. + /// + std::vector> getFields() const; + bool fieldsIsSet() const; + void unsetFields(); + void setFields(const std::vector>& value); + + /// + /// Length for fixed-size types + /// + int64_t getLength() const; + bool lengthIsSet() const; + void unsetLength(); + void setLength(int64_t value); + + /// + /// The data type name + /// + utility::string_t getType() const; + bool typeIsSet() const; + void unsetType(); + void setType(const utility::string_t& value); + + +protected: + std::vector> m_Fields; + bool m_FieldsIsSet; + + int64_t m_Length; + bool m_LengthIsSet; + + utility::string_t m_Type; + bool m_TypeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowDataType_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowField.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowField.h new file mode 100644 index 000000000..71807d483 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowField.h @@ -0,0 +1,104 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * JsonArrowField.h + * + * JSON representation of an Apache Arrow field. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowField_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowField_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/model/JsonArrowDataType.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class JsonArrowDataType; + + +/// +/// JSON representation of an Apache Arrow field. +/// +class JsonArrowField + : public ModelBase +{ +public: + JsonArrowField(); + virtual ~JsonArrowField(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// JsonArrowField members + + + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + utility::string_t getName() const; + bool nameIsSet() const; + void unsetName(); + void setName(const utility::string_t& value); + + bool isNullable() const; + bool nullableIsSet() const; + void unsetNullable(); + void setNullable(bool value); + + std::shared_ptr getType() const; + bool typeIsSet() const; + void unsetType(); + void setType(const std::shared_ptr& value); + + +protected: + std::map m_Metadata; + bool m_MetadataIsSet; + + utility::string_t m_Name; + bool m_NameIsSet; + + bool m_Nullable; + bool m_NullableIsSet; + + std::shared_ptr m_Type; + bool m_TypeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowField_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowSchema.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowSchema.h new file mode 100644 index 000000000..ab8727494 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/JsonArrowSchema.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * JsonArrowSchema.h + * + * JSON representation of a Apache Arrow schema. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowSchema_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowSchema_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/model/JsonArrowField.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class JsonArrowField; + + +/// +/// JSON representation of a Apache Arrow schema. +/// +class JsonArrowSchema + : public ModelBase +{ +public: + JsonArrowSchema(); + virtual ~JsonArrowSchema(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// JsonArrowSchema members + + + std::vector> getFields() const; + bool fieldsIsSet() const; + void unsetFields(); + void setFields(const std::vector>& value); + + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + +protected: + std::vector> m_Fields; + bool m_FieldsIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_JsonArrowSchema_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesRequest.h new file mode 100644 index 000000000..6311cd679 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesRequest.h @@ -0,0 +1,119 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListNamespacesRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListNamespacesRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListNamespacesRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class ListNamespacesRequest + : public ModelBase +{ +public: + ListNamespacesRequest(); + virtual ~ListNamespacesRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListNamespacesRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + /// + /// An inclusive upper bound of the number of results that a caller will receive. + /// + int32_t getLimit() const; + bool limitIsSet() const; + void unsetLimit(); + void setLimit(int32_t value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + + int32_t m_Limit; + bool m_LimitIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListNamespacesRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesResponse.h new file mode 100644 index 000000000..639f1566a --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListNamespacesResponse.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListNamespacesResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListNamespacesResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListNamespacesResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class ListNamespacesResponse + : public ModelBase +{ +public: + ListNamespacesResponse(); + virtual ~ListNamespacesResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListNamespacesResponse members + + + /// + /// The list of names of the child namespaces relative to the parent namespace `id` in the request. + /// + std::set getNamespaces() const; + bool namespacesIsSet() const; + void unsetNamespaces(); + void setNamespaces(const std::set& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + +protected: + std::set m_Namespaces; + bool m_NamespacesIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListNamespacesResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesRequest.h new file mode 100644 index 000000000..910bc5b4d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesRequest.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableBranchesRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableBranchesRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableBranchesRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class ListTableBranchesRequest + : public ModelBase +{ +public: + ListTableBranchesRequest(); + virtual ~ListTableBranchesRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableBranchesRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + /// + /// An inclusive upper bound of the number of results that a caller will receive. + /// + int32_t getLimit() const; + bool limitIsSet() const; + void unsetLimit(); + void setLimit(int32_t value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + + int32_t m_Limit; + bool m_LimitIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableBranchesRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesResponse.h new file mode 100644 index 000000000..f4fe86154 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableBranchesResponse.h @@ -0,0 +1,94 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableBranchesResponse.h + * + * Response containing table branches + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableBranchesResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableBranchesResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/BranchContents.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class BranchContents; + + +/// +/// Response containing table branches +/// +class ListTableBranchesResponse + : public ModelBase +{ +public: + ListTableBranchesResponse(); + virtual ~ListTableBranchesResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableBranchesResponse members + + + /// + /// Map of branch names to their contents + /// + std::map> getBranches() const; + bool branchesIsSet() const; + void unsetBranches(); + void setBranches(const std::map>& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + +protected: + std::map> m_Branches; + bool m_BranchesIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableBranchesResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesRequest.h new file mode 100644 index 000000000..33289dd64 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesRequest.h @@ -0,0 +1,144 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableIndicesRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableIndicesRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableIndicesRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class ListTableIndicesRequest + : public ModelBase +{ +public: + ListTableIndicesRequest(); + virtual ~ListTableIndicesRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableIndicesRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The namespace identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Optional table version to list indexes from + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + /// + /// An inclusive upper bound of the number of results that a caller will receive. + /// + int32_t getLimit() const; + bool limitIsSet() const; + void unsetLimit(); + void setLimit(int32_t value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + + int32_t m_Limit; + bool m_LimitIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableIndicesRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesResponse.h new file mode 100644 index 000000000..e7965ea8d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableIndicesResponse.h @@ -0,0 +1,91 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableIndicesResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableIndicesResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableIndicesResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/IndexContent.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class IndexContent; + + +class ListTableIndicesResponse + : public ModelBase +{ +public: + ListTableIndicesResponse(); + virtual ~ListTableIndicesResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableIndicesResponse members + + + /// + /// List of indexes on the table + /// + std::vector> getIndexes() const; + bool indexesIsSet() const; + void unsetIndexes(); + void setIndexes(const std::vector>& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + +protected: + std::vector> m_Indexes; + bool m_IndexesIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableIndicesResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsRequest.h new file mode 100644 index 000000000..8f3f60a73 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsRequest.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableTagsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableTagsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableTagsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class ListTableTagsRequest + : public ModelBase +{ +public: + ListTableTagsRequest(); + virtual ~ListTableTagsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableTagsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + /// + /// An inclusive upper bound of the number of results that a caller will receive. + /// + int32_t getLimit() const; + bool limitIsSet() const; + void unsetLimit(); + void setLimit(int32_t value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + + int32_t m_Limit; + bool m_LimitIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableTagsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsResponse.h new file mode 100644 index 000000000..9b79d17a6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableTagsResponse.h @@ -0,0 +1,94 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableTagsResponse.h + * + * Response containing table tags + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableTagsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableTagsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/TagContents.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class TagContents; + + +/// +/// Response containing table tags +/// +class ListTableTagsResponse + : public ModelBase +{ +public: + ListTableTagsResponse(); + virtual ~ListTableTagsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableTagsResponse members + + + /// + /// Map of tag names to their contents + /// + std::map> getTags() const; + bool tagsIsSet() const; + void unsetTags(); + void setTags(const std::map>& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + +protected: + std::map> m_Tags; + bool m_TagsIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableTagsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsRequest.h new file mode 100644 index 000000000..e39fd694f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsRequest.h @@ -0,0 +1,141 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableVersionsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableVersionsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableVersionsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class ListTableVersionsRequest + : public ModelBase +{ +public: + ListTableVersionsRequest(); + virtual ~ListTableVersionsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableVersionsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + /// + /// An inclusive upper bound of the number of results that a caller will receive. + /// + int32_t getLimit() const; + bool limitIsSet() const; + void unsetLimit(); + void setLimit(int32_t value); + + /// + /// When true, versions are guaranteed to be returned in descending order (latest to oldest). When false or not specified, the ordering is implementation-defined. + /// + bool isDescending() const; + bool descendingIsSet() const; + void unsetDescending(); + void setDescending(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + + int32_t m_Limit; + bool m_LimitIsSet; + + bool m_Descending; + bool m_DescendingIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableVersionsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsResponse.h new file mode 100644 index 000000000..aeb9afc41 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTableVersionsResponse.h @@ -0,0 +1,91 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTableVersionsResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableVersionsResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableVersionsResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/TableVersion.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class TableVersion; + + +class ListTableVersionsResponse + : public ModelBase +{ +public: + ListTableVersionsResponse(); + virtual ~ListTableVersionsResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTableVersionsResponse members + + + /// + /// List of table versions. When `descending=true`, guaranteed to be ordered from latest to oldest. Otherwise, ordering is implementation-defined. + /// + std::vector> getVersions() const; + bool versionsIsSet() const; + void unsetVersions(); + void setVersions(const std::vector>& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + +protected: + std::vector> m_Versions; + bool m_VersionsIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTableVersionsResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesRequest.h new file mode 100644 index 000000000..3af736053 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesRequest.h @@ -0,0 +1,130 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTablesRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTablesRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTablesRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class ListTablesRequest + : public ModelBase +{ +public: + ListTablesRequest(); + virtual ~ListTablesRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTablesRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + /// + /// An inclusive upper bound of the number of results that a caller will receive. + /// + int32_t getLimit() const; + bool limitIsSet() const; + void unsetLimit(); + void setLimit(int32_t value); + + /// + /// When true (default), includes tables that have been declared in the namespace but not yet created on storage, in addition to tables that have been created. When false, only tables with storage components are returned. + /// + bool isIncludeDeclared() const; + bool includeDeclaredIsSet() const; + void unsetInclude_declared(); + void setIncludeDeclared(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + + int32_t m_Limit; + bool m_LimitIsSet; + + bool m_Include_declared; + bool m_Include_declaredIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTablesRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesResponse.h new file mode 100644 index 000000000..5a803bd1f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/ListTablesResponse.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * ListTablesResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ListTablesResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_ListTablesResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class ListTablesResponse + : public ModelBase +{ +public: + ListTablesResponse(); + virtual ~ListTablesResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// ListTablesResponse members + + + /// + /// The list of names of all the tables under the connected namespace implementation. This should recursively list all the tables in all child namespaces. Each string in the list is the full identifier in string form. + /// + std::set getTables() const; + bool tablesIsSet() const; + void unsetTables(); + void setTables(const std::set& value); + + /// + /// An opaque token that allows pagination for list operations (e.g. ListNamespaces). For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available. After the initial request, the value of the page token from each response must be used as the page token value for the next request. Caller must interpret either `null`, missing value or empty string value of the page token from the implementation's response as the end of the listing results. + /// + utility::string_t getPageToken() const; + bool pageTokenIsSet() const; + void unsetPage_token(); + void setPageToken(const utility::string_t& value); + + +protected: + std::set m_Tables; + bool m_TablesIsSet; + + utility::string_t m_Page_token; + bool m_Page_tokenIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ListTablesResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MatchQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MatchQuery.h new file mode 100644 index 000000000..cb5f19909 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MatchQuery.h @@ -0,0 +1,134 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MatchQuery.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MatchQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_MatchQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class MatchQuery + : public ModelBase +{ +public: + MatchQuery(); + virtual ~MatchQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// MatchQuery members + + + float getBoost() const; + bool boostIsSet() const; + void unsetBoost(); + void setBoost(float value); + + /// + /// Lance field path to match. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Omit to use the query default fields. + /// + utility::string_t getColumn() const; + bool columnIsSet() const; + void unsetColumn(); + void setColumn(const utility::string_t& value); + + int32_t getFuzziness() const; + bool fuzzinessIsSet() const; + void unsetFuzziness(); + void setFuzziness(int32_t value); + + /// + /// The maximum number of terms to expand for fuzzy matching. Default to 50. + /// + int32_t getMaxExpansions() const; + bool maxExpansionsIsSet() const; + void unsetMax_expansions(); + void setMaxExpansions(int32_t value); + + /// + /// The operator to use for combining terms. Case insensitive, supports both PascalCase and snake_case. Valid values are: - And: All terms must match. - Or: At least one term must match. + /// + utility::string_t getROperator() const; + bool rOperatorIsSet() const; + void unsetr_operator(); + void setROperator(const utility::string_t& value); + + /// + /// The number of beginning characters being unchanged for fuzzy matching. Default to 0. + /// + int32_t getPrefixLength() const; + bool prefixLengthIsSet() const; + void unsetPrefix_length(); + void setPrefixLength(int32_t value); + + utility::string_t getTerms() const; + bool termsIsSet() const; + void unsetTerms(); + void setTerms(const utility::string_t& value); + + +protected: + float m_Boost; + bool m_BoostIsSet; + + utility::string_t m_Column; + bool m_ColumnIsSet; + + int32_t m_Fuzziness; + bool m_FuzzinessIsSet; + + int32_t m_Max_expansions; + bool m_Max_expansionsIsSet; + + utility::string_t m_r_operator; + bool m_r_operatorIsSet; + + int32_t m_Prefix_length; + bool m_Prefix_lengthIsSet; + + utility::string_t m_Terms; + bool m_TermsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MatchQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h new file mode 100644 index 000000000..fa2364cc2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h @@ -0,0 +1,241 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MaterializedViewUdtfEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MaterializedViewUdtfEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_MaterializedViewUdtfEntry_H_ + +#include + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include "lance_namespace_rest_client/Object.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class MaterializedViewUdtfEntry + : public ModelBase +{ +public: + MaterializedViewUdtfEntry(); + virtual ~MaterializedViewUdtfEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// MaterializedViewUdtfEntry members + + enum class KindEnum + { + udtf, + chunker, + + }; + /// + /// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. + /// + + KindEnum toKindEnum(const utility::string_t& value) const; + const utility::string_t fromKindEnum(const KindEnum value) const; + + + /// + /// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. + /// + KindEnum getKind() const; + bool kindIsSet() const; + void unsetKind(); + void setKind(const KindEnum value); + + /// + /// Base64-encoded UDTFSpec / ChunkerSpec JSON envelope (per kind). + /// + utility::string_t getUdtf() const; + bool udtfIsSet() const; + void unsetUdtf(); + void setUdtf(const utility::string_t& value); + + /// + /// SHA-256 checksum of the envelope; server validates. + /// + utility::string_t getUdtfSha() const; + bool udtfShaIsSet() const; + void unsetUdtf_sha(); + void setUdtfSha(const utility::string_t& value); + + /// + /// Name of the UDTF + /// + utility::string_t getUdtfName() const; + bool udtfNameIsSet() const; + void unsetUdtf_name(); + void setUdtfName(const utility::string_t& value); + + /// + /// Version of the UDTF + /// + utility::string_t getUdtfVersion() const; + bool udtfVersionIsSet() const; + void unsetUdtf_version(); + void setUdtfVersion(const utility::string_t& value); + + /// + /// Source Lance field paths the UDTF reads. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Null means all fields (batch UDTF only). + /// + std::vector getInputColumns() const; + bool inputColumnsIsSet() const; + void unsetInput_columns(); + void setInputColumns(const std::vector& value); + + utility::string_t getPartitionBy() const; + bool partitionByIsSet() const; + void unsetPartition_by(); + void setPartitionBy(const utility::string_t& value); + + utility::string_t getPartitionByIndexedColumn() const; + bool partitionByIndexedColumnIsSet() const; + void unsetPartition_by_indexed_column(); + void setPartitionByIndexedColumn(const utility::string_t& value); + + /// + /// Ray actor CPU request. + /// + double getNumCpus() const; + bool numCpusIsSet() const; + void unsetNum_cpus(); + void setNumCpus(double value); + + /// + /// Ray actor GPU request. + /// + double getNumGpus() const; + bool numGpusIsSet() const; + void unsetNum_gpus(); + void setNumGpus(double value); + + /// + /// Ray actor memory request, in bytes. + /// + int32_t getMemory() const; + bool memoryIsSet() const; + void unsetMemory(); + void setMemory(int32_t value); + + /// + /// Batch UDTF only. Serialized ErrorHandlingConfig controlling partition-grain fail/retry/skip behavior. + /// + std::shared_ptr getErrorHandling() const; + bool errorHandlingIsSet() const; + void unsetError_handling(); + void setErrorHandling(const std::shared_ptr& value); + + /// + /// Chunker only. True for a batched chunker; affects how the worker dispatches input rows. + /// + bool isBatch() const; + bool batchIsSet() const; + void unsetBatch(); + void setBatch(bool value); + + /// + /// JSON-serialized GenevaManifest for the UDTF environment. + /// + utility::string_t getManifest() const; + bool manifestIsSet() const; + void unsetManifest(); + void setManifest(const utility::string_t& value); + + /// + /// SHA-256 checksum of the manifest content. + /// + utility::string_t getManifestChecksum() const; + bool manifestChecksumIsSet() const; + void unsetManifest_checksum(); + void setManifestChecksum(const utility::string_t& value); + + +protected: + KindEnum m_Kind; + bool m_KindIsSet; + + utility::string_t m_Udtf; + bool m_UdtfIsSet; + + utility::string_t m_Udtf_sha; + bool m_Udtf_shaIsSet; + + utility::string_t m_Udtf_name; + bool m_Udtf_nameIsSet; + + utility::string_t m_Udtf_version; + bool m_Udtf_versionIsSet; + + std::vector m_Input_columns; + bool m_Input_columnsIsSet; + + utility::string_t m_Partition_by; + bool m_Partition_byIsSet; + + utility::string_t m_Partition_by_indexed_column; + bool m_Partition_by_indexed_columnIsSet; + + double m_Num_cpus; + bool m_Num_cpusIsSet; + + double m_Num_gpus; + bool m_Num_gpusIsSet; + + int32_t m_Memory; + bool m_MemoryIsSet; + + std::shared_ptr m_Error_handling; + bool m_Error_handlingIsSet; + + bool m_Batch; + bool m_BatchIsSet; + + utility::string_t m_Manifest; + bool m_ManifestIsSet; + + utility::string_t m_Manifest_checksum; + bool m_Manifest_checksumIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MaterializedViewUdtfEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableRequest.h new file mode 100644 index 000000000..6a0d581dc --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableRequest.h @@ -0,0 +1,199 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MergeInsertIntoTableRequest.h + * + * Request for merging or inserting records into a table, excluding the Arrow IPC stream. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MergeInsertIntoTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_MergeInsertIntoTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Request for merging or inserting records into a table, excluding the Arrow IPC stream. +/// +class MergeInsertIntoTableRequest + : public ModelBase +{ +public: + MergeInsertIntoTableRequest(); + virtual ~MergeInsertIntoTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// MergeInsertIntoTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Lance field path to use for matching rows. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getOn() const; + bool onIsSet() const; + void unsetOn(); + void setOn(const utility::string_t& value); + + /// + /// Update all columns when rows match + /// + bool isWhenMatchedUpdateAll() const; + bool whenMatchedUpdateAllIsSet() const; + void unsetWhen_matched_update_all(); + void setWhenMatchedUpdateAll(bool value); + + /// + /// The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getWhenMatchedUpdateAllFilt() const; + bool whenMatchedUpdateAllFiltIsSet() const; + void unsetWhen_matched_update_all_filt(); + void setWhenMatchedUpdateAllFilt(const utility::string_t& value); + + /// + /// Insert all columns when rows don't match + /// + bool isWhenNotMatchedInsertAll() const; + bool whenNotMatchedInsertAllIsSet() const; + void unsetWhen_not_matched_insert_all(); + void setWhenNotMatchedInsertAll(bool value); + + /// + /// Delete all rows from target table that don't match a row in the source table + /// + bool isWhenNotMatchedBySourceDelete() const; + bool whenNotMatchedBySourceDeleteIsSet() const; + void unsetWhen_not_matched_by_source_delete(); + void setWhenNotMatchedBySourceDelete(bool value); + + /// + /// Delete rows from the target table if there is no match AND the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getWhenNotMatchedBySourceDeleteFilt() const; + bool whenNotMatchedBySourceDeleteFiltIsSet() const; + void unsetWhen_not_matched_by_source_delete_filt(); + void setWhenNotMatchedBySourceDeleteFilt(const utility::string_t& value); + + /// + /// Timeout for the operation (e.g., \"30s\", \"5m\") + /// + utility::string_t getTimeout() const; + bool timeoutIsSet() const; + void unsetTimeout(); + void setTimeout(const utility::string_t& value); + + /// + /// Whether to use index for matching rows + /// + bool isUseIndex() const; + bool useIndexIsSet() const; + void unsetUse_index(); + void setUseIndex(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_On; + bool m_OnIsSet; + + bool m_When_matched_update_all; + bool m_When_matched_update_allIsSet; + + utility::string_t m_When_matched_update_all_filt; + bool m_When_matched_update_all_filtIsSet; + + bool m_When_not_matched_insert_all; + bool m_When_not_matched_insert_allIsSet; + + bool m_When_not_matched_by_source_delete; + bool m_When_not_matched_by_source_deleteIsSet; + + utility::string_t m_When_not_matched_by_source_delete_filt; + bool m_When_not_matched_by_source_delete_filtIsSet; + + utility::string_t m_Timeout; + bool m_TimeoutIsSet; + + bool m_Use_index; + bool m_Use_indexIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MergeInsertIntoTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h new file mode 100644 index 000000000..1b7d8e3a0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MergeInsertIntoTableResponse.h + * + * Response from merge insert operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MergeInsertIntoTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_MergeInsertIntoTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response from merge insert operation +/// +class MergeInsertIntoTableResponse + : public ModelBase +{ +public: + MergeInsertIntoTableResponse(); + virtual ~MergeInsertIntoTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// MergeInsertIntoTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// Number of rows updated + /// + int64_t getNumUpdatedRows() const; + bool numUpdatedRowsIsSet() const; + void unsetNum_updated_rows(); + void setNumUpdatedRows(int64_t value); + + /// + /// Number of rows inserted + /// + int64_t getNumInsertedRows() const; + bool numInsertedRowsIsSet() const; + void unsetNum_inserted_rows(); + void setNumInsertedRows(int64_t value); + + /// + /// Number of rows deleted (typically 0 for merge insert) + /// + int64_t getNumDeletedRows() const; + bool numDeletedRowsIsSet() const; + void unsetNum_deleted_rows(); + void setNumDeletedRows(int64_t value); + + /// + /// The commit version associated with the operation + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + int64_t m_Num_updated_rows; + bool m_Num_updated_rowsIsSet; + + int64_t m_Num_inserted_rows; + bool m_Num_inserted_rowsIsSet; + + int64_t m_Num_deleted_rows; + bool m_Num_deleted_rowsIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MergeInsertIntoTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MultiMatchQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MultiMatchQuery.h new file mode 100644 index 000000000..f09591d0a --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/MultiMatchQuery.h @@ -0,0 +1,76 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * MultiMatchQuery.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MultiMatchQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_MultiMatchQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/MatchQuery.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class MatchQuery; + + +class MultiMatchQuery + : public ModelBase +{ +public: + MultiMatchQuery(); + virtual ~MultiMatchQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// MultiMatchQuery members + + + std::vector> getMatchQueries() const; + bool matchQueriesIsSet() const; + void unsetMatch_queries(); + void setMatchQueries(const std::vector>& value); + + +protected: + std::vector> m_Match_queries; + bool m_Match_queriesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MultiMatchQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/NamespaceExistsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/NamespaceExistsRequest.h new file mode 100644 index 000000000..b18d7fd50 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/NamespaceExistsRequest.h @@ -0,0 +1,97 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * NamespaceExistsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_NamespaceExistsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_NamespaceExistsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class NamespaceExistsRequest + : public ModelBase +{ +public: + NamespaceExistsRequest(); + virtual ~NamespaceExistsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// NamespaceExistsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_NamespaceExistsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionField.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionField.h new file mode 100644 index 000000000..2905e5b97 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionField.h @@ -0,0 +1,129 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * PartitionField.h + * + * Partition field definition + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionField_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionField_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/PartitionTransform.h" +#include +#include "lance_namespace_rest_client/model/JsonArrowDataType.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class PartitionTransform; +class JsonArrowDataType; + + +/// +/// Partition field definition +/// +class PartitionField + : public ModelBase +{ +public: + PartitionField(); + virtual ~PartitionField(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// PartitionField members + + + /// + /// Unique identifier for this partition field (must not be renamed) + /// + utility::string_t getFieldId() const; + bool fieldIdIsSet() const; + void unsetField_id(); + void setFieldId(const utility::string_t& value); + + /// + /// Field IDs of the source fields in the schema + /// + std::vector getSourceIds() const; + bool sourceIdsIsSet() const; + void unsetSource_ids(); + void setSourceIds(std::vector value); + + /// + /// Well-known partition transform. Exactly one of transform or expression must be specified. + /// + std::shared_ptr getTransform() const; + bool transformIsSet() const; + void unsetTransform(); + void setTransform(const std::shared_ptr& value); + + /// + /// DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified. + /// + utility::string_t getExpression() const; + bool expressionIsSet() const; + void unsetExpression(); + void setExpression(const utility::string_t& value); + + /// + /// The output type of the partition value (JsonArrowDataType format) + /// + std::shared_ptr getResultType() const; + bool resultTypeIsSet() const; + void unsetResult_type(); + void setResultType(const std::shared_ptr& value); + + +protected: + utility::string_t m_Field_id; + bool m_Field_idIsSet; + + std::vector m_Source_ids; + bool m_Source_idsIsSet; + + std::shared_ptr m_Transform; + bool m_TransformIsSet; + + utility::string_t m_Expression; + bool m_ExpressionIsSet; + + std::shared_ptr m_Result_type; + bool m_Result_typeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionField_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionSpec.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionSpec.h new file mode 100644 index 000000000..6d5b5ce70 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionSpec.h @@ -0,0 +1,93 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * PartitionSpec.h + * + * Partition spec definition + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionSpec_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionSpec_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/PartitionField.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class PartitionField; + + +/// +/// Partition spec definition +/// +class PartitionSpec + : public ModelBase +{ +public: + PartitionSpec(); + virtual ~PartitionSpec(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// PartitionSpec members + + + /// + /// The spec version ID + /// + int32_t getId() const; + bool idIsSet() const; + void unsetId(); + void setId(int32_t value); + + /// + /// Array of partition field definitions + /// + std::vector> getFields() const; + bool fieldsIsSet() const; + void unsetFields(); + void setFields(const std::vector>& value); + + +protected: + int32_t m_Id; + bool m_IdIsSet; + + std::vector> m_Fields; + bool m_FieldsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionSpec_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionTransform.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionTransform.h new file mode 100644 index 000000000..14b177393 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PartitionTransform.h @@ -0,0 +1,102 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * PartitionTransform.h + * + * Well-known partition transform + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionTransform_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionTransform_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Well-known partition transform +/// +class PartitionTransform + : public ModelBase +{ +public: + PartitionTransform(); + virtual ~PartitionTransform(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// PartitionTransform members + + + /// + /// Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate) + /// + utility::string_t getType() const; + bool typeIsSet() const; + void unsetType(); + void setType(const utility::string_t& value); + + /// + /// Number of buckets for bucket transforms + /// + int32_t getNumBuckets() const; + bool numBucketsIsSet() const; + void unsetNum_buckets(); + void setNumBuckets(int32_t value); + + /// + /// Truncation width for truncate transforms + /// + int32_t getWidth() const; + bool widthIsSet() const; + void unsetWidth(); + void setWidth(int32_t value); + + +protected: + utility::string_t m_Type; + bool m_TypeIsSet; + + int32_t m_Num_buckets; + bool m_Num_bucketsIsSet; + + int32_t m_Width; + bool m_WidthIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_PartitionTransform_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PhraseQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PhraseQuery.h new file mode 100644 index 000000000..efa5a79df --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/PhraseQuery.h @@ -0,0 +1,93 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * PhraseQuery.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_PhraseQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_PhraseQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class PhraseQuery + : public ModelBase +{ +public: + PhraseQuery(); + virtual ~PhraseQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// PhraseQuery members + + + /// + /// Lance field path to match. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Omit to use the query default fields. + /// + utility::string_t getColumn() const; + bool columnIsSet() const; + void unsetColumn(); + void setColumn(const utility::string_t& value); + + int32_t getSlop() const; + bool slopIsSet() const; + void unsetSlop(); + void setSlop(int32_t value); + + utility::string_t getTerms() const; + bool termsIsSet() const; + void unsetTerms(); + void setTerms(const utility::string_t& value); + + +protected: + utility::string_t m_Column; + bool m_ColumnIsSet; + + int32_t m_Slop; + bool m_SlopIsSet; + + utility::string_t m_Terms; + bool m_TermsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_PhraseQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest.h new file mode 100644 index 000000000..c49910104 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest.h @@ -0,0 +1,303 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * QueryTableRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include "lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h" +#include +#include "lance_namespace_rest_client/model/QueryTableRequest_vector.h" +#include +#include +#include "lance_namespace_rest_client/model/QueryTableRequest_columns.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class QueryTableRequest_columns; +class QueryTableRequest_full_text_query; +class QueryTableRequest_vector; + + +class QueryTableRequest + : public ModelBase +{ +public: + QueryTableRequest(); + virtual ~QueryTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// QueryTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Whether to bypass vector index + /// + bool isBypassVectorIndex() const; + bool bypassVectorIndexIsSet() const; + void unsetBypass_vector_index(); + void setBypassVectorIndex(bool value); + + std::shared_ptr getColumns() const; + bool columnsIsSet() const; + void unsetColumns(); + void setColumns(const std::shared_ptr& value); + + /// + /// Distance metric to use + /// + utility::string_t getDistanceType() const; + bool distanceTypeIsSet() const; + void unsetDistance_type(); + void setDistanceType(const utility::string_t& value); + + /// + /// Search effort parameter for HNSW index + /// + int32_t getEf() const; + bool efIsSet() const; + void unsetEf(); + void setEf(int32_t value); + + /// + /// Whether to use fast search + /// + bool isFastSearch() const; + bool fastSearchIsSet() const; + void unsetFast_search(); + void setFastSearch(bool value); + + /// + /// Optional SQL filter expression. Field references in the expression must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getFilter() const; + bool filterIsSet() const; + void unsetFilter(); + void setFilter(const utility::string_t& value); + + std::shared_ptr getFullTextQuery() const; + bool fullTextQueryIsSet() const; + void unsetFull_text_query(); + void setFullTextQuery(const std::shared_ptr& value); + + /// + /// Number of results to return + /// + int32_t getK() const; + bool KIsSet() const; + void unsetk(); + void setK(int32_t value); + + /// + /// Lower bound for search + /// + float getLowerBound() const; + bool lowerBoundIsSet() const; + void unsetLower_bound(); + void setLowerBound(float value); + + /// + /// Number of probes for IVF index + /// + int32_t getNprobes() const; + bool nprobesIsSet() const; + void unsetNprobes(); + void setNprobes(int32_t value); + + /// + /// Number of results to skip + /// + int32_t getOffset() const; + bool offsetIsSet() const; + void unsetOffset(); + void setOffset(int32_t value); + + /// + /// Whether to apply filtering before vector search + /// + bool isPrefilter() const; + bool prefilterIsSet() const; + void unsetPrefilter(); + void setPrefilter(bool value); + + /// + /// Refine factor for search + /// + int32_t getRefineFactor() const; + bool refineFactorIsSet() const; + void unsetRefine_factor(); + void setRefineFactor(int32_t value); + + /// + /// Upper bound for search + /// + float getUpperBound() const; + bool upperBoundIsSet() const; + void unsetUpper_bound(); + void setUpperBound(float value); + + std::shared_ptr getVector() const; + bool vectorIsSet() const; + void unsetVector(); + void setVector(const std::shared_ptr& value); + + /// + /// Lance field path of the vector field to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getVectorColumn() const; + bool vectorColumnIsSet() const; + void unsetVector_column(); + void setVectorColumn(const utility::string_t& value); + + /// + /// Table version to query + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// If true, return the row id as a column called `_rowid` + /// + bool isWithRowId() const; + bool withRowIdIsSet() const; + void unsetWith_row_id(); + void setWithRowId(bool value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + bool m_Bypass_vector_index; + bool m_Bypass_vector_indexIsSet; + + std::shared_ptr m_Columns; + bool m_ColumnsIsSet; + + utility::string_t m_Distance_type; + bool m_Distance_typeIsSet; + + int32_t m_Ef; + bool m_EfIsSet; + + bool m_Fast_search; + bool m_Fast_searchIsSet; + + utility::string_t m_Filter; + bool m_FilterIsSet; + + std::shared_ptr m_Full_text_query; + bool m_Full_text_queryIsSet; + + int32_t m_k; + bool m_kIsSet; + + float m_Lower_bound; + bool m_Lower_boundIsSet; + + int32_t m_Nprobes; + bool m_NprobesIsSet; + + int32_t m_Offset; + bool m_OffsetIsSet; + + bool m_Prefilter; + bool m_PrefilterIsSet; + + int32_t m_Refine_factor; + bool m_Refine_factorIsSet; + + float m_Upper_bound; + bool m_Upper_boundIsSet; + + std::shared_ptr m_Vector; + bool m_VectorIsSet; + + utility::string_t m_Vector_column; + bool m_Vector_columnIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + bool m_With_row_id; + bool m_With_row_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_columns.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_columns.h new file mode 100644 index 000000000..43ea4f04d --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_columns.h @@ -0,0 +1,93 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * QueryTableRequest_columns.h + * + * Optional field paths to return. Provide either column_names or column_aliases, not both. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_columns_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_columns_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Optional field paths to return. Provide either column_names or column_aliases, not both. +/// +class QueryTableRequest_columns + : public ModelBase +{ +public: + QueryTableRequest_columns(); + virtual ~QueryTableRequest_columns(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// QueryTableRequest_columns members + + + /// + /// List of Lance field paths to return. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. + /// + std::vector getColumnNames() const; + bool columnNamesIsSet() const; + void unsetColumn_names(); + void setColumnNames(const std::vector& value); + + /// + /// Object mapping output aliases to source Lance field paths. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. + /// + std::map getColumnAliases() const; + bool columnAliasesIsSet() const; + void unsetColumn_aliases(); + void setColumnAliases(const std::map& value); + + +protected: + std::vector m_Column_names; + bool m_Column_namesIsSet; + + std::map m_Column_aliases; + bool m_Column_aliasesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_columns_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h new file mode 100644 index 000000000..07a554a54 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h @@ -0,0 +1,88 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * QueryTableRequest_full_text_query.h + * + * Optional full-text search query. Provide either string_query or structured_query, not both. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_full_text_query_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_full_text_query_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/StringFtsQuery.h" +#include "lance_namespace_rest_client/model/StructuredFtsQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class StringFtsQuery; +class StructuredFtsQuery; + + +/// +/// Optional full-text search query. Provide either string_query or structured_query, not both. +/// +class QueryTableRequest_full_text_query + : public ModelBase +{ +public: + QueryTableRequest_full_text_query(); + virtual ~QueryTableRequest_full_text_query(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// QueryTableRequest_full_text_query members + + + std::shared_ptr getStringQuery() const; + bool stringQueryIsSet() const; + void unsetString_query(); + void setStringQuery(const std::shared_ptr& value); + + std::shared_ptr getStructuredQuery() const; + bool structuredQueryIsSet() const; + void unsetStructured_query(); + void setStructuredQuery(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_String_query; + bool m_String_queryIsSet; + + std::shared_ptr m_Structured_query; + bool m_Structured_queryIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_full_text_query_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_vector.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_vector.h new file mode 100644 index 000000000..c69f5e6f1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/QueryTableRequest_vector.h @@ -0,0 +1,91 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * QueryTableRequest_vector.h + * + * Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_vector_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_vector_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both. +/// +class QueryTableRequest_vector + : public ModelBase +{ +public: + QueryTableRequest_vector(); + virtual ~QueryTableRequest_vector(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// QueryTableRequest_vector members + + + /// + /// Single query vector + /// + std::vector getSingleVector() const; + bool singleVectorIsSet() const; + void unsetSingle_vector(); + void setSingleVector(std::vector value); + + /// + /// Multiple query vectors for batch search + /// + std::vector> getMultiVector() const; + bool multiVectorIsSet() const; + void unsetMulti_vector(); + void setMultiVector(const std::vector>& value); + + +protected: + std::vector m_Single_vector; + bool m_Single_vectorIsSet; + + std::vector> m_Multi_vector; + bool m_Multi_vectorIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_QueryTableRequest_vector_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h new file mode 100644 index 000000000..2af5d2ec1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h @@ -0,0 +1,176 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RefreshMaterializedViewRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RefreshMaterializedViewRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RefreshMaterializedViewRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class RefreshMaterializedViewRequest + : public ModelBase +{ +public: + RefreshMaterializedViewRequest(); + virtual ~RefreshMaterializedViewRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RefreshMaterializedViewRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Table identifier path (namespace + table name) + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Optional source version to refresh from + /// + int32_t getSrcVersion() const; + bool srcVersionIsSet() const; + void unsetSrc_version(); + void setSrcVersion(int32_t value); + + /// + /// Optional maximum rows per fragment + /// + int32_t getMaxRowsPerFragment() const; + bool maxRowsPerFragmentIsSet() const; + void unsetMax_rows_per_fragment(); + void setMaxRowsPerFragment(int32_t value); + + /// + /// Optional concurrency override + /// + int32_t getConcurrency() const; + bool concurrencyIsSet() const; + void unsetConcurrency(); + void setConcurrency(int32_t value); + + /// + /// Optional intra-applier concurrency override + /// + int32_t getIntraApplierConcurrency() const; + bool intraApplierConcurrencyIsSet() const; + void unsetIntra_applier_concurrency(); + void setIntraApplierConcurrency(int32_t value); + + /// + /// Optional number of source row ids per work item during expansion. Bounds per-actor memory for chunker materialized views. + /// + int32_t getSourceTaskSize() const; + bool sourceTaskSizeIsSet() const; + void unsetSource_task_size(); + void setSourceTaskSize(int32_t value); + + /// + /// Optional cluster name (operational override) + /// + utility::string_t getCluster() const; + bool clusterIsSet() const; + void unsetCluster(); + void setCluster(const utility::string_t& value); + + /// + /// Post-trim cap on view row count after expansion. Valid only for chunker materialized views; returns 400 if set on other kinds. + /// + int32_t getOutputLimit() const; + bool outputLimitIsSet() const; + void unsetOutput_limit(); + void setOutputLimit(int32_t value); + + /// + /// Optional inline JSON-serialized GenevaManifest. Operational override for this refresh only; does not mutate the view's snapshotted manifest. When omitted, the manifest stored in the view's metadata is used. + /// + utility::string_t getManifest() const; + bool manifestIsSet() const; + void unsetManifest(); + void setManifest(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int32_t m_Src_version; + bool m_Src_versionIsSet; + + int32_t m_Max_rows_per_fragment; + bool m_Max_rows_per_fragmentIsSet; + + int32_t m_Concurrency; + bool m_ConcurrencyIsSet; + + int32_t m_Intra_applier_concurrency; + bool m_Intra_applier_concurrencyIsSet; + + int32_t m_Source_task_size; + bool m_Source_task_sizeIsSet; + + utility::string_t m_Cluster; + bool m_ClusterIsSet; + + int32_t m_Output_limit; + bool m_Output_limitIsSet; + + utility::string_t m_Manifest; + bool m_ManifestIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RefreshMaterializedViewRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h new file mode 100644 index 000000000..6b7c674a4 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h @@ -0,0 +1,77 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RefreshMaterializedViewResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RefreshMaterializedViewResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RefreshMaterializedViewResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class RefreshMaterializedViewResponse + : public ModelBase +{ +public: + RefreshMaterializedViewResponse(); + virtual ~RefreshMaterializedViewResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RefreshMaterializedViewResponse members + + + /// + /// The job ID for tracking the refresh job + /// + utility::string_t getJobId() const; + bool jobIdIsSet() const; + void unsetJob_id(); + void setJobId(const utility::string_t& value); + + +protected: + utility::string_t m_Job_id; + bool m_Job_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RefreshMaterializedViewResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableRequest.h new file mode 100644 index 000000000..515df9579 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableRequest.h @@ -0,0 +1,127 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RegisterTableRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RegisterTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RegisterTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class RegisterTableRequest + : public ModelBase +{ +public: + RegisterTableRequest(); + virtual ~RegisterTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RegisterTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// There are two modes when trying to register a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create (default): the operation fails with 409. * Overwrite: the existing table registration is replaced with the new registration. + /// + utility::string_t getMode() const; + bool modeIsSet() const; + void unsetMode(); + void setMode(const utility::string_t& value); + + /// + /// Properties stored on the table, if supported by the implementation. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + utility::string_t m_Mode; + bool m_ModeIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RegisterTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableResponse.h new file mode 100644 index 000000000..37fe07c3e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RegisterTableResponse.h @@ -0,0 +1,97 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RegisterTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RegisterTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RegisterTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class RegisterTableResponse + : public ModelBase +{ +public: + RegisterTableResponse(); + virtual ~RegisterTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RegisterTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + utility::string_t getLocation() const; + bool locationIsSet() const; + void unsetLocation(); + void setLocation(const utility::string_t& value); + + /// + /// If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + utility::string_t m_Location; + bool m_LocationIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RegisterTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableRequest.h new file mode 100644 index 000000000..f4804b57e --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableRequest.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RenameTableRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RenameTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RenameTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class RenameTableRequest + : public ModelBase +{ +public: + RenameTableRequest(); + virtual ~RenameTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RenameTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// New name for the table + /// + utility::string_t getNewTableName() const; + bool newTableNameIsSet() const; + void unsetNew_table_name(); + void setNewTableName(const utility::string_t& value); + + /// + /// New namespace identifier to move the table to (optional, if not specified the table stays in the same namespace) + /// + std::vector getNewNamespaceId() const; + bool newNamespaceIdIsSet() const; + void unsetNew_namespace_id(); + void setNewNamespaceId(const std::vector& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_New_table_name; + bool m_New_table_nameIsSet; + + std::vector m_New_namespace_id; + bool m_New_namespace_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RenameTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableResponse.h new file mode 100644 index 000000000..2a642db73 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RenameTableResponse.h @@ -0,0 +1,77 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RenameTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RenameTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RenameTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class RenameTableResponse + : public ModelBase +{ +public: + RenameTableResponse(); + virtual ~RenameTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RenameTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RenameTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableRequest.h new file mode 100644 index 000000000..bdcbbeac3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableRequest.h @@ -0,0 +1,119 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RestoreTableRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RestoreTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RestoreTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class RestoreTableRequest + : public ModelBase +{ +public: + RestoreTableRequest(); + virtual ~RestoreTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RestoreTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version to restore to + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RestoreTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableResponse.h new file mode 100644 index 000000000..d50128a1c --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/RestoreTableResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * RestoreTableResponse.h + * + * Response for restore table operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_RestoreTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_RestoreTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for restore table operation +/// +class RestoreTableResponse + : public ModelBase +{ +public: + RestoreTableResponse(); + virtual ~RestoreTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// RestoreTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_RestoreTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StringFtsQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StringFtsQuery.h new file mode 100644 index 000000000..180a35596 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StringFtsQuery.h @@ -0,0 +1,86 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * StringFtsQuery.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_StringFtsQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_StringFtsQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class StringFtsQuery + : public ModelBase +{ +public: + StringFtsQuery(); + virtual ~StringFtsQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// StringFtsQuery members + + + /// + /// Lance field paths to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Omit to search all indexed FTS fields. + /// + std::vector getColumns() const; + bool columnsIsSet() const; + void unsetColumns(); + void setColumns(const std::vector& value); + + utility::string_t getQuery() const; + bool queryIsSet() const; + void unsetQuery(); + void setQuery(const utility::string_t& value); + + +protected: + std::vector m_Columns; + bool m_ColumnsIsSet; + + utility::string_t m_Query; + bool m_QueryIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_StringFtsQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StructuredFtsQuery.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StructuredFtsQuery.h new file mode 100644 index 000000000..3f3027cb1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/StructuredFtsQuery.h @@ -0,0 +1,75 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * StructuredFtsQuery.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_StructuredFtsQuery_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_StructuredFtsQuery_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/FtsQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class FtsQuery; + + +class StructuredFtsQuery + : public ModelBase +{ +public: + StructuredFtsQuery(); + virtual ~StructuredFtsQuery(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// StructuredFtsQuery members + + + std::shared_ptr getQuery() const; + bool queryIsSet() const; + void unsetQuery(); + void setQuery(const std::shared_ptr& value); + + +protected: + std::shared_ptr m_Query; + bool m_QueryIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_StructuredFtsQuery_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableBasicStats.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableBasicStats.h new file mode 100644 index 000000000..22edbde15 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableBasicStats.h @@ -0,0 +1,87 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TableBasicStats.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_TableBasicStats_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_TableBasicStats_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class TableBasicStats + : public ModelBase +{ +public: + TableBasicStats(); + virtual ~TableBasicStats(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// TableBasicStats members + + + /// + /// Number of deleted rows in the table + /// + int32_t getNumDeletedRows() const; + bool numDeletedRowsIsSet() const; + void unsetNum_deleted_rows(); + void setNumDeletedRows(int32_t value); + + /// + /// Number of fragments in the table + /// + int32_t getNumFragments() const; + bool numFragmentsIsSet() const; + void unsetNum_fragments(); + void setNumFragments(int32_t value); + + +protected: + int32_t m_Num_deleted_rows; + bool m_Num_deleted_rowsIsSet; + + int32_t m_Num_fragments; + bool m_Num_fragmentsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_TableBasicStats_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableExistsRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableExistsRequest.h new file mode 100644 index 000000000..c1006a9c8 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableExistsRequest.h @@ -0,0 +1,108 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TableExistsRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_TableExistsRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_TableExistsRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class TableExistsRequest + : public ModelBase +{ +public: + TableExistsRequest(); + virtual ~TableExistsRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// TableExistsRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Version of the table to check existence. If not specified, server should resolve it to the latest version. + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_TableExistsRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableVersion.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableVersion.h new file mode 100644 index 000000000..fe52b004b --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TableVersion.h @@ -0,0 +1,133 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TableVersion.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_TableVersion_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_TableVersion_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class TableVersion + : public ModelBase +{ +public: + TableVersion(); + virtual ~TableVersion(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// TableVersion members + + + /// + /// Version number + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Path to the manifest file for this version. + /// + utility::string_t getManifestPath() const; + bool manifestPathIsSet() const; + void unsetManifest_path(); + void setManifestPath(const utility::string_t& value); + + /// + /// Size of the manifest file in bytes + /// + int64_t getManifestSize() const; + bool manifestSizeIsSet() const; + void unsetManifest_size(); + void setManifestSize(int64_t value); + + /// + /// Optional ETag for optimistic concurrency control. Useful for S3 and similar object stores. + /// + utility::string_t getETag() const; + bool eTagIsSet() const; + void unsetE_tag(); + void setETag(const utility::string_t& value); + + /// + /// Timestamp when the version was created, in milliseconds since epoch (Unix time) + /// + int64_t getTimestampMillis() const; + bool timestampMillisIsSet() const; + void unsetTimestamp_millis(); + void setTimestampMillis(int64_t value); + + /// + /// Optional key-value pairs of metadata + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + +protected: + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Manifest_path; + bool m_Manifest_pathIsSet; + + int64_t m_Manifest_size; + bool m_Manifest_sizeIsSet; + + utility::string_t m_E_tag; + bool m_E_tagIsSet; + + int64_t m_Timestamp_millis; + bool m_Timestamp_millisIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_TableVersion_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TagContents.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TagContents.h new file mode 100644 index 000000000..b1d343b67 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/TagContents.h @@ -0,0 +1,99 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TagContents.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_TagContents_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_TagContents_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class TagContents + : public ModelBase +{ +public: + TagContents(); + virtual ~TagContents(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// TagContents members + + + /// + /// Branch name that the tag was created on (if any) + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Version number that the tag points to + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Size of the manifest file in bytes + /// + int64_t getManifestSize() const; + bool manifestSizeIsSet() const; + void unsetManifestSize(); + void setManifestSize(int64_t value); + + +protected: + utility::string_t m_Branch; + bool m_BranchIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + int64_t m_ManifestSize; + bool m_ManifestSizeIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_TagContents_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h new file mode 100644 index 000000000..2f0e97ab6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h @@ -0,0 +1,100 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateFieldMetadataEntry.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataEntry_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataEntry_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class UpdateFieldMetadataEntry + : public ModelBase +{ +public: + UpdateFieldMetadataEntry(); + virtual ~UpdateFieldMetadataEntry(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateFieldMetadataEntry members + + + /// + /// Lance field path whose metadata to update. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound. + /// + utility::string_t getPath() const; + bool pathIsSet() const; + void unsetPath(); + void setPath(const utility::string_t& value); + + /// + /// Metadata key-value pairs to apply to the field. A null value deletes that key. + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + /// + /// If true, replace the field's existing metadata entirely; otherwise merge into it (optional, defaults to false). + /// + bool isReplace() const; + bool replaceIsSet() const; + void unsetReplace(); + void setReplace(bool value); + + +protected: + utility::string_t m_Path; + bool m_PathIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + + bool m_Replace; + bool m_ReplaceIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataEntry_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h new file mode 100644 index 000000000..27007778f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h @@ -0,0 +1,112 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateFieldMetadataRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include "lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; +class UpdateFieldMetadataEntry; + + +class UpdateFieldMetadataRequest + : public ModelBase +{ +public: + UpdateFieldMetadataRequest(); + virtual ~UpdateFieldMetadataRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateFieldMetadataRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Table identifier path (namespace + table name) + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// List of per-field metadata updates to apply + /// + std::vector> getUpdates() const; + bool updatesIsSet() const; + void unsetUpdates(); + void setUpdates(const std::vector>& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::vector> m_Updates; + bool m_UpdatesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h new file mode 100644 index 000000000..15c7f42ff --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateFieldMetadataResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class UpdateFieldMetadataResponse + : public ModelBase +{ +public: + UpdateFieldMetadataResponse(); + virtual ~UpdateFieldMetadataResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateFieldMetadataResponse members + + + /// + /// The commit version associated with the operation + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Resulting metadata for each updated field, keyed by canonical Lance field path. + /// + std::map> getFields() const; + bool fieldsIsSet() const; + void unsetFields(); + void setFields(const std::map>& value); + + +protected: + int64_t m_Version; + bool m_VersionIsSet; + + std::map> m_Fields; + bool m_FieldsIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateFieldMetadataResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableRequest.h new file mode 100644 index 000000000..b1eab21cb --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableRequest.h @@ -0,0 +1,144 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateTableRequest.h + * + * Each update consists of a field path and an SQL expression that will be evaluated against the current row's value. Optionally, a predicate can be provided to filter which rows to update. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +/// +/// Each update consists of a field path and an SQL expression that will be evaluated against the current row's value. Optionally, a predicate can be provided to filter which rows to update. +/// +class UpdateTableRequest + : public ModelBase +{ +public: + UpdateTableRequest(); + virtual ~UpdateTableRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateTableRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Optional SQL predicate to filter rows for update. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + utility::string_t getPredicate() const; + bool predicateIsSet() const; + void unsetPredicate(); + void setPredicate(const utility::string_t& value); + + /// + /// List of field updates as [field_path, expression] pairs. Field paths and expression references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled. + /// + std::vector> getUpdates() const; + bool updatesIsSet() const; + void unsetUpdates(); + void setUpdates(const std::vector>& value); + + /// + /// Properties stored on the table, if supported by the implementation. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + utility::string_t m_Predicate; + bool m_PredicateIsSet; + + std::vector> m_Updates; + bool m_UpdatesIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableResponse.h new file mode 100644 index 000000000..3da2a005f --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableResponse.h @@ -0,0 +1,111 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateTableResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class UpdateTableResponse + : public ModelBase +{ +public: + UpdateTableResponse(); + virtual ~UpdateTableResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateTableResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + /// + /// Number of rows updated + /// + int64_t getUpdatedRows() const; + bool updatedRowsIsSet() const; + void unsetUpdated_rows(); + void setUpdatedRows(int64_t value); + + /// + /// The commit version associated with the operation + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. + /// + std::map getProperties() const; + bool propertiesIsSet() const; + void unsetProperties(); + void setProperties(const std::map& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + + int64_t m_Updated_rows; + bool m_Updated_rowsIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + std::map m_Properties; + bool m_PropertiesIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataRequest.h new file mode 100644 index 000000000..840e2ed63 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataRequest.h @@ -0,0 +1,122 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateTableSchemaMetadataRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableSchemaMetadataRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableSchemaMetadataRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class UpdateTableSchemaMetadataRequest + : public ModelBase +{ +public: + UpdateTableSchemaMetadataRequest(); + virtual ~UpdateTableSchemaMetadataRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateTableSchemaMetadataRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + /// + /// The table identifier + /// + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + /// + /// Schema metadata key-value pairs to set + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + + std::map m_Metadata; + bool m_MetadataIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableSchemaMetadataRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataResponse.h new file mode 100644 index 000000000..72a449b20 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableSchemaMetadataResponse.h @@ -0,0 +1,89 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateTableSchemaMetadataResponse.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableSchemaMetadataResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableSchemaMetadataResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +class UpdateTableSchemaMetadataResponse + : public ModelBase +{ +public: + UpdateTableSchemaMetadataResponse(); + virtual ~UpdateTableSchemaMetadataResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateTableSchemaMetadataResponse members + + + /// + /// The updated schema metadata + /// + std::map getMetadata() const; + bool metadataIsSet() const; + void unsetMetadata(); + void setMetadata(const std::map& value); + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + std::map m_Metadata; + bool m_MetadataIsSet; + + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableSchemaMetadataResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagRequest.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagRequest.h new file mode 100644 index 000000000..57a109456 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagRequest.h @@ -0,0 +1,130 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateTableTagRequest.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableTagRequest_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableTagRequest_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include "lance_namespace_rest_client/model/Identity.h" +#include +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Identity; + + +class UpdateTableTagRequest + : public ModelBase +{ +public: + UpdateTableTagRequest(); + virtual ~UpdateTableTagRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateTableTagRequest members + + + std::shared_ptr getIdentity() const; + bool identityIsSet() const; + void unsetIdentity(); + void setIdentity(const std::shared_ptr& value); + + /// + /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + /// + std::map getContext() const; + bool contextIsSet() const; + void unsetContext(); + void setContext(const std::map& value); + + std::vector getId() const; + bool idIsSet() const; + void unsetId(); + void setId(const std::vector& value); + + /// + /// Name of the tag to update + /// + utility::string_t getTag() const; + bool tagIsSet() const; + void unsetTag(); + void setTag(const utility::string_t& value); + + /// + /// New version number for the tag to point to + /// + int64_t getVersion() const; + bool versionIsSet() const; + void unsetVersion(); + void setVersion(int64_t value); + + /// + /// Branch to target. When not specified, the main branch is used. + /// + utility::string_t getBranch() const; + bool branchIsSet() const; + void unsetBranch(); + void setBranch(const utility::string_t& value); + + +protected: + std::shared_ptr m_Identity; + bool m_IdentityIsSet; + + std::map m_Context; + bool m_ContextIsSet; + + std::vector m_Id; + bool m_IdIsSet; + + utility::string_t m_Tag; + bool m_TagIsSet; + + int64_t m_Version; + bool m_VersionIsSet; + + utility::string_t m_Branch; + bool m_BranchIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableTagRequest_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagResponse.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagResponse.h new file mode 100644 index 000000000..bff6a0986 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/UpdateTableTagResponse.h @@ -0,0 +1,80 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * UpdateTableTagResponse.h + * + * Response for update tag operation + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableTagResponse_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableTagResponse_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// Response for update tag operation +/// +class UpdateTableTagResponse + : public ModelBase +{ +public: + UpdateTableTagResponse(); + virtual ~UpdateTableTagResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// UpdateTableTagResponse members + + + /// + /// Optional transaction identifier + /// + utility::string_t getTransactionId() const; + bool transactionIdIsSet() const; + void unsetTransaction_id(); + void setTransactionId(const utility::string_t& value); + + +protected: + utility::string_t m_Transaction_id; + bool m_Transaction_idIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_UpdateTableTagResponse_H_ */ diff --git a/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/VersionRange.h b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/VersionRange.h new file mode 100644 index 000000000..d031c9eb4 --- /dev/null +++ b/cpp/lance_namespace_rest_client/include/lance_namespace_rest_client/model/VersionRange.h @@ -0,0 +1,90 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * VersionRange.h + * + * A range of versions to delete (start inclusive, end exclusive). Special values: - `start_version: 0` with `end_version: -1` means ALL versions + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_VersionRange_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_VersionRange_H_ + + +#include "lance_namespace_rest_client/ModelBase.h" + + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +/// +/// A range of versions to delete (start inclusive, end exclusive). Special values: - `start_version: 0` with `end_version: -1` means ALL versions +/// +class VersionRange + : public ModelBase +{ +public: + VersionRange(); + virtual ~VersionRange(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + + ///////////////////////////////////////////// + /// VersionRange members + + + /// + /// Start version of the range (inclusive). Use 0 to start from the first version. + /// + int64_t getStartVersion() const; + bool startVersionIsSet() const; + void unsetStart_version(); + void setStartVersion(int64_t value); + + /// + /// End version of the range (exclusive). Use -1 to indicate all versions up to and including the latest. + /// + int64_t getEndVersion() const; + bool endVersionIsSet() const; + void unsetEnd_version(); + void setEndVersion(int64_t value); + + +protected: + int64_t m_Start_version; + bool m_Start_versionIsSet; + + int64_t m_End_version; + bool m_End_versionIsSet; + +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_VersionRange_H_ */ diff --git a/cpp/lance_namespace_rest_client/src/AnyType.cpp b/cpp/lance_namespace_rest_client/src/AnyType.cpp new file mode 100644 index 000000000..27c4214d2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/AnyType.cpp @@ -0,0 +1,52 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/AnyType.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AnyType::AnyType() { m_value = web::json::value::null(); } + +AnyType::~AnyType() {} + +void AnyType::validate() {} + +web::json::value AnyType::toJson() const { return m_value; } + +bool AnyType::fromJson(const web::json::value &val) { + m_value = val; + m_IsSet = true; + return isSet(); +} + +void AnyType::toMultipart(std::shared_ptr multipart, + const utility::string_t &prefix) const { + if (m_value.is_object()) { + return Object::toMultipart(multipart, prefix); + } + throw std::runtime_error("AnyType::toMultipart: unsupported type"); +} + +bool AnyType::fromMultiPart(std::shared_ptr multipart, + const utility::string_t &prefix) { + if (m_value.is_object()) { + return Object::fromMultiPart(multipart, prefix); + } + return false; +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/ApiClient.cpp b/cpp/lance_namespace_rest_client/src/ApiClient.cpp new file mode 100644 index 000000000..c2fba1575 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/ApiClient.cpp @@ -0,0 +1,208 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/ApiClient.h" +#include "lance_namespace_rest_client/MultipartFormData.h" +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include +#include + +template +utility::string_t toString(const T value) +{ + utility::ostringstream_t out; + out << std::setprecision(std::numeric_limits::digits10) << std::fixed << value; + return out.str(); +} + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +ApiClient::ApiClient(std::shared_ptr configuration ) + : m_Configuration(configuration) +{ +} +ApiClient::~ApiClient() +{ +} + +const ApiClient::ResponseHandlerType& ApiClient::getResponseHandler() const { + return m_ResponseHandler; +} + +void ApiClient::setResponseHandler(const ResponseHandlerType& responseHandler) { + m_ResponseHandler = responseHandler; +} + +std::shared_ptr ApiClient::getConfiguration() const +{ + return m_Configuration; +} +void ApiClient::setConfiguration(std::shared_ptr configuration) +{ + m_Configuration = configuration; +} + + +utility::string_t ApiClient::parameterToString(utility::string_t value) +{ + return value; +} +utility::string_t ApiClient::parameterToString(int64_t value) +{ + std::stringstream valueAsStringStream; + valueAsStringStream << value; + return utility::conversions::to_string_t(valueAsStringStream.str()); +} +utility::string_t ApiClient::parameterToString(int32_t value) +{ + std::stringstream valueAsStringStream; + valueAsStringStream << value; + return utility::conversions::to_string_t(valueAsStringStream.str()); +} + +utility::string_t ApiClient::parameterToString(float value) +{ + return utility::conversions::to_string_t(toString(value)); +} + +utility::string_t ApiClient::parameterToString(double value) +{ + return utility::conversions::to_string_t(toString(value)); +} + +utility::string_t ApiClient::parameterToString(const utility::datetime &value) +{ + return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601)); +} + +utility::string_t ApiClient::parameterToString(bool value) +{ + std::stringstream valueAsStringStream; + valueAsStringStream << std::boolalpha << value; + return utility::conversions::to_string_t(valueAsStringStream.str()); +} + +pplx::task ApiClient::callApi( + const utility::string_t& path, + const utility::string_t& method, + const std::map& queryParams, + const std::shared_ptr postBody, + const std::map& headerParams, + const std::map& formParams, + const std::map>& fileParams, + const utility::string_t& contentType +) const +{ + if (postBody != nullptr && formParams.size() != 0) + { + throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params")); + } + + if (postBody != nullptr && fileParams.size() != 0) + { + throw ApiException(400, utility::conversions::to_string_t("Cannot have body and file params")); + } + + if (fileParams.size() > 0 && contentType != utility::conversions::to_string_t("multipart/form-data")) + { + throw ApiException(400, utility::conversions::to_string_t("Operations with file parameters must be called with multipart/form-data")); + } + + web::http::client::http_client client(m_Configuration->getBaseUrl(), m_Configuration->getHttpConfig()); + + web::http::http_request request; + for (const auto& kvp : headerParams) + { + request.headers().add(kvp.first, kvp.second); + } + + if (fileParams.size() > 0) + { + MultipartFormData uploadData; + for (const auto& kvp : formParams) + { + uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second)); + } + for (const auto& kvp : fileParams) + { + uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second)); + } + std::stringstream data; + uploadData.writeTo(data); + auto bodyString = data.str(); + const auto length = bodyString.size(); + request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, utility::conversions::to_string_t("multipart/form-data; boundary=") + uploadData.getBoundary()); + } + else + { + if (postBody != nullptr) + { + std::stringstream data; + postBody->writeTo(data); + auto bodyString = data.str(); + const auto length = bodyString.size(); + request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, contentType); + } + else + { + if (contentType == utility::conversions::to_string_t("application/json")) + { + web::json::value body_data = web::json::value::object(); + for (auto& kvp : formParams) + { + body_data[kvp.first] = ModelBase::toJson(kvp.second); + } + if (!formParams.empty()) + { + request.set_body(body_data); + } + } + else + { + web::http::uri_builder formData; + for (const auto& kvp : formParams) + { + formData.append_query(kvp.first, kvp.second); + } + if (!formParams.empty()) + { + request.set_body(formData.query(), utility::conversions::to_string_t("application/x-www-form-urlencoded")); + } + } + } + } + + web::http::uri_builder builder(path); + for (const auto& kvp : queryParams) + { + builder.append_query(kvp.first, kvp.second); + } + request.set_request_uri(builder.to_uri()); + request.set_method(method); + if ( !request.headers().has( web::http::header_names::user_agent ) ) + { + request.headers().add( web::http::header_names::user_agent, m_Configuration->getUserAgent() ); + } + + return client.request(request); +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/ApiConfiguration.cpp b/cpp/lance_namespace_rest_client/src/ApiConfiguration.cpp new file mode 100644 index 000000000..cbab89bde --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/ApiConfiguration.cpp @@ -0,0 +1,85 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/ApiConfiguration.h" + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +ApiConfiguration::ApiConfiguration() +{ +} + +ApiConfiguration::~ApiConfiguration() +{ +} + +const web::http::client::http_client_config& ApiConfiguration::getHttpConfig() const +{ + return m_HttpConfig; +} + +void ApiConfiguration::setHttpConfig( web::http::client::http_client_config& value ) +{ + m_HttpConfig = value; +} + +utility::string_t ApiConfiguration::getBaseUrl() const +{ + return m_BaseUrl; +} + +void ApiConfiguration::setBaseUrl( const utility::string_t value ) +{ + m_BaseUrl = value; +} + +utility::string_t ApiConfiguration::getUserAgent() const +{ + return m_UserAgent; +} + +void ApiConfiguration::setUserAgent( const utility::string_t value ) +{ + m_UserAgent = value; +} + +std::map& ApiConfiguration::getDefaultHeaders() +{ + return m_DefaultHeaders; +} + +const std::map& ApiConfiguration::getDefaultHeaders() const +{ + return m_DefaultHeaders; +} + +utility::string_t ApiConfiguration::getApiKey( const utility::string_t& prefix) const +{ + auto result = m_ApiKeys.find(prefix); + if( result != m_ApiKeys.end() ) + { + return result->second; + } + return utility::conversions::to_string_t(""); +} + +void ApiConfiguration::setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey ) +{ + m_ApiKeys[prefix] = apiKey; +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/ApiException.cpp b/cpp/lance_namespace_rest_client/src/ApiException.cpp new file mode 100644 index 000000000..8aa3aa362 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/ApiException.cpp @@ -0,0 +1,53 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/ApiException.h" + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +ApiException::ApiException( int errorCode + , const utility::string_t& message + , std::shared_ptr content /*= nullptr*/ ) + : web::http::http_exception( errorCode, message ) + , m_Content(content) +{ +} +ApiException::ApiException( int errorCode + , const utility::string_t& message + , std::map& headers + , std::shared_ptr content /*= nullptr*/ ) + : web::http::http_exception( errorCode, message ) + , m_Content(content) + , m_Headers(headers) +{ +} + +ApiException::~ApiException() +{ +} + +std::shared_ptr ApiException::getContent() const +{ + return m_Content; +} + +std::map& ApiException::getHeaders() +{ + return m_Headers; +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/HttpContent.cpp b/cpp/lance_namespace_rest_client/src/HttpContent.cpp new file mode 100644 index 000000000..5e0e8c655 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/HttpContent.cpp @@ -0,0 +1,86 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/HttpContent.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +HttpContent::HttpContent() +{ +} + +HttpContent::~HttpContent() +{ +} + +utility::string_t HttpContent::getContentDisposition() const +{ + return m_ContentDisposition; +} + +void HttpContent::setContentDisposition( const utility::string_t & value ) +{ + m_ContentDisposition = value; +} + +utility::string_t HttpContent::getName() const +{ + return m_Name; +} + +void HttpContent::setName( const utility::string_t & value ) +{ + m_Name = value; +} + +utility::string_t HttpContent::getFileName() const +{ + return m_FileName; +} + +void HttpContent::setFileName( const utility::string_t & value ) +{ + m_FileName = value; +} + +utility::string_t HttpContent::getContentType() const +{ + return m_ContentType; +} + +void HttpContent::setContentType( const utility::string_t & value ) +{ + m_ContentType = value; +} + +std::shared_ptr HttpContent::getData() const +{ + return m_Data; +} + +void HttpContent::setData( std::shared_ptr value ) +{ + m_Data = value; +} + +void HttpContent::writeTo( std::ostream& stream ) +{ + m_Data->seekg( 0, m_Data->beg ); + stream << m_Data->rdbuf(); +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/JsonBody.cpp b/cpp/lance_namespace_rest_client/src/JsonBody.cpp new file mode 100644 index 000000000..d01ff4acc --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/JsonBody.cpp @@ -0,0 +1,36 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/JsonBody.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +JsonBody::JsonBody( const web::json::value& json) + : m_Json(json) +{ +} + +JsonBody::~JsonBody() +{ +} + +void JsonBody::writeTo( std::ostream& target ) +{ + m_Json.serialize(target); +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/ModelBase.cpp b/cpp/lance_namespace_rest_client/src/ModelBase.cpp new file mode 100644 index 000000000..7d90f3d31 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/ModelBase.cpp @@ -0,0 +1,665 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/ModelBase.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ModelBase::ModelBase(): m_IsSet(false) +{ +} +ModelBase::~ModelBase() +{ +} +bool ModelBase::isSet() const +{ + return m_IsSet; +} +utility::string_t ModelBase::toString( const bool val ) +{ + utility::stringstream_t ss; + ss << val; + return utility::string_t(ss.str()); +} +utility::string_t ModelBase::toString( const float val ) +{ + utility::stringstream_t ss; + ss << val; + return utility::string_t(ss.str()); +} +utility::string_t ModelBase::toString( const double val ) +{ + utility::stringstream_t ss; + ss << val; + return utility::string_t(ss.str()); +} +utility::string_t ModelBase::toString( const int32_t val ) +{ + utility::stringstream_t ss; + ss << val; + return utility::string_t(ss.str()); +} +utility::string_t ModelBase::toString( const int64_t val ) +{ + utility::stringstream_t ss; + ss << val; + return utility::string_t(ss.str()); +} +utility::string_t ModelBase::toString (const utility::string_t &val ) +{ + utility::stringstream_t ss; + ss << val; + return utility::string_t(ss.str()); +} +utility::string_t ModelBase::toString( const utility::datetime &val ) +{ + return val.to_string(utility::datetime::ISO_8601); +} +utility::string_t ModelBase::toString( const web::json::value &val ) +{ + return val.serialize(); +} +utility::string_t ModelBase::toString( const std::shared_ptr& val ) +{ + utility::stringstream_t ss; + if( val != nullptr ) + { + ss << val->getData(); + } + return utility::string_t(ss.str()); +} +web::json::value ModelBase::toJson(bool value) +{ + return web::json::value::boolean(value); +} +web::json::value ModelBase::toJson( float value ) +{ + return web::json::value::number(value); +} +web::json::value ModelBase::toJson( double value ) +{ + return web::json::value::number(value); +} +web::json::value ModelBase::toJson( int32_t value ) +{ + return web::json::value::number(value); +} +web::json::value ModelBase::toJson( int64_t value ) +{ + return web::json::value::number(value); +} +web::json::value ModelBase::toJson( const utility::string_t& value ) +{ + return web::json::value::string(value); +} +web::json::value ModelBase::toJson( const utility::datetime& value ) +{ + return web::json::value::string(value.to_string(utility::datetime::ISO_8601)); +} +web::json::value ModelBase::toJson( const web::json::value& value ) +{ + return value; +} +web::json::value ModelBase::toJson( const std::shared_ptr& content ) +{ + web::json::value value; + if(content != nullptr) + { + value[utility::conversions::to_string_t("ContentDisposition")] = ModelBase::toJson(content->getContentDisposition()); + value[utility::conversions::to_string_t("ContentType")] = ModelBase::toJson(content->getContentType()); + value[utility::conversions::to_string_t("FileName")] = ModelBase::toJson(content->getFileName()); + value[utility::conversions::to_string_t("InputStream")] = web::json::value::string( ModelBase::toBase64(content->getData()) ); + } + return value; +} +web::json::value ModelBase::toJson( const std::shared_ptr& val ) +{ + web::json::value retVal; + if(val != nullptr) + { + retVal = toJson(*val); + } + return retVal; +} +bool ModelBase::fromString( const utility::string_t& val, bool &outVal ) +{ + utility::stringstream_t ss(val); + bool success = true; + try + { + ss >> outVal; + } + catch (...) + { + success = false; + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, float &outVal ) +{ + utility::stringstream_t ss(val); + bool success = true; + try + { + ss >> outVal; + } + catch (...) + { + int64_t intVal = 0; + success = ModelBase::fromString(val, intVal); + if(success) + { + outVal = static_cast(intVal); + } + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, double &outVal ) +{ + utility::stringstream_t ss(val); + bool success = true; + try + { + ss >> outVal; + } + catch (...) + { + int64_t intVal = 0; + success = ModelBase::fromString(val, intVal); + if(success) + { + outVal = static_cast(intVal); + } + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, int32_t &outVal ) +{ + utility::stringstream_t ss(val); + bool success = true; + try + { + ss >> outVal; + } + catch (...) + { + success = false; + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, int64_t &outVal ) +{ + utility::stringstream_t ss(val); + bool success = true; + try + { + ss >> outVal; + } + catch (...) + { + success = false; + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, utility::string_t &outVal ) +{ + utility::stringstream_t ss(val); + bool success = true; + try + { + ss >> outVal; + } + catch (...) + { + success = false; + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, utility::datetime &outVal ) +{ + bool success = true; + auto dt = utility::datetime::from_string(val, utility::datetime::ISO_8601); + if( dt.is_initialized() ) + { + outVal = dt; + } + else + { + success = false; + } + return success; +} +bool ModelBase::fromString( const utility::string_t& val, web::json::value &outVal ) +{ + outVal = web::json::value::parse(val); + return !outVal.is_null(); +} +bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr& outVal ) +{ + bool ok = true; + if(outVal == nullptr) + { + outVal = std::shared_ptr(new HttpContent()); + } + if(outVal != nullptr) + { + outVal->setData(std::shared_ptr(new std::stringstream(utility::conversions::to_utf8string(val)))); + } + else + { + ok = false; + } + return ok; +} +bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr& outVal ) +{ + bool ok = false; + if(outVal == nullptr) + { + outVal = std::shared_ptr(new utility::datetime()); + } + if( outVal != nullptr ) + { + ok = fromJson(web::json::value::parse(val), *outVal); + } + return ok; +} +bool ModelBase::fromJson( const web::json::value& val, bool & outVal ) +{ + outVal = !val.is_boolean() ? false : val.as_bool(); + return val.is_boolean(); +} +bool ModelBase::fromJson( const web::json::value& val, float & outVal ) +{ + outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits::quiet_NaN(): static_cast(val.as_double()); + return val.is_double() || val.is_integer(); +} +bool ModelBase::fromJson( const web::json::value& val, double & outVal ) +{ + outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits::quiet_NaN(): val.as_double(); + return val.is_double() || val.is_integer(); +} +bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal ) +{ + outVal = !val.is_integer() ? std::numeric_limits::quiet_NaN() : val.as_integer(); + return val.is_integer(); +} +bool ModelBase::fromJson( const web::json::value& val, int64_t & outVal ) +{ + outVal = !val.is_number() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); + return val.is_number(); +} +bool ModelBase::fromJson( const web::json::value& val, utility::string_t & outVal ) +{ + outVal = val.is_string() ? val.as_string() : utility::conversions::to_string_t(""); + return val.is_string(); +} +bool ModelBase::fromJson( const web::json::value& val, utility::datetime & outVal ) +{ + outVal = val.is_null() ? utility::datetime::from_string(utility::conversions::to_string_t("NULL"), utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); + return outVal.is_initialized(); +} +bool ModelBase::fromJson( const web::json::value& val, web::json::value & outVal ) +{ + outVal = val; + return !val.is_null(); +} +bool ModelBase::fromJson( const web::json::value& val, std::shared_ptr& content ) +{ + bool result = false; + if( content != nullptr) + { + result = true; + if(content == nullptr) + { + content = std::shared_ptr(new HttpContent()); + } + if(val.has_field(utility::conversions::to_string_t("ContentDisposition"))) + { + utility::string_t value; + result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("ContentDisposition")), value); + content->setContentDisposition( value ); + } + if(val.has_field(utility::conversions::to_string_t("ContentType"))) + { + utility::string_t value; + result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("ContentType")), value); + content->setContentType( value ); + } + if(val.has_field(utility::conversions::to_string_t("FileName"))) + { + utility::string_t value; + result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("FileName")), value); + content->setFileName( value ); + } + if(val.has_field(utility::conversions::to_string_t("InputStream"))) + { + utility::string_t value; + result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("InputStream")), value); + content->setData( ModelBase::fromBase64( value ) ); + } + } + return result; +} +bool ModelBase::fromJson( const web::json::value& val, std::shared_ptr &outVal ) +{ + bool ok = false; + if(outVal == nullptr) + { + outVal = std::shared_ptr(new utility::datetime()); + } + if( outVal != nullptr ) + { + ok = fromJson(val, *outVal); + } + return ok; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, bool value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; + content->setData( std::shared_ptr( valueAsStringStream ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, float value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; + content->setData( std::shared_ptr( valueAsStringStream ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; + content->setData( std::shared_ptr( valueAsStringStream ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; + content->setData( std::shared_ptr( valueAsStringStream ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; + content->setData( std::shared_ptr( valueAsStringStream) ) ; + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType) +{ + std::shared_ptr content(new HttpContent); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(value) ) ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(value.to_string(utility::datetime::ISO_8601) ) ) ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const web::json::value& value, const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(value.serialize()) ) ) ); + return content; +} +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::shared_ptr& value ) +{ + std::shared_ptr content( new HttpContent ); + if( value != nullptr ) + { + content->setName( name ); + content->setContentDisposition( value->getContentDisposition() ); + content->setContentType( value->getContentType() ); + content->setData( value->getData() ); + content->setFileName( value->getFileName() ); + } + return content; +} +std::shared_ptr ModelBase::toHttpContent(const utility::string_t& name, const std::shared_ptr& value , const utility::string_t& contentType ) +{ + std::shared_ptr content( new HttpContent ); + if (value != nullptr ) + { + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string( toJson(*value).serialize() ) ) ) ); + } + return content; +} +bool ModelBase::fromHttpContent(std::shared_ptr val, bool & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +bool ModelBase::fromHttpContent(std::shared_ptr val, float & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +bool ModelBase::fromHttpContent(std::shared_ptr val, double & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +bool ModelBase::fromHttpContent(std::shared_ptr val, int32_t & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +bool ModelBase::fromHttpContent(std::shared_ptr val, int64_t & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +bool ModelBase::fromHttpContent(std::shared_ptr val, utility::string_t & outVal ) +{ + if( val == nullptr ) return false; + std::shared_ptr data = val->getData(); + data->seekg( 0, data->beg ); + + std::string str((std::istreambuf_iterator(*data.get())), + std::istreambuf_iterator()); + outVal = utility::conversions::to_string_t(str); + return true; +} +bool ModelBase::fromHttpContent(std::shared_ptr val, utility::datetime & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + outVal = utility::datetime::from_string(str, utility::datetime::ISO_8601); + return true; +} +bool ModelBase::fromHttpContent(std::shared_ptr val, web::json::value & outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +bool ModelBase::fromHttpContent(std::shared_ptr val, std::shared_ptr& outVal ) +{ + utility::string_t str; + if( val == nullptr ) return false; + if( outVal == nullptr ) + { + outVal = std::shared_ptr(new HttpContent()); + } + ModelBase::fromHttpContent(val, str); + return fromString(str, outVal); +} +// base64 encoding/decoding based on : https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64#C.2B.2B +const static char Base64Chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +const static char Base64PadChar = '='; +utility::string_t ModelBase::toBase64( utility::string_t value ) +{ + std::shared_ptr source( new std::stringstream( utility::conversions::to_utf8string(value) ) ); + return ModelBase::toBase64(source); +} +utility::string_t ModelBase::toBase64( std::shared_ptr value ) +{ + value->seekg( 0, value->end ); + size_t length = value->tellg(); + value->seekg( 0, value->beg ); + utility::string_t base64; + base64.reserve( ((length / 3) + (length % 3 > 0)) * 4 ); + char read[3] = { 0 }; + uint32_t temp; + for ( size_t idx = 0; idx < length / 3; idx++ ) + { + value->read( read, 3 ); + temp = (read[0]) << 16; + temp += (read[1]) << 8; + temp += (read[2]); + base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] ); + base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] ); + base64.append( 1, Base64Chars[(temp & 0x00000FC0) >> 6] ); + base64.append( 1, Base64Chars[(temp & 0x0000003F)] ); + } + switch ( length % 3 ) + { + case 1: + value->read( read, 1 ); + temp = read[0] << 16; + base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] ); + base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] ); + base64.append( 2, Base64PadChar ); + break; + case 2: + value->read( read, 2 ); + temp = read[0] << 16; + temp += read[1] << 8; + base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] ); + base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] ); + base64.append( 1, Base64Chars[(temp & 0x00000FC0) >> 6] ); + base64.append( 1, Base64PadChar ); + break; + } + return base64; +} +std::shared_ptr ModelBase::fromBase64( const utility::string_t& encoded ) +{ + std::shared_ptr result(new std::stringstream); + + char outBuf[3] = { 0 }; + uint32_t temp = 0; + + utility::string_t::const_iterator cursor = encoded.begin(); + while ( cursor < encoded.end() ) + { + for ( size_t quantumPosition = 0; quantumPosition < 4; quantumPosition++ ) + { + temp <<= 6; + if ( *cursor >= 0x41 && *cursor <= 0x5A ) + { + temp |= *cursor - 0x41; + } + else if ( *cursor >= 0x61 && *cursor <= 0x7A ) + { + temp |= *cursor - 0x47; + } + else if ( *cursor >= 0x30 && *cursor <= 0x39 ) + { + temp |= *cursor + 0x04; + } + else if ( *cursor == 0x2B ) + { + temp |= 0x3E; //change to 0x2D for URL alphabet + } + else if ( *cursor == 0x2F ) + { + temp |= 0x3F; //change to 0x5F for URL alphabet + } + else if ( *cursor == Base64PadChar ) //pad + { + switch ( encoded.end() - cursor ) + { + case 1: //One pad character + outBuf[0] = (temp >> 16) & 0x000000FF; + outBuf[1] = (temp >> 8) & 0x000000FF; + result->write( outBuf, 2 ); + return result; + case 2: //Two pad characters + outBuf[0] = (temp >> 10) & 0x000000FF; + result->write( outBuf, 1 ); + return result; + default: + throw web::json::json_exception( utility::conversions::to_string_t( "Invalid Padding in Base 64!" ).c_str() ); + } + } + else + { + throw web::json::json_exception( utility::conversions::to_string_t( "Non-Valid Character in Base 64!" ).c_str() ); + } + ++cursor; + } + + outBuf[0] = (temp >> 16) & 0x000000FF; + outBuf[1] = (temp >> 8) & 0x000000FF; + outBuf[2] = (temp) & 0x000000FF; + result->write( outBuf, 3 ); + } + + return result; +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/MultipartFormData.cpp b/cpp/lance_namespace_rest_client/src/MultipartFormData.cpp new file mode 100644 index 000000000..29c6dc4b2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/MultipartFormData.cpp @@ -0,0 +1,112 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/MultipartFormData.h" +#include "lance_namespace_rest_client/ModelBase.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +MultipartFormData::MultipartFormData() +{ + utility::stringstream_t uuidString; + uuidString << boost::uuids::random_generator()(); + m_Boundary = uuidString.str(); +} + +MultipartFormData::MultipartFormData(const utility::string_t& boundary) + : m_Boundary(boundary) +{ + +} + +MultipartFormData::~MultipartFormData() +{ +} + +utility::string_t MultipartFormData::getBoundary() +{ + return m_Boundary; +} + +void MultipartFormData::add( std::shared_ptr content ) +{ + m_Contents.push_back( content ); + m_ContentLookup[content->getName()] = content; +} + +bool MultipartFormData::hasContent(const utility::string_t& name) const +{ + return m_ContentLookup.find(name) != m_ContentLookup.end(); +} + +std::shared_ptr MultipartFormData::getContent(const utility::string_t& name) const +{ + auto result = m_ContentLookup.find(name); + if(result == m_ContentLookup.end()) + { + return std::shared_ptr(nullptr); + } + return result->second; +} + +void MultipartFormData::writeTo( std::ostream& target ) +{ + for ( size_t i = 0; i < m_Contents.size(); i++ ) + { + std::shared_ptr content = m_Contents[i]; + + // boundary + target << "\r\n" << "--" << utility::conversions::to_utf8string( m_Boundary ) << "\r\n"; + + // headers + target << "Content-Disposition: " << utility::conversions::to_utf8string( content->getContentDisposition() ); + if ( content->getName().size() > 0 ) + { + target << "; name=\"" << utility::conversions::to_utf8string( content->getName() ) << "\""; + } + if ( content->getFileName().size() > 0 ) + { + target << "; filename=\"" << utility::conversions::to_utf8string( content->getFileName() ) << "\""; + } + target << "\r\n"; + + if ( content->getContentType().size() > 0 ) + { + target << "Content-Type: " << utility::conversions::to_utf8string( content->getContentType() ) << "\r\n"; + } + + target << "\r\n"; + + // body + std::shared_ptr data = content->getData(); + + data->seekg( 0, data->end ); + std::vector dataBytes( data->tellg() ); + + data->seekg( 0, data->beg ); + data->read( &dataBytes[0], dataBytes.size() ); + + std::copy( dataBytes.begin(), dataBytes.end(), std::ostreambuf_iterator( target ) ); + } + + target << "\r\n--" << utility::conversions::to_utf8string( m_Boundary ) << "--\r\n"; +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/Object.cpp b/cpp/lance_namespace_rest_client/src/Object.cpp new file mode 100644 index 000000000..0e9a9d5b9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/Object.cpp @@ -0,0 +1,91 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "lance_namespace_rest_client/Object.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +Object::Object() +{ + m_object = web::json::value::object(); +} + +Object::~Object() +{ +} + +void Object::validate() +{ + +} + +web::json::value Object::toJson() const +{ + return m_object; +} + +bool Object::fromJson(const web::json::value& val) +{ + if (val.is_object()) + { + m_object = val; + m_IsSet = true; + } + return isSet(); +} + +void Object::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) + { + namePrefix += utility::conversions::to_string_t("."); + } + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("object"), m_object)); +} + +bool Object::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) + { + namePrefix += utility::conversions::to_string_t("."); + } + + if( ModelBase::fromHttpContent(multipart->getContent(namePrefix + utility::conversions::to_string_t("object")), m_object ) ) + { + m_IsSet = true; + } + return isSet(); +} + +web::json::value Object::getValue(const utility::string_t& key) const +{ + return m_object.at(key); +} + + +void Object::setValue(const utility::string_t& key, const web::json::value& value) +{ + if( !value.is_null() ) + { + m_object[key] = value; + m_IsSet = true; + } +} + +} +} +} +} diff --git a/cpp/lance_namespace_rest_client/src/api/BranchApi.cpp b/cpp/lance_namespace_rest_client/src/api/BranchApi.cpp new file mode 100644 index 000000000..c5ebde67e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/BranchApi.cpp @@ -0,0 +1,511 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/BranchApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +BranchApi::BranchApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +BranchApi::~BranchApi() +{ +} + +pplx::task> BranchApi::createTableBranch(utility::string_t id, std::shared_ptr createTableBranchRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableBranchRequest' is set + if (createTableBranchRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableBranchRequest' when calling BranchApi->createTableBranch")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("BranchApi->createTableBranch does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableBranchRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableBranchRequest.get()) + { + createTableBranchRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableBranchRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("BranchApi->createTableBranch does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableBranch: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableBranch: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableBranchResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableBranch: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> BranchApi::deleteTableBranch(utility::string_t id, std::shared_ptr deleteTableBranchRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteTableBranchRequest' is set + if (deleteTableBranchRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteTableBranchRequest' when calling BranchApi->deleteTableBranch")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("BranchApi->deleteTableBranch does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteTableBranchRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteTableBranchRequest.get()) + { + deleteTableBranchRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteTableBranchRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("BranchApi->deleteTableBranch does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteTableBranch: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableBranch: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteTableBranchResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableBranch: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> BranchApi::listTableBranches(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("BranchApi->listTableBranches does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("BranchApi->listTableBranches does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableBranches: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableBranches: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableBranchesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableBranches: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/DataApi.cpp b/cpp/lance_namespace_rest_client/src/api/DataApi.cpp new file mode 100644 index 000000000..dca6a43c5 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/DataApi.cpp @@ -0,0 +1,2157 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/DataApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +DataApi::DataApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +DataApi::~DataApi() +{ +} + +pplx::task> DataApi::alterTableAddColumns(utility::string_t id, std::shared_ptr alterTableAddColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableAddColumnsRequest' is set + if (alterTableAddColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableAddColumnsRequest' when calling DataApi->alterTableAddColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/add_columns"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->alterTableAddColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableAddColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableAddColumnsRequest.get()) + { + alterTableAddColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableAddColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->alterTableAddColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableAddColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAddColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableAddColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAddColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::alterTableBackfillColumns(utility::string_t id, std::shared_ptr alterTableBackfillColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableBackfillColumnsRequest' is set + if (alterTableBackfillColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableBackfillColumnsRequest' when calling DataApi->alterTableBackfillColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/backfill_column"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->alterTableBackfillColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableBackfillColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableBackfillColumnsRequest.get()) + { + alterTableBackfillColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableBackfillColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->alterTableBackfillColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableBackfillColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableBackfillColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableBackfillColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableBackfillColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task DataApi::analyzeTableQueryPlan(utility::string_t id, std::shared_ptr analyzeTableQueryPlanRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'analyzeTableQueryPlanRequest' is set + if (analyzeTableQueryPlanRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'analyzeTableQueryPlanRequest' when calling DataApi->analyzeTableQueryPlan")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/analyze_plan"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + // plain text + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("text/plain")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->analyzeTableQueryPlan does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(analyzeTableQueryPlanRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(analyzeTableQueryPlanRequest.get()) + { + analyzeTableQueryPlanRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("analyzeTableQueryPlanRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->analyzeTableQueryPlan does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling analyzeTableQueryPlan: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling analyzeTableQueryPlan: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + utility::string_t localVarResult(utility::conversions::to_string_t("")); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + else if(localVarResponseHttpContentType == utility::conversions::to_string_t("text/plain")) + { + localVarResult = localVarResponse; + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling analyzeTableQueryPlan: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task DataApi::countTableRows(utility::string_t id, std::shared_ptr countTableRowsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'countTableRowsRequest' is set + if (countTableRowsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'countTableRowsRequest' when calling DataApi->countTableRows")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/count_rows"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->countTableRows does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(countTableRowsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(countTableRowsRequest.get()) + { + countTableRowsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("countTableRowsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->countTableRows does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling countTableRows: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling countTableRows: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + int64_t localVarResult(0L); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling countTableRows: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::createMaterializedView(utility::string_t id, std::shared_ptr createMaterializedViewRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createMaterializedViewRequest' is set + if (createMaterializedViewRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createMaterializedViewRequest' when calling DataApi->createMaterializedView")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/materialized_view/{id}/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->createMaterializedView does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createMaterializedViewRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createMaterializedViewRequest.get()) + { + createMaterializedViewRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createMaterializedViewRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->createMaterializedView does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createMaterializedView: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createMaterializedView: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateMaterializedViewResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createMaterializedView: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::createTable(utility::string_t id, std::shared_ptr body, boost::optional delimiter, boost::optional mode, boost::optional properties, boost::optional storageOptions) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->createTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.stream") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (mode) + { + localVarQueryParams[utility::conversions::to_string_t("mode")] = ApiClient::parameterToString(*mode); + } + if (properties) + { + localVarQueryParams[utility::conversions::to_string_t("properties")] = ApiClient::parameterToString(*properties); + } + if (storageOptions) + { + localVarQueryParams[utility::conversions::to_string_t("storage_options")] = ApiClient::parameterToString(*storageOptions); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(body); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body)); + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->createTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::deleteFromTable(utility::string_t id, std::shared_ptr deleteFromTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteFromTableRequest' is set + if (deleteFromTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteFromTableRequest' when calling DataApi->deleteFromTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->deleteFromTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteFromTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteFromTableRequest.get()) + { + deleteFromTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteFromTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->deleteFromTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteFromTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteFromTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteFromTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteFromTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task DataApi::explainTableQueryPlan(utility::string_t id, std::shared_ptr explainTableQueryPlanRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'explainTableQueryPlanRequest' is set + if (explainTableQueryPlanRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'explainTableQueryPlanRequest' when calling DataApi->explainTableQueryPlan")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/explain_plan"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + // plain text + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("text/plain")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->explainTableQueryPlan does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(explainTableQueryPlanRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(explainTableQueryPlanRequest.get()) + { + explainTableQueryPlanRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("explainTableQueryPlanRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->explainTableQueryPlan does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling explainTableQueryPlan: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling explainTableQueryPlan: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + utility::string_t localVarResult(utility::conversions::to_string_t("")); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + else if(localVarResponseHttpContentType == utility::conversions::to_string_t("text/plain")) + { + localVarResult = localVarResponse; + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling explainTableQueryPlan: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::insertIntoTable(utility::string_t id, std::shared_ptr body, boost::optional delimiter, boost::optional branch, boost::optional mode) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/insert"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->insertIntoTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.stream") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + if (mode) + { + localVarQueryParams[utility::conversions::to_string_t("mode")] = ApiClient::parameterToString(*mode); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(body); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body)); + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->insertIntoTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling insertIntoTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling insertIntoTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new InsertIntoTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling insertIntoTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::mergeInsertIntoTable(utility::string_t id, utility::string_t on, std::shared_ptr body, boost::optional delimiter, boost::optional branch, boost::optional whenMatchedUpdateAll, boost::optional whenMatchedUpdateAllFilt, boost::optional whenNotMatchedInsertAll, boost::optional whenNotMatchedBySourceDelete, boost::optional whenNotMatchedBySourceDeleteFilt, boost::optional timeout, boost::optional useIndex) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/merge_insert"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->mergeInsertIntoTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.stream") ); + + { + localVarQueryParams[utility::conversions::to_string_t("on")] = ApiClient::parameterToString(on); + } + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + if (whenMatchedUpdateAll) + { + localVarQueryParams[utility::conversions::to_string_t("when_matched_update_all")] = ApiClient::parameterToString(*whenMatchedUpdateAll); + } + if (whenMatchedUpdateAllFilt) + { + localVarQueryParams[utility::conversions::to_string_t("when_matched_update_all_filt")] = ApiClient::parameterToString(*whenMatchedUpdateAllFilt); + } + if (whenNotMatchedInsertAll) + { + localVarQueryParams[utility::conversions::to_string_t("when_not_matched_insert_all")] = ApiClient::parameterToString(*whenNotMatchedInsertAll); + } + if (whenNotMatchedBySourceDelete) + { + localVarQueryParams[utility::conversions::to_string_t("when_not_matched_by_source_delete")] = ApiClient::parameterToString(*whenNotMatchedBySourceDelete); + } + if (whenNotMatchedBySourceDeleteFilt) + { + localVarQueryParams[utility::conversions::to_string_t("when_not_matched_by_source_delete_filt")] = ApiClient::parameterToString(*whenNotMatchedBySourceDeleteFilt); + } + if (timeout) + { + localVarQueryParams[utility::conversions::to_string_t("timeout")] = ApiClient::parameterToString(*timeout); + } + if (useIndex) + { + localVarQueryParams[utility::conversions::to_string_t("use_index")] = ApiClient::parameterToString(*useIndex); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(body); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body)); + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->mergeInsertIntoTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling mergeInsertIntoTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling mergeInsertIntoTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new MergeInsertIntoTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling mergeInsertIntoTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::queryTable(utility::string_t id, std::shared_ptr queryTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'queryTableRequest' is set + if (queryTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'queryTableRequest' when calling DataApi->queryTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/query"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.file") ); + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + //It's going to be binary, so just use the first one. + localVarResponseHttpContentType = *localVarResponseHttpContentTypes.begin(); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(queryTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(queryTableRequest.get()) + { + queryTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("queryTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->queryTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling queryTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling queryTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_vector(); + }) + .then([=, this](std::vector localVarResponse) + { + std::shared_ptr localVarResult = std::make_shared(); + std::shared_ptr stream = std::make_shared(std::string(localVarResponse.begin(), localVarResponse.end())); + localVarResult->setData(stream); + return localVarResult; + }); +} +pplx::task> DataApi::refreshMaterializedView(utility::string_t id, boost::optional delimiter, boost::optional> refreshMaterializedViewRequest) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/materialized_view/{id}/refresh"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->refreshMaterializedView does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + if (refreshMaterializedViewRequest) + localVarJson = ModelBase::toJson(*refreshMaterializedViewRequest); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(refreshMaterializedViewRequest && (*refreshMaterializedViewRequest).get()) + { + (*refreshMaterializedViewRequest)->toMultipart(localVarMultipart, utility::conversions::to_string_t("refreshMaterializedViewRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->refreshMaterializedView does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling refreshMaterializedView: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling refreshMaterializedView: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RefreshMaterializedViewResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling refreshMaterializedView: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> DataApi::updateTable(utility::string_t id, std::shared_ptr updateTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateTableRequest' is set + if (updateTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateTableRequest' when calling DataApi->updateTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("DataApi->updateTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateTableRequest.get()) + { + updateTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("DataApi->updateTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTable: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/IndexApi.cpp b/cpp/lance_namespace_rest_client/src/api/IndexApi.cpp new file mode 100644 index 000000000..b290f8cee --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/IndexApi.cpp @@ -0,0 +1,831 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/IndexApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +IndexApi::IndexApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +IndexApi::~IndexApi() +{ +} + +pplx::task> IndexApi::createTableIndex(utility::string_t id, std::shared_ptr createTableIndexRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableIndexRequest' when calling IndexApi->createTableIndex")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create_index"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("IndexApi->createTableIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableIndexRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableIndexRequest.get()) + { + createTableIndexRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableIndexRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("IndexApi->createTableIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> IndexApi::createTableScalarIndex(utility::string_t id, std::shared_ptr createTableIndexRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableIndexRequest' when calling IndexApi->createTableScalarIndex")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create_scalar_index"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("IndexApi->createTableScalarIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableIndexRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableIndexRequest.get()) + { + createTableIndexRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableIndexRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("IndexApi->createTableScalarIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableScalarIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableScalarIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableScalarIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableScalarIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> IndexApi::describeTableIndexStats(utility::string_t id, utility::string_t indexName, std::shared_ptr describeTableIndexStatsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTableIndexStatsRequest' is set + if (describeTableIndexStatsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableIndexStatsRequest' when calling IndexApi->describeTableIndexStats")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/{index_name}/stats"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("index_name") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(indexName))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("IndexApi->describeTableIndexStats does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableIndexStatsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableIndexStatsRequest.get()) + { + describeTableIndexStatsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableIndexStatsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("IndexApi->describeTableIndexStats does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTableIndexStats: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableIndexStats: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableIndexStatsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableIndexStats: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> IndexApi::dropTableIndex(utility::string_t id, utility::string_t indexName, boost::optional delimiter, boost::optional branch) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/{index_name}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("index_name") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(indexName))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("IndexApi->dropTableIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("IndexApi->dropTableIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropTableIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTableIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropTableIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTableIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> IndexApi::listTableIndices(utility::string_t id, std::shared_ptr listTableIndicesRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'listTableIndicesRequest' is set + if (listTableIndicesRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'listTableIndicesRequest' when calling IndexApi->listTableIndices")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("IndexApi->listTableIndices does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(listTableIndicesRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(listTableIndicesRequest.get()) + { + listTableIndicesRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("listTableIndicesRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("IndexApi->listTableIndices does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableIndices: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableIndices: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableIndicesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableIndices: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/MaterializedViewApi.cpp b/cpp/lance_namespace_rest_client/src/api/MaterializedViewApi.cpp new file mode 100644 index 000000000..abd2a31f5 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/MaterializedViewApi.cpp @@ -0,0 +1,359 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/MaterializedViewApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +MaterializedViewApi::MaterializedViewApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +MaterializedViewApi::~MaterializedViewApi() +{ +} + +pplx::task> MaterializedViewApi::createMaterializedView(utility::string_t id, std::shared_ptr createMaterializedViewRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createMaterializedViewRequest' is set + if (createMaterializedViewRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createMaterializedViewRequest' when calling MaterializedViewApi->createMaterializedView")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/materialized_view/{id}/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MaterializedViewApi->createMaterializedView does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createMaterializedViewRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createMaterializedViewRequest.get()) + { + createMaterializedViewRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createMaterializedViewRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MaterializedViewApi->createMaterializedView does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createMaterializedView: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createMaterializedView: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateMaterializedViewResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createMaterializedView: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MaterializedViewApi::refreshMaterializedView(utility::string_t id, boost::optional delimiter, boost::optional> refreshMaterializedViewRequest) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/materialized_view/{id}/refresh"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MaterializedViewApi->refreshMaterializedView does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + if (refreshMaterializedViewRequest) + localVarJson = ModelBase::toJson(*refreshMaterializedViewRequest); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(refreshMaterializedViewRequest && (*refreshMaterializedViewRequest).get()) + { + (*refreshMaterializedViewRequest)->toMultipart(localVarMultipart, utility::conversions::to_string_t("refreshMaterializedViewRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MaterializedViewApi->refreshMaterializedView does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling refreshMaterializedView: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling refreshMaterializedView: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RefreshMaterializedViewResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling refreshMaterializedView: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/MetadataApi.cpp b/cpp/lance_namespace_rest_client/src/api/MetadataApi.cpp new file mode 100644 index 000000000..7f847f54d --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/MetadataApi.cpp @@ -0,0 +1,6362 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/MetadataApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +MetadataApi::MetadataApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +MetadataApi::~MetadataApi() +{ +} + +pplx::task> MetadataApi::alterTableAlterColumns(utility::string_t id, std::shared_ptr alterTableAlterColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableAlterColumnsRequest' is set + if (alterTableAlterColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableAlterColumnsRequest' when calling MetadataApi->alterTableAlterColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/alter_columns"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->alterTableAlterColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableAlterColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableAlterColumnsRequest.get()) + { + alterTableAlterColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableAlterColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->alterTableAlterColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableAlterColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAlterColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableAlterColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAlterColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::alterTableDropColumns(utility::string_t id, std::shared_ptr alterTableDropColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableDropColumnsRequest' is set + if (alterTableDropColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableDropColumnsRequest' when calling MetadataApi->alterTableDropColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/drop_columns"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->alterTableDropColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableDropColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableDropColumnsRequest.get()) + { + alterTableDropColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableDropColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->alterTableDropColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableDropColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableDropColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableDropColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableDropColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::alterTransaction(utility::string_t id, std::shared_ptr alterTransactionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTransactionRequest' is set + if (alterTransactionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTransactionRequest' when calling MetadataApi->alterTransaction")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/transaction/{id}/alter"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->alterTransaction does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTransactionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTransactionRequest.get()) + { + alterTransactionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTransactionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->alterTransaction does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTransaction: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTransaction: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTransactionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTransaction: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::batchCommitTables(std::shared_ptr batchCommitTablesRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchCommitTablesRequest' is set + if (batchCommitTablesRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchCommitTablesRequest' when calling MetadataApi->batchCommitTables")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/batch-commit"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->batchCommitTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchCommitTablesRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchCommitTablesRequest.get()) + { + batchCommitTablesRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchCommitTablesRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->batchCommitTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchCommitTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCommitTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchCommitTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCommitTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::batchCreateTableVersions(std::shared_ptr batchCreateTableVersionsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchCreateTableVersionsRequest' is set + if (batchCreateTableVersionsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchCreateTableVersionsRequest' when calling MetadataApi->batchCreateTableVersions")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/version/batch-create"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->batchCreateTableVersions does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchCreateTableVersionsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchCreateTableVersionsRequest.get()) + { + batchCreateTableVersionsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchCreateTableVersionsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->batchCreateTableVersions does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchCreateTableVersions: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCreateTableVersions: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchCreateTableVersionsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCreateTableVersions: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::batchDeleteTableVersions(utility::string_t id, std::shared_ptr batchDeleteTableVersionsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchDeleteTableVersionsRequest' is set + if (batchDeleteTableVersionsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchDeleteTableVersionsRequest' when calling MetadataApi->batchDeleteTableVersions")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->batchDeleteTableVersions does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchDeleteTableVersionsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchDeleteTableVersionsRequest.get()) + { + batchDeleteTableVersionsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchDeleteTableVersionsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->batchDeleteTableVersions does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchDeleteTableVersions: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchDeleteTableVersions: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchDeleteTableVersionsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchDeleteTableVersions: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::createNamespace(utility::string_t id, std::shared_ptr createNamespaceRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createNamespaceRequest' is set + if (createNamespaceRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createNamespaceRequest' when calling MetadataApi->createNamespace")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->createNamespace does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createNamespaceRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createNamespaceRequest.get()) + { + createNamespaceRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createNamespaceRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->createNamespace does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createNamespace: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createNamespace: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateNamespaceResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createNamespace: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::createTableBranch(utility::string_t id, std::shared_ptr createTableBranchRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableBranchRequest' is set + if (createTableBranchRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableBranchRequest' when calling MetadataApi->createTableBranch")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->createTableBranch does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableBranchRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableBranchRequest.get()) + { + createTableBranchRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableBranchRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->createTableBranch does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableBranch: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableBranch: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableBranchResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableBranch: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::createTableIndex(utility::string_t id, std::shared_ptr createTableIndexRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableIndexRequest' when calling MetadataApi->createTableIndex")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create_index"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->createTableIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableIndexRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableIndexRequest.get()) + { + createTableIndexRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableIndexRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->createTableIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::createTableScalarIndex(utility::string_t id, std::shared_ptr createTableIndexRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableIndexRequest' when calling MetadataApi->createTableScalarIndex")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create_scalar_index"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->createTableScalarIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableIndexRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableIndexRequest.get()) + { + createTableIndexRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableIndexRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->createTableScalarIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableScalarIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableScalarIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableScalarIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableScalarIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::createTableTag(utility::string_t id, std::shared_ptr createTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableTagRequest' is set + if (createTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableTagRequest' when calling MetadataApi->createTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->createTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableTagRequest.get()) + { + createTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->createTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableTag: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::createTableVersion(utility::string_t id, std::shared_ptr createTableVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableVersionRequest' is set + if (createTableVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableVersionRequest' when calling MetadataApi->createTableVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->createTableVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableVersionRequest.get()) + { + createTableVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->createTableVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::declareTable(utility::string_t id, std::shared_ptr declareTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'declareTableRequest' is set + if (declareTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'declareTableRequest' when calling MetadataApi->declareTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/declare"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->declareTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(declareTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(declareTableRequest.get()) + { + declareTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("declareTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->declareTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling declareTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling declareTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeclareTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling declareTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::deleteTableBranch(utility::string_t id, std::shared_ptr deleteTableBranchRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteTableBranchRequest' is set + if (deleteTableBranchRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteTableBranchRequest' when calling MetadataApi->deleteTableBranch")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->deleteTableBranch does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteTableBranchRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteTableBranchRequest.get()) + { + deleteTableBranchRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteTableBranchRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->deleteTableBranch does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteTableBranch: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableBranch: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteTableBranchResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableBranch: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::deleteTableTag(utility::string_t id, std::shared_ptr deleteTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteTableTagRequest' is set + if (deleteTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteTableTagRequest' when calling MetadataApi->deleteTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->deleteTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteTableTagRequest.get()) + { + deleteTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->deleteTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableTag: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::deregisterTable(utility::string_t id, std::shared_ptr deregisterTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deregisterTableRequest' is set + if (deregisterTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deregisterTableRequest' when calling MetadataApi->deregisterTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/deregister"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->deregisterTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deregisterTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deregisterTableRequest.get()) + { + deregisterTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deregisterTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->deregisterTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deregisterTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deregisterTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeregisterTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deregisterTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::describeNamespace(utility::string_t id, std::shared_ptr describeNamespaceRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeNamespaceRequest' is set + if (describeNamespaceRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeNamespaceRequest' when calling MetadataApi->describeNamespace")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->describeNamespace does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeNamespaceRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeNamespaceRequest.get()) + { + describeNamespaceRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeNamespaceRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->describeNamespace does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeNamespace: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeNamespace: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeNamespaceResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeNamespace: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::describeTable(utility::string_t id, std::shared_ptr describeTableRequest, boost::optional delimiter, boost::optional withTableUri, boost::optional loadDetailedMetadata, boost::optional checkDeclared) const +{ + + // verify the required parameter 'describeTableRequest' is set + if (describeTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableRequest' when calling MetadataApi->describeTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->describeTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (withTableUri) + { + localVarQueryParams[utility::conversions::to_string_t("with_table_uri")] = ApiClient::parameterToString(*withTableUri); + } + if (loadDetailedMetadata) + { + localVarQueryParams[utility::conversions::to_string_t("load_detailed_metadata")] = ApiClient::parameterToString(*loadDetailedMetadata); + } + if (checkDeclared) + { + localVarQueryParams[utility::conversions::to_string_t("check_declared")] = ApiClient::parameterToString(*checkDeclared); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableRequest.get()) + { + describeTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->describeTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::describeTableIndexStats(utility::string_t id, utility::string_t indexName, std::shared_ptr describeTableIndexStatsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTableIndexStatsRequest' is set + if (describeTableIndexStatsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableIndexStatsRequest' when calling MetadataApi->describeTableIndexStats")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/{index_name}/stats"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("index_name") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(indexName))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->describeTableIndexStats does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableIndexStatsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableIndexStatsRequest.get()) + { + describeTableIndexStatsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableIndexStatsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->describeTableIndexStats does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTableIndexStats: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableIndexStats: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableIndexStatsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableIndexStats: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::describeTableVersion(utility::string_t id, std::shared_ptr describeTableVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTableVersionRequest' is set + if (describeTableVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableVersionRequest' when calling MetadataApi->describeTableVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->describeTableVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableVersionRequest.get()) + { + describeTableVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->describeTableVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTableVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::describeTransaction(utility::string_t id, std::shared_ptr describeTransactionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTransactionRequest' is set + if (describeTransactionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTransactionRequest' when calling MetadataApi->describeTransaction")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/transaction/{id}/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->describeTransaction does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTransactionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTransactionRequest.get()) + { + describeTransactionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTransactionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->describeTransaction does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTransaction: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTransaction: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTransactionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTransaction: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::dropNamespace(utility::string_t id, std::shared_ptr dropNamespaceRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'dropNamespaceRequest' is set + if (dropNamespaceRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'dropNamespaceRequest' when calling MetadataApi->dropNamespace")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->dropNamespace does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(dropNamespaceRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(dropNamespaceRequest.get()) + { + dropNamespaceRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("dropNamespaceRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->dropNamespace does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropNamespace: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropNamespace: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropNamespaceResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropNamespace: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::dropTable(utility::string_t id, boost::optional delimiter) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->dropTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->dropTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::dropTableIndex(utility::string_t id, utility::string_t indexName, boost::optional delimiter, boost::optional branch) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/{index_name}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("index_name") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(indexName))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->dropTableIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->dropTableIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropTableIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTableIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropTableIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTableIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::getTableStats(utility::string_t id, std::shared_ptr getTableStatsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'getTableStatsRequest' is set + if (getTableStatsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'getTableStatsRequest' when calling MetadataApi->getTableStats")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/stats"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->getTableStats does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(getTableStatsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(getTableStatsRequest.get()) + { + getTableStatsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("getTableStatsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->getTableStats does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling getTableStats: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableStats: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new GetTableStatsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableStats: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::getTableTagVersion(utility::string_t id, std::shared_ptr getTableTagVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'getTableTagVersionRequest' is set + if (getTableTagVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'getTableTagVersionRequest' when calling MetadataApi->getTableTagVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/version"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->getTableTagVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(getTableTagVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(getTableTagVersionRequest.get()) + { + getTableTagVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("getTableTagVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->getTableTagVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling getTableTagVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableTagVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new GetTableTagVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableTagVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::listNamespaces(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->listNamespaces does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->listNamespaces does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listNamespaces: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listNamespaces: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListNamespacesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listNamespaces: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::listTableBranches(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->listTableBranches does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->listTableBranches does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableBranches: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableBranches: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableBranchesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableBranches: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::listTableIndices(utility::string_t id, std::shared_ptr listTableIndicesRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'listTableIndicesRequest' is set + if (listTableIndicesRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'listTableIndicesRequest' when calling MetadataApi->listTableIndices")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->listTableIndices does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(listTableIndicesRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(listTableIndicesRequest.get()) + { + listTableIndicesRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("listTableIndicesRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->listTableIndices does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableIndices: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableIndices: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableIndicesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableIndices: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::listTableTags(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->listTableTags does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->listTableTags does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableTags: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableTags: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableTagsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableTags: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::listTableVersions(utility::string_t id, boost::optional delimiter, boost::optional branch, boost::optional pageToken, boost::optional limit, boost::optional descending) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->listTableVersions does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + if (descending) + { + localVarQueryParams[utility::conversions::to_string_t("descending")] = ApiClient::parameterToString(*descending); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->listTableVersions does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableVersions: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableVersions: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableVersionsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableVersions: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::listTables(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit, boost::optional includeDeclared) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/table/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->listTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + if (includeDeclared) + { + localVarQueryParams[utility::conversions::to_string_t("include_declared")] = ApiClient::parameterToString(*includeDeclared); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->listTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task MetadataApi::namespaceExists(utility::string_t id, std::shared_ptr namespaceExistsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'namespaceExistsRequest' is set + if (namespaceExistsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'namespaceExistsRequest' when calling MetadataApi->namespaceExists")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/exists"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->namespaceExists does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(namespaceExistsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(namespaceExistsRequest.get()) + { + namespaceExistsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("namespaceExistsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->namespaceExists does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling namespaceExists: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling namespaceExists: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + return void(); + }); +} +pplx::task> MetadataApi::registerTable(utility::string_t id, std::shared_ptr registerTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'registerTableRequest' is set + if (registerTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'registerTableRequest' when calling MetadataApi->registerTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/register"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->registerTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(registerTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(registerTableRequest.get()) + { + registerTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("registerTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->registerTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling registerTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling registerTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RegisterTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling registerTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::renameTable(utility::string_t id, std::shared_ptr renameTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'renameTableRequest' is set + if (renameTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'renameTableRequest' when calling MetadataApi->renameTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/rename"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->renameTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(renameTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(renameTableRequest.get()) + { + renameTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("renameTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->renameTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling renameTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling renameTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RenameTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling renameTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::restoreTable(utility::string_t id, std::shared_ptr restoreTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'restoreTableRequest' is set + if (restoreTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'restoreTableRequest' when calling MetadataApi->restoreTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/restore"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->restoreTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(restoreTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(restoreTableRequest.get()) + { + restoreTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("restoreTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->restoreTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling restoreTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling restoreTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RestoreTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling restoreTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task MetadataApi::tableExists(utility::string_t id, std::shared_ptr tableExistsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'tableExistsRequest' is set + if (tableExistsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'tableExistsRequest' when calling MetadataApi->tableExists")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/exists"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->tableExists does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(tableExistsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(tableExistsRequest.get()) + { + tableExistsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("tableExistsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->tableExists does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling tableExists: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling tableExists: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + return void(); + }); +} +pplx::task> MetadataApi::updateFieldMetadata(utility::string_t id, std::shared_ptr updateFieldMetadataRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateFieldMetadataRequest' is set + if (updateFieldMetadataRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateFieldMetadataRequest' when calling MetadataApi->updateFieldMetadata")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/update_field_metadata"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->updateFieldMetadata does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateFieldMetadataRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateFieldMetadataRequest.get()) + { + updateFieldMetadataRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateFieldMetadataRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->updateFieldMetadata does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateFieldMetadata: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateFieldMetadata: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateFieldMetadataResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateFieldMetadata: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::updateTableSchemaMetadata(utility::string_t id, std::map requestBody, boost::optional delimiter, boost::optional branch) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/schema_metadata/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->updateTableSchemaMetadata does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(requestBody); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + { + std::map localVarJsonMap; + for( auto& localVarItem : requestBody ) + { + web::json::value jval; + localVarJsonMap.insert( std::pair(localVarItem.first, ModelBase::toJson(localVarItem.second) )); + } + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("requestBody"), localVarJsonMap, utility::conversions::to_string_t("application/json"))); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->updateTableSchemaMetadata does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTableSchemaMetadata: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableSchemaMetadata: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::map localVarResult; + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + for( auto& localVarItem : localVarJson.as_object() ) + { + utility::string_t localVarItemObj; + ModelBase::fromJson(localVarItem.second, localVarItemObj); + localVarResult[localVarItem.first] = localVarItemObj; + } + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableSchemaMetadata: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> MetadataApi::updateTableTag(utility::string_t id, std::shared_ptr updateTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateTableTagRequest' is set + if (updateTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateTableTagRequest' when calling MetadataApi->updateTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("MetadataApi->updateTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateTableTagRequest.get()) + { + updateTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("MetadataApi->updateTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableTag: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/NamespaceApi.cpp b/cpp/lance_namespace_rest_client/src/api/NamespaceApi.cpp new file mode 100644 index 000000000..ce258924a --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/NamespaceApi.cpp @@ -0,0 +1,965 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/NamespaceApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +NamespaceApi::NamespaceApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +NamespaceApi::~NamespaceApi() +{ +} + +pplx::task> NamespaceApi::createNamespace(utility::string_t id, std::shared_ptr createNamespaceRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createNamespaceRequest' is set + if (createNamespaceRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createNamespaceRequest' when calling NamespaceApi->createNamespace")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("NamespaceApi->createNamespace does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createNamespaceRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createNamespaceRequest.get()) + { + createNamespaceRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createNamespaceRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("NamespaceApi->createNamespace does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createNamespace: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createNamespace: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateNamespaceResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createNamespace: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> NamespaceApi::describeNamespace(utility::string_t id, std::shared_ptr describeNamespaceRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeNamespaceRequest' is set + if (describeNamespaceRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeNamespaceRequest' when calling NamespaceApi->describeNamespace")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("NamespaceApi->describeNamespace does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeNamespaceRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeNamespaceRequest.get()) + { + describeNamespaceRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeNamespaceRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("NamespaceApi->describeNamespace does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeNamespace: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeNamespace: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeNamespaceResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeNamespace: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> NamespaceApi::dropNamespace(utility::string_t id, std::shared_ptr dropNamespaceRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'dropNamespaceRequest' is set + if (dropNamespaceRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'dropNamespaceRequest' when calling NamespaceApi->dropNamespace")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("NamespaceApi->dropNamespace does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(dropNamespaceRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(dropNamespaceRequest.get()) + { + dropNamespaceRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("dropNamespaceRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("NamespaceApi->dropNamespace does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropNamespace: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropNamespace: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropNamespaceResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropNamespace: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> NamespaceApi::listNamespaces(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("NamespaceApi->listNamespaces does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("NamespaceApi->listNamespaces does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listNamespaces: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listNamespaces: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListNamespacesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listNamespaces: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> NamespaceApi::listTables(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit, boost::optional includeDeclared) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/table/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("NamespaceApi->listTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + if (includeDeclared) + { + localVarQueryParams[utility::conversions::to_string_t("include_declared")] = ApiClient::parameterToString(*includeDeclared); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("NamespaceApi->listTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task NamespaceApi::namespaceExists(utility::string_t id, std::shared_ptr namespaceExistsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'namespaceExistsRequest' is set + if (namespaceExistsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'namespaceExistsRequest' when calling NamespaceApi->namespaceExists")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/exists"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("NamespaceApi->namespaceExists does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(namespaceExistsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(namespaceExistsRequest.get()) + { + namespaceExistsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("namespaceExistsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("NamespaceApi->namespaceExists does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling namespaceExists: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling namespaceExists: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + return void(); + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/TableApi.cpp b/cpp/lance_namespace_rest_client/src/api/TableApi.cpp new file mode 100644 index 000000000..8ea547224 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/TableApi.cpp @@ -0,0 +1,7215 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/TableApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +TableApi::TableApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +TableApi::~TableApi() +{ +} + +pplx::task> TableApi::alterTableAddColumns(utility::string_t id, std::shared_ptr alterTableAddColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableAddColumnsRequest' is set + if (alterTableAddColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableAddColumnsRequest' when calling TableApi->alterTableAddColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/add_columns"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->alterTableAddColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableAddColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableAddColumnsRequest.get()) + { + alterTableAddColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableAddColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->alterTableAddColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableAddColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAddColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableAddColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAddColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::alterTableAlterColumns(utility::string_t id, std::shared_ptr alterTableAlterColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableAlterColumnsRequest' is set + if (alterTableAlterColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableAlterColumnsRequest' when calling TableApi->alterTableAlterColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/alter_columns"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->alterTableAlterColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableAlterColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableAlterColumnsRequest.get()) + { + alterTableAlterColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableAlterColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->alterTableAlterColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableAlterColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAlterColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableAlterColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableAlterColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::alterTableBackfillColumns(utility::string_t id, std::shared_ptr alterTableBackfillColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableBackfillColumnsRequest' is set + if (alterTableBackfillColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableBackfillColumnsRequest' when calling TableApi->alterTableBackfillColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/backfill_column"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->alterTableBackfillColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableBackfillColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableBackfillColumnsRequest.get()) + { + alterTableBackfillColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableBackfillColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->alterTableBackfillColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableBackfillColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableBackfillColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableBackfillColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableBackfillColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::alterTableDropColumns(utility::string_t id, std::shared_ptr alterTableDropColumnsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTableDropColumnsRequest' is set + if (alterTableDropColumnsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTableDropColumnsRequest' when calling TableApi->alterTableDropColumns")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/drop_columns"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->alterTableDropColumns does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTableDropColumnsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTableDropColumnsRequest.get()) + { + alterTableDropColumnsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTableDropColumnsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->alterTableDropColumns does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTableDropColumns: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableDropColumns: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTableDropColumnsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTableDropColumns: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task TableApi::analyzeTableQueryPlan(utility::string_t id, std::shared_ptr analyzeTableQueryPlanRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'analyzeTableQueryPlanRequest' is set + if (analyzeTableQueryPlanRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'analyzeTableQueryPlanRequest' when calling TableApi->analyzeTableQueryPlan")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/analyze_plan"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + // plain text + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("text/plain")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->analyzeTableQueryPlan does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(analyzeTableQueryPlanRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(analyzeTableQueryPlanRequest.get()) + { + analyzeTableQueryPlanRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("analyzeTableQueryPlanRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->analyzeTableQueryPlan does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling analyzeTableQueryPlan: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling analyzeTableQueryPlan: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + utility::string_t localVarResult(utility::conversions::to_string_t("")); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + else if(localVarResponseHttpContentType == utility::conversions::to_string_t("text/plain")) + { + localVarResult = localVarResponse; + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling analyzeTableQueryPlan: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::batchCommitTables(std::shared_ptr batchCommitTablesRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchCommitTablesRequest' is set + if (batchCommitTablesRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchCommitTablesRequest' when calling TableApi->batchCommitTables")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/batch-commit"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->batchCommitTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchCommitTablesRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchCommitTablesRequest.get()) + { + batchCommitTablesRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchCommitTablesRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->batchCommitTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchCommitTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCommitTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchCommitTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCommitTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::batchCreateTableVersions(std::shared_ptr batchCreateTableVersionsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchCreateTableVersionsRequest' is set + if (batchCreateTableVersionsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchCreateTableVersionsRequest' when calling TableApi->batchCreateTableVersions")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/version/batch-create"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->batchCreateTableVersions does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchCreateTableVersionsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchCreateTableVersionsRequest.get()) + { + batchCreateTableVersionsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchCreateTableVersionsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->batchCreateTableVersions does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchCreateTableVersions: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCreateTableVersions: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchCreateTableVersionsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCreateTableVersions: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::batchDeleteTableVersions(utility::string_t id, std::shared_ptr batchDeleteTableVersionsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchDeleteTableVersionsRequest' is set + if (batchDeleteTableVersionsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchDeleteTableVersionsRequest' when calling TableApi->batchDeleteTableVersions")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->batchDeleteTableVersions does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchDeleteTableVersionsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchDeleteTableVersionsRequest.get()) + { + batchDeleteTableVersionsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchDeleteTableVersionsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->batchDeleteTableVersions does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchDeleteTableVersions: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchDeleteTableVersions: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchDeleteTableVersionsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchDeleteTableVersions: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task TableApi::countTableRows(utility::string_t id, std::shared_ptr countTableRowsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'countTableRowsRequest' is set + if (countTableRowsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'countTableRowsRequest' when calling TableApi->countTableRows")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/count_rows"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->countTableRows does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(countTableRowsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(countTableRowsRequest.get()) + { + countTableRowsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("countTableRowsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->countTableRows does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling countTableRows: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling countTableRows: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + int64_t localVarResult(0L); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling countTableRows: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::createTable(utility::string_t id, std::shared_ptr body, boost::optional delimiter, boost::optional mode, boost::optional properties, boost::optional storageOptions) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->createTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.stream") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (mode) + { + localVarQueryParams[utility::conversions::to_string_t("mode")] = ApiClient::parameterToString(*mode); + } + if (properties) + { + localVarQueryParams[utility::conversions::to_string_t("properties")] = ApiClient::parameterToString(*properties); + } + if (storageOptions) + { + localVarQueryParams[utility::conversions::to_string_t("storage_options")] = ApiClient::parameterToString(*storageOptions); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(body); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body)); + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->createTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::createTableBranch(utility::string_t id, std::shared_ptr createTableBranchRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableBranchRequest' is set + if (createTableBranchRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableBranchRequest' when calling TableApi->createTableBranch")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->createTableBranch does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableBranchRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableBranchRequest.get()) + { + createTableBranchRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableBranchRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->createTableBranch does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableBranch: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableBranch: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableBranchResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableBranch: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::createTableIndex(utility::string_t id, std::shared_ptr createTableIndexRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableIndexRequest' when calling TableApi->createTableIndex")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create_index"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->createTableIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableIndexRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableIndexRequest.get()) + { + createTableIndexRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableIndexRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->createTableIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::createTableScalarIndex(utility::string_t id, std::shared_ptr createTableIndexRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableIndexRequest' is set + if (createTableIndexRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableIndexRequest' when calling TableApi->createTableScalarIndex")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/create_scalar_index"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->createTableScalarIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableIndexRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableIndexRequest.get()) + { + createTableIndexRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableIndexRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->createTableScalarIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableScalarIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableScalarIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableScalarIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableScalarIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::createTableTag(utility::string_t id, std::shared_ptr createTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableTagRequest' is set + if (createTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableTagRequest' when calling TableApi->createTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->createTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableTagRequest.get()) + { + createTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->createTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableTag: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::createTableVersion(utility::string_t id, std::shared_ptr createTableVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableVersionRequest' is set + if (createTableVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableVersionRequest' when calling TableApi->createTableVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->createTableVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableVersionRequest.get()) + { + createTableVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->createTableVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::declareTable(utility::string_t id, std::shared_ptr declareTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'declareTableRequest' is set + if (declareTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'declareTableRequest' when calling TableApi->declareTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/declare"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->declareTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(declareTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(declareTableRequest.get()) + { + declareTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("declareTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->declareTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling declareTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling declareTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeclareTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling declareTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::deleteFromTable(utility::string_t id, std::shared_ptr deleteFromTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteFromTableRequest' is set + if (deleteFromTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteFromTableRequest' when calling TableApi->deleteFromTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->deleteFromTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteFromTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteFromTableRequest.get()) + { + deleteFromTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteFromTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->deleteFromTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteFromTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteFromTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteFromTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteFromTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::deleteTableBranch(utility::string_t id, std::shared_ptr deleteTableBranchRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteTableBranchRequest' is set + if (deleteTableBranchRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteTableBranchRequest' when calling TableApi->deleteTableBranch")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->deleteTableBranch does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteTableBranchRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteTableBranchRequest.get()) + { + deleteTableBranchRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteTableBranchRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->deleteTableBranch does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteTableBranch: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableBranch: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteTableBranchResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableBranch: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::deleteTableTag(utility::string_t id, std::shared_ptr deleteTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteTableTagRequest' is set + if (deleteTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteTableTagRequest' when calling TableApi->deleteTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->deleteTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteTableTagRequest.get()) + { + deleteTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->deleteTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableTag: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::deregisterTable(utility::string_t id, std::shared_ptr deregisterTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deregisterTableRequest' is set + if (deregisterTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deregisterTableRequest' when calling TableApi->deregisterTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/deregister"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->deregisterTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deregisterTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deregisterTableRequest.get()) + { + deregisterTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deregisterTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->deregisterTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deregisterTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deregisterTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeregisterTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deregisterTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::describeTable(utility::string_t id, std::shared_ptr describeTableRequest, boost::optional delimiter, boost::optional withTableUri, boost::optional loadDetailedMetadata, boost::optional checkDeclared) const +{ + + // verify the required parameter 'describeTableRequest' is set + if (describeTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableRequest' when calling TableApi->describeTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->describeTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (withTableUri) + { + localVarQueryParams[utility::conversions::to_string_t("with_table_uri")] = ApiClient::parameterToString(*withTableUri); + } + if (loadDetailedMetadata) + { + localVarQueryParams[utility::conversions::to_string_t("load_detailed_metadata")] = ApiClient::parameterToString(*loadDetailedMetadata); + } + if (checkDeclared) + { + localVarQueryParams[utility::conversions::to_string_t("check_declared")] = ApiClient::parameterToString(*checkDeclared); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableRequest.get()) + { + describeTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->describeTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::describeTableIndexStats(utility::string_t id, utility::string_t indexName, std::shared_ptr describeTableIndexStatsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTableIndexStatsRequest' is set + if (describeTableIndexStatsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableIndexStatsRequest' when calling TableApi->describeTableIndexStats")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/{index_name}/stats"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("index_name") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(indexName))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->describeTableIndexStats does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableIndexStatsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableIndexStatsRequest.get()) + { + describeTableIndexStatsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableIndexStatsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->describeTableIndexStats does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTableIndexStats: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableIndexStats: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableIndexStatsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableIndexStats: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::describeTableVersion(utility::string_t id, std::shared_ptr describeTableVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTableVersionRequest' is set + if (describeTableVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTableVersionRequest' when calling TableApi->describeTableVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->describeTableVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTableVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTableVersionRequest.get()) + { + describeTableVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTableVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->describeTableVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTableVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTableVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTableVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::dropTable(utility::string_t id, boost::optional delimiter) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->dropTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->dropTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::dropTableIndex(utility::string_t id, utility::string_t indexName, boost::optional delimiter, boost::optional branch) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/{index_name}/drop"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("index_name") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(indexName))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->dropTableIndex does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->dropTableIndex does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling dropTableIndex: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTableIndex: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DropTableIndexResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling dropTableIndex: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task TableApi::explainTableQueryPlan(utility::string_t id, std::shared_ptr explainTableQueryPlanRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'explainTableQueryPlanRequest' is set + if (explainTableQueryPlanRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'explainTableQueryPlanRequest' when calling TableApi->explainTableQueryPlan")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/explain_plan"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + // plain text + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("text/plain")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->explainTableQueryPlan does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(explainTableQueryPlanRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(explainTableQueryPlanRequest.get()) + { + explainTableQueryPlanRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("explainTableQueryPlanRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->explainTableQueryPlan does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling explainTableQueryPlan: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling explainTableQueryPlan: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + utility::string_t localVarResult(utility::conversions::to_string_t("")); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + else if(localVarResponseHttpContentType == utility::conversions::to_string_t("text/plain")) + { + localVarResult = localVarResponse; + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling explainTableQueryPlan: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::getTableStats(utility::string_t id, std::shared_ptr getTableStatsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'getTableStatsRequest' is set + if (getTableStatsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'getTableStatsRequest' when calling TableApi->getTableStats")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/stats"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->getTableStats does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(getTableStatsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(getTableStatsRequest.get()) + { + getTableStatsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("getTableStatsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->getTableStats does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling getTableStats: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableStats: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new GetTableStatsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableStats: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::getTableTagVersion(utility::string_t id, std::shared_ptr getTableTagVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'getTableTagVersionRequest' is set + if (getTableTagVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'getTableTagVersionRequest' when calling TableApi->getTableTagVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/version"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->getTableTagVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(getTableTagVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(getTableTagVersionRequest.get()) + { + getTableTagVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("getTableTagVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->getTableTagVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling getTableTagVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableTagVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new GetTableTagVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableTagVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::insertIntoTable(utility::string_t id, std::shared_ptr body, boost::optional delimiter, boost::optional branch, boost::optional mode) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/insert"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->insertIntoTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.stream") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + if (mode) + { + localVarQueryParams[utility::conversions::to_string_t("mode")] = ApiClient::parameterToString(*mode); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(body); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body)); + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->insertIntoTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling insertIntoTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling insertIntoTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new InsertIntoTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling insertIntoTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::listAllTables(boost::optional delimiter, boost::optional pageToken, boost::optional limit, boost::optional includeDeclared) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->listAllTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + if (includeDeclared) + { + localVarQueryParams[utility::conversions::to_string_t("include_declared")] = ApiClient::parameterToString(*includeDeclared); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->listAllTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listAllTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listAllTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listAllTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::listTableBranches(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/branches/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->listTableBranches does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->listTableBranches does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableBranches: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableBranches: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableBranchesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableBranches: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::listTableIndices(utility::string_t id, std::shared_ptr listTableIndicesRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'listTableIndicesRequest' is set + if (listTableIndicesRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'listTableIndicesRequest' when calling TableApi->listTableIndices")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/index/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->listTableIndices does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(listTableIndicesRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(listTableIndicesRequest.get()) + { + listTableIndicesRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("listTableIndicesRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->listTableIndices does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableIndices: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableIndices: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableIndicesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableIndices: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::listTableTags(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->listTableTags does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->listTableTags does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableTags: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableTags: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableTagsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableTags: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::listTableVersions(utility::string_t id, boost::optional delimiter, boost::optional branch, boost::optional pageToken, boost::optional limit, boost::optional descending) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/version/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->listTableVersions does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + if (descending) + { + localVarQueryParams[utility::conversions::to_string_t("descending")] = ApiClient::parameterToString(*descending); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->listTableVersions does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableVersions: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableVersions: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableVersionsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableVersions: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::listTables(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit, boost::optional includeDeclared) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/namespace/{id}/table/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->listTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + if (includeDeclared) + { + localVarQueryParams[utility::conversions::to_string_t("include_declared")] = ApiClient::parameterToString(*includeDeclared); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->listTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::mergeInsertIntoTable(utility::string_t id, utility::string_t on, std::shared_ptr body, boost::optional delimiter, boost::optional branch, boost::optional whenMatchedUpdateAll, boost::optional whenMatchedUpdateAllFilt, boost::optional whenNotMatchedInsertAll, boost::optional whenNotMatchedBySourceDelete, boost::optional whenNotMatchedBySourceDeleteFilt, boost::optional timeout, boost::optional useIndex) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/merge_insert"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->mergeInsertIntoTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.stream") ); + + { + localVarQueryParams[utility::conversions::to_string_t("on")] = ApiClient::parameterToString(on); + } + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + if (whenMatchedUpdateAll) + { + localVarQueryParams[utility::conversions::to_string_t("when_matched_update_all")] = ApiClient::parameterToString(*whenMatchedUpdateAll); + } + if (whenMatchedUpdateAllFilt) + { + localVarQueryParams[utility::conversions::to_string_t("when_matched_update_all_filt")] = ApiClient::parameterToString(*whenMatchedUpdateAllFilt); + } + if (whenNotMatchedInsertAll) + { + localVarQueryParams[utility::conversions::to_string_t("when_not_matched_insert_all")] = ApiClient::parameterToString(*whenNotMatchedInsertAll); + } + if (whenNotMatchedBySourceDelete) + { + localVarQueryParams[utility::conversions::to_string_t("when_not_matched_by_source_delete")] = ApiClient::parameterToString(*whenNotMatchedBySourceDelete); + } + if (whenNotMatchedBySourceDeleteFilt) + { + localVarQueryParams[utility::conversions::to_string_t("when_not_matched_by_source_delete_filt")] = ApiClient::parameterToString(*whenNotMatchedBySourceDeleteFilt); + } + if (timeout) + { + localVarQueryParams[utility::conversions::to_string_t("timeout")] = ApiClient::parameterToString(*timeout); + } + if (useIndex) + { + localVarQueryParams[utility::conversions::to_string_t("use_index")] = ApiClient::parameterToString(*useIndex); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(body); + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body)); + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->mergeInsertIntoTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling mergeInsertIntoTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling mergeInsertIntoTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new MergeInsertIntoTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling mergeInsertIntoTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::queryTable(utility::string_t id, std::shared_ptr queryTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'queryTableRequest' is set + if (queryTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'queryTableRequest' when calling TableApi->queryTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/query"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/vnd.apache.arrow.file") ); + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + //It's going to be binary, so just use the first one. + localVarResponseHttpContentType = *localVarResponseHttpContentTypes.begin(); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(queryTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(queryTableRequest.get()) + { + queryTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("queryTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->queryTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling queryTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling queryTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_vector(); + }) + .then([=, this](std::vector localVarResponse) + { + std::shared_ptr localVarResult = std::make_shared(); + std::shared_ptr stream = std::make_shared(std::string(localVarResponse.begin(), localVarResponse.end())); + localVarResult->setData(stream); + return localVarResult; + }); +} +pplx::task> TableApi::registerTable(utility::string_t id, std::shared_ptr registerTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'registerTableRequest' is set + if (registerTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'registerTableRequest' when calling TableApi->registerTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/register"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->registerTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(registerTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(registerTableRequest.get()) + { + registerTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("registerTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->registerTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling registerTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling registerTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RegisterTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling registerTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::renameTable(utility::string_t id, std::shared_ptr renameTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'renameTableRequest' is set + if (renameTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'renameTableRequest' when calling TableApi->renameTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/rename"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->renameTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(renameTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(renameTableRequest.get()) + { + renameTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("renameTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->renameTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling renameTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling renameTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RenameTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling renameTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::restoreTable(utility::string_t id, std::shared_ptr restoreTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'restoreTableRequest' is set + if (restoreTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'restoreTableRequest' when calling TableApi->restoreTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/restore"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->restoreTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(restoreTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(restoreTableRequest.get()) + { + restoreTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("restoreTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->restoreTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling restoreTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling restoreTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new RestoreTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling restoreTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task TableApi::tableExists(utility::string_t id, std::shared_ptr tableExistsRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'tableExistsRequest' is set + if (tableExistsRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'tableExistsRequest' when calling TableApi->tableExists")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/exists"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->tableExists does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(tableExistsRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(tableExistsRequest.get()) + { + tableExistsRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("tableExistsRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->tableExists does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling tableExists: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling tableExists: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + return void(); + }); +} +pplx::task> TableApi::updateFieldMetadata(utility::string_t id, std::shared_ptr updateFieldMetadataRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateFieldMetadataRequest' is set + if (updateFieldMetadataRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateFieldMetadataRequest' when calling TableApi->updateFieldMetadata")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/update_field_metadata"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->updateFieldMetadata does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateFieldMetadataRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateFieldMetadataRequest.get()) + { + updateFieldMetadataRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateFieldMetadataRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->updateFieldMetadata does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateFieldMetadata: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateFieldMetadata: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateFieldMetadataResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateFieldMetadata: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::updateTable(utility::string_t id, std::shared_ptr updateTableRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateTableRequest' is set + if (updateTableRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateTableRequest' when calling TableApi->updateTable")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->updateTable does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateTableRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateTableRequest.get()) + { + updateTableRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateTableRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->updateTable does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTable: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTable: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateTableResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTable: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::updateTableSchemaMetadata(utility::string_t id, std::map requestBody, boost::optional delimiter, boost::optional branch) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/schema_metadata/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->updateTableSchemaMetadata does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (branch) + { + localVarQueryParams[utility::conversions::to_string_t("branch")] = ApiClient::parameterToString(*branch); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(requestBody); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + { + std::map localVarJsonMap; + for( auto& localVarItem : requestBody ) + { + web::json::value jval; + localVarJsonMap.insert( std::pair(localVarItem.first, ModelBase::toJson(localVarItem.second) )); + } + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("requestBody"), localVarJsonMap, utility::conversions::to_string_t("application/json"))); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->updateTableSchemaMetadata does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTableSchemaMetadata: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableSchemaMetadata: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::map localVarResult; + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + for( auto& localVarItem : localVarJson.as_object() ) + { + utility::string_t localVarItemObj; + ModelBase::fromJson(localVarItem.second, localVarItemObj); + localVarResult[localVarItem.first] = localVarItemObj; + } + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableSchemaMetadata: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TableApi::updateTableTag(utility::string_t id, std::shared_ptr updateTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateTableTagRequest' is set + if (updateTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateTableTagRequest' when calling TableApi->updateTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TableApi->updateTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateTableTagRequest.get()) + { + updateTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TableApi->updateTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableTag: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/TagApi.cpp b/cpp/lance_namespace_rest_client/src/api/TagApi.cpp new file mode 100644 index 000000000..a6338e27e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/TagApi.cpp @@ -0,0 +1,833 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/TagApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +TagApi::TagApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +TagApi::~TagApi() +{ +} + +pplx::task> TagApi::createTableTag(utility::string_t id, std::shared_ptr createTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'createTableTagRequest' is set + if (createTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createTableTagRequest' when calling TagApi->createTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/create"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TagApi->createTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createTableTagRequest.get()) + { + createTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TagApi->createTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new CreateTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createTableTag: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TagApi::deleteTableTag(utility::string_t id, std::shared_ptr deleteTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'deleteTableTagRequest' is set + if (deleteTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'deleteTableTagRequest' when calling TagApi->deleteTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/delete"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TagApi->deleteTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(deleteTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(deleteTableTagRequest.get()) + { + deleteTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("deleteTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TagApi->deleteTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling deleteTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DeleteTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling deleteTableTag: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TagApi::getTableTagVersion(utility::string_t id, std::shared_ptr getTableTagVersionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'getTableTagVersionRequest' is set + if (getTableTagVersionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'getTableTagVersionRequest' when calling TagApi->getTableTagVersion")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/version"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TagApi->getTableTagVersion does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(getTableTagVersionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(getTableTagVersionRequest.get()) + { + getTableTagVersionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("getTableTagVersionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TagApi->getTableTagVersion does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling getTableTagVersion: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableTagVersion: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new GetTableTagVersionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling getTableTagVersion: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TagApi::listTableTags(utility::string_t id, boost::optional delimiter, boost::optional pageToken, boost::optional limit) const +{ + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/list"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TagApi->listTableTags does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + if (pageToken) + { + localVarQueryParams[utility::conversions::to_string_t("page_token")] = ApiClient::parameterToString(*pageToken); + } + if (limit) + { + localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TagApi->listTableTags does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling listTableTags: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableTags: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new ListTableTagsResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling listTableTags: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TagApi::updateTableTag(utility::string_t id, std::shared_ptr updateTableTagRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'updateTableTagRequest' is set + if (updateTableTagRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'updateTableTagRequest' when calling TagApi->updateTableTag")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/{id}/tags/update"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TagApi->updateTableTag does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(updateTableTagRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(updateTableTagRequest.get()) + { + updateTableTagRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("updateTableTagRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TagApi->updateTableTag does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling updateTableTag: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableTag: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new UpdateTableTagResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updateTableTag: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/api/TransactionApi.cpp b/cpp/lance_namespace_rest_client/src/api/TransactionApi.cpp new file mode 100644 index 000000000..0a8807bbf --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/api/TransactionApi.cpp @@ -0,0 +1,525 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "lance_namespace_rest_client/api/TransactionApi.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +TransactionApi::TransactionApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +TransactionApi::~TransactionApi() +{ +} + +pplx::task> TransactionApi::alterTransaction(utility::string_t id, std::shared_ptr alterTransactionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'alterTransactionRequest' is set + if (alterTransactionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'alterTransactionRequest' when calling TransactionApi->alterTransaction")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/transaction/{id}/alter"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TransactionApi->alterTransaction does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(alterTransactionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(alterTransactionRequest.get()) + { + alterTransactionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("alterTransactionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TransactionApi->alterTransaction does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling alterTransaction: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTransaction: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new AlterTransactionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling alterTransaction: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TransactionApi::batchCommitTables(std::shared_ptr batchCommitTablesRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'batchCommitTablesRequest' is set + if (batchCommitTablesRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'batchCommitTablesRequest' when calling TransactionApi->batchCommitTables")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/table/batch-commit"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TransactionApi->batchCommitTables does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(batchCommitTablesRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(batchCommitTablesRequest.get()) + { + batchCommitTablesRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("batchCommitTablesRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TransactionApi->batchCommitTables does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling batchCommitTables: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCommitTables: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new BatchCommitTablesResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling batchCommitTables: unsupported response type")); + } + + return localVarResult; + }); +} +pplx::task> TransactionApi::describeTransaction(utility::string_t id, std::shared_ptr describeTransactionRequest, boost::optional delimiter) const +{ + + // verify the required parameter 'describeTransactionRequest' is set + if (describeTransactionRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'describeTransactionRequest' when calling TransactionApi->describeTransaction")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/v1/transaction/{id}/describe"); + boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("id") + utility::conversions::to_string_t("}"), web::uri::encode_uri(ApiClient::parameterToString(id))); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("TransactionApi->describeTransaction does not produce any supported media type")); + } + + localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; + + std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); + + if (delimiter) + { + localVarQueryParams[utility::conversions::to_string_t("delimiter")] = ApiClient::parameterToString(*delimiter); + } + + std::shared_ptr localVarHttpBody; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(describeTransactionRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(describeTransactionRequest.get()) + { + describeTransactionRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("describeTransactionRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("TransactionApi->describeTransaction does not consume any supported media type")); + } + + // authentication (OAuth2) required + // oauth2 authentication is added automatically as part of the http_client_config + // authentication (ApiKeyAuth) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("x-api-key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = localVarApiKey; + } + } + // authentication (BearerAuth) required + + return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) + .then([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling describeTransaction: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTransaction: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + std::shared_ptr localVarResult(new DescribeTransactionResponse()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling describeTransaction: unsupported response type")); + } + + return localVarResult; + }); +} + +} +} +} +} + diff --git a/cpp/lance_namespace_rest_client/src/model/AddColumnsEntry.cpp b/cpp/lance_namespace_rest_client/src/model/AddColumnsEntry.cpp new file mode 100644 index 000000000..f281799b1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AddColumnsEntry.cpp @@ -0,0 +1,221 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AddColumnsEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AddColumnsEntry::AddColumnsEntry() +{ + m_Name = utility::conversions::to_string_t(""); + m_NameIsSet = false; + m_Expression = utility::conversions::to_string_t(""); + m_ExpressionIsSet = false; + m_Virtual_columnIsSet = false; +} + +AddColumnsEntry::~AddColumnsEntry() +{ +} + +void AddColumnsEntry::validate() +{ + // TODO: implement validation +} + +web::json::value AddColumnsEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_NameIsSet) + { + + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); + } + if(m_ExpressionIsSet) + { + + val[utility::conversions::to_string_t(U("expression"))] = ModelBase::toJson(m_Expression); + } + if(m_Virtual_columnIsSet) + { + + val[utility::conversions::to_string_t(U("virtual_column"))] = ModelBase::toJson(m_Virtual_column); + } + + return val; +} + +bool AddColumnsEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromJson(fieldValue, refVal_setName); + setName(refVal_setName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("expression")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("expression"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setExpression; + ok &= ModelBase::fromJson(fieldValue, refVal_setExpression); + setExpression(refVal_setExpression); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("virtual_column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("virtual_column"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVirtualColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setVirtualColumn); + setVirtualColumn(refVal_setVirtualColumn); + + } + } + return ok; +} + +void AddColumnsEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_NameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } + if(m_ExpressionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("expression")), m_Expression)); + } + if(m_Virtual_columnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("virtual_column")), m_Virtual_column)); + } +} + +bool AddColumnsEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); + setName(refVal_setName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("expression")))) + { + utility::string_t refVal_setExpression; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("expression"))), refVal_setExpression ); + setExpression(refVal_setExpression); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("virtual_column")))) + { + std::shared_ptr refVal_setVirtualColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("virtual_column"))), refVal_setVirtualColumn ); + setVirtualColumn(refVal_setVirtualColumn); + } + return ok; +} + + +utility::string_t AddColumnsEntry::getName() const +{ + return m_Name; +} + + +void AddColumnsEntry::setName(const utility::string_t& value) +{ + m_Name = value; + m_NameIsSet = true; +} + +bool AddColumnsEntry::nameIsSet() const +{ + return m_NameIsSet; +} + +void AddColumnsEntry::unsetName() +{ + m_NameIsSet = false; +} +utility::string_t AddColumnsEntry::getExpression() const +{ + return m_Expression; +} + + +void AddColumnsEntry::setExpression(const utility::string_t& value) +{ + m_Expression = value; + m_ExpressionIsSet = true; +} + +bool AddColumnsEntry::expressionIsSet() const +{ + return m_ExpressionIsSet; +} + +void AddColumnsEntry::unsetExpression() +{ + m_ExpressionIsSet = false; +} +std::shared_ptr AddColumnsEntry::getVirtualColumn() const +{ + return m_Virtual_column; +} + + +void AddColumnsEntry::setVirtualColumn(const std::shared_ptr& value) +{ + m_Virtual_column = value; + m_Virtual_columnIsSet = true; +} + +bool AddColumnsEntry::virtualColumnIsSet() const +{ + return m_Virtual_columnIsSet; +} + +void AddColumnsEntry::unsetVirtual_column() +{ + m_Virtual_columnIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AddVirtualColumnEntry.cpp b/cpp/lance_namespace_rest_client/src/model/AddVirtualColumnEntry.cpp new file mode 100644 index 000000000..4dfb1be9e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AddVirtualColumnEntry.cpp @@ -0,0 +1,610 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AddVirtualColumnEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AddVirtualColumnEntry::AddVirtualColumnEntry() +{ + m_Input_columnsIsSet = false; + m_OutputsIsSet = false; + m_Image = utility::conversions::to_string_t(""); + m_ImageIsSet = false; + m_Udf = utility::conversions::to_string_t(""); + m_UdfIsSet = false; + m_Udf_name = utility::conversions::to_string_t(""); + m_Udf_nameIsSet = false; + m_Udf_version = utility::conversions::to_string_t(""); + m_Udf_versionIsSet = false; + m_Udf_backend = utility::conversions::to_string_t(""); + m_Udf_backendIsSet = false; + m_Auto_backfill = false; + m_Auto_backfillIsSet = false; + m_Manifest = utility::conversions::to_string_t(""); + m_ManifestIsSet = false; + m_Manifest_checksum = utility::conversions::to_string_t(""); + m_Manifest_checksumIsSet = false; + m_Field_metadataIsSet = false; +} + +AddVirtualColumnEntry::~AddVirtualColumnEntry() +{ +} + +void AddVirtualColumnEntry::validate() +{ + // TODO: implement validation +} + +web::json::value AddVirtualColumnEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Input_columnsIsSet) + { + + val[utility::conversions::to_string_t(U("input_columns"))] = ModelBase::toJson(m_Input_columns); + } + if(m_OutputsIsSet) + { + + val[utility::conversions::to_string_t(U("outputs"))] = ModelBase::toJson(m_Outputs); + } + if(m_ImageIsSet) + { + + val[utility::conversions::to_string_t(U("image"))] = ModelBase::toJson(m_Image); + } + if(m_UdfIsSet) + { + + val[utility::conversions::to_string_t(U("udf"))] = ModelBase::toJson(m_Udf); + } + if(m_Udf_nameIsSet) + { + + val[utility::conversions::to_string_t(U("udf_name"))] = ModelBase::toJson(m_Udf_name); + } + if(m_Udf_versionIsSet) + { + + val[utility::conversions::to_string_t(U("udf_version"))] = ModelBase::toJson(m_Udf_version); + } + if(m_Udf_backendIsSet) + { + + val[utility::conversions::to_string_t(U("udf_backend"))] = ModelBase::toJson(m_Udf_backend); + } + if(m_Auto_backfillIsSet) + { + + val[utility::conversions::to_string_t(U("auto_backfill"))] = ModelBase::toJson(m_Auto_backfill); + } + if(m_ManifestIsSet) + { + + val[utility::conversions::to_string_t(U("manifest"))] = ModelBase::toJson(m_Manifest); + } + if(m_Manifest_checksumIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_checksum"))] = ModelBase::toJson(m_Manifest_checksum); + } + if(m_Field_metadataIsSet) + { + + val[utility::conversions::to_string_t(U("field_metadata"))] = ModelBase::toJson(m_Field_metadata); + } + + return val; +} + +bool AddVirtualColumnEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("input_columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("input_columns"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setInputColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setInputColumns); + setInputColumns(refVal_setInputColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("outputs")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("outputs"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setOutputs; + ok &= ModelBase::fromJson(fieldValue, refVal_setOutputs); + setOutputs(refVal_setOutputs); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("image")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("image"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setImage; + ok &= ModelBase::fromJson(fieldValue, refVal_setImage); + setImage(refVal_setImage); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdf; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdf); + setUdf(refVal_setUdf); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdfName; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdfName); + setUdfName(refVal_setUdfName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf_version"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdfVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdfVersion); + setUdfVersion(refVal_setUdfVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf_backend")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf_backend"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdfBackend; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdfBackend); + setUdfBackend(refVal_setUdfBackend); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("auto_backfill")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("auto_backfill"))); + if(!fieldValue.is_null()) + { + bool refVal_setAutoBackfill; + ok &= ModelBase::fromJson(fieldValue, refVal_setAutoBackfill); + setAutoBackfill(refVal_setAutoBackfill); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifest); + setManifest(refVal_setManifest); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_checksum")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_checksum"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifestChecksum; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestChecksum); + setManifestChecksum(refVal_setManifestChecksum); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("field_metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("field_metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setFieldMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setFieldMetadata); + setFieldMetadata(refVal_setFieldMetadata); + + } + } + return ok; +} + +void AddVirtualColumnEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Input_columnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("input_columns")), m_Input_columns)); + } + if(m_OutputsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("outputs")), m_Outputs)); + } + if(m_ImageIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("image")), m_Image)); + } + if(m_UdfIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf")), m_Udf)); + } + if(m_Udf_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf_name")), m_Udf_name)); + } + if(m_Udf_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf_version")), m_Udf_version)); + } + if(m_Udf_backendIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf_backend")), m_Udf_backend)); + } + if(m_Auto_backfillIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("auto_backfill")), m_Auto_backfill)); + } + if(m_ManifestIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest")), m_Manifest)); + } + if(m_Manifest_checksumIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_checksum")), m_Manifest_checksum)); + } + if(m_Field_metadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("field_metadata")), m_Field_metadata)); + } +} + +bool AddVirtualColumnEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("input_columns")))) + { + std::vector refVal_setInputColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("input_columns"))), refVal_setInputColumns ); + setInputColumns(refVal_setInputColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("outputs")))) + { + std::vector> refVal_setOutputs; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("outputs"))), refVal_setOutputs ); + setOutputs(refVal_setOutputs); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("image")))) + { + utility::string_t refVal_setImage; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("image"))), refVal_setImage ); + setImage(refVal_setImage); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf")))) + { + utility::string_t refVal_setUdf; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf"))), refVal_setUdf ); + setUdf(refVal_setUdf); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf_name")))) + { + utility::string_t refVal_setUdfName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf_name"))), refVal_setUdfName ); + setUdfName(refVal_setUdfName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf_version")))) + { + utility::string_t refVal_setUdfVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf_version"))), refVal_setUdfVersion ); + setUdfVersion(refVal_setUdfVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf_backend")))) + { + utility::string_t refVal_setUdfBackend; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf_backend"))), refVal_setUdfBackend ); + setUdfBackend(refVal_setUdfBackend); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("auto_backfill")))) + { + bool refVal_setAutoBackfill; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("auto_backfill"))), refVal_setAutoBackfill ); + setAutoBackfill(refVal_setAutoBackfill); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest")))) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest"))), refVal_setManifest ); + setManifest(refVal_setManifest); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_checksum")))) + { + utility::string_t refVal_setManifestChecksum; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_checksum"))), refVal_setManifestChecksum ); + setManifestChecksum(refVal_setManifestChecksum); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("field_metadata")))) + { + std::map refVal_setFieldMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("field_metadata"))), refVal_setFieldMetadata ); + setFieldMetadata(refVal_setFieldMetadata); + } + return ok; +} + + +std::vector AddVirtualColumnEntry::getInputColumns() const +{ + return m_Input_columns; +} + + +void AddVirtualColumnEntry::setInputColumns(const std::vector& value) +{ + m_Input_columns = value; + m_Input_columnsIsSet = true; +} + +bool AddVirtualColumnEntry::inputColumnsIsSet() const +{ + return m_Input_columnsIsSet; +} + +void AddVirtualColumnEntry::unsetInput_columns() +{ + m_Input_columnsIsSet = false; +} +std::vector> AddVirtualColumnEntry::getOutputs() const +{ + return m_Outputs; +} + + +void AddVirtualColumnEntry::setOutputs(const std::vector>& value) +{ + m_Outputs = value; + m_OutputsIsSet = true; +} + +bool AddVirtualColumnEntry::outputsIsSet() const +{ + return m_OutputsIsSet; +} + +void AddVirtualColumnEntry::unsetOutputs() +{ + m_OutputsIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getImage() const +{ + return m_Image; +} + + +void AddVirtualColumnEntry::setImage(const utility::string_t& value) +{ + m_Image = value; + m_ImageIsSet = true; +} + +bool AddVirtualColumnEntry::imageIsSet() const +{ + return m_ImageIsSet; +} + +void AddVirtualColumnEntry::unsetImage() +{ + m_ImageIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getUdf() const +{ + return m_Udf; +} + + +void AddVirtualColumnEntry::setUdf(const utility::string_t& value) +{ + m_Udf = value; + m_UdfIsSet = true; +} + +bool AddVirtualColumnEntry::udfIsSet() const +{ + return m_UdfIsSet; +} + +void AddVirtualColumnEntry::unsetUdf() +{ + m_UdfIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getUdfName() const +{ + return m_Udf_name; +} + + +void AddVirtualColumnEntry::setUdfName(const utility::string_t& value) +{ + m_Udf_name = value; + m_Udf_nameIsSet = true; +} + +bool AddVirtualColumnEntry::udfNameIsSet() const +{ + return m_Udf_nameIsSet; +} + +void AddVirtualColumnEntry::unsetUdf_name() +{ + m_Udf_nameIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getUdfVersion() const +{ + return m_Udf_version; +} + + +void AddVirtualColumnEntry::setUdfVersion(const utility::string_t& value) +{ + m_Udf_version = value; + m_Udf_versionIsSet = true; +} + +bool AddVirtualColumnEntry::udfVersionIsSet() const +{ + return m_Udf_versionIsSet; +} + +void AddVirtualColumnEntry::unsetUdf_version() +{ + m_Udf_versionIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getUdfBackend() const +{ + return m_Udf_backend; +} + + +void AddVirtualColumnEntry::setUdfBackend(const utility::string_t& value) +{ + m_Udf_backend = value; + m_Udf_backendIsSet = true; +} + +bool AddVirtualColumnEntry::udfBackendIsSet() const +{ + return m_Udf_backendIsSet; +} + +void AddVirtualColumnEntry::unsetUdf_backend() +{ + m_Udf_backendIsSet = false; +} +bool AddVirtualColumnEntry::isAutoBackfill() const +{ + return m_Auto_backfill; +} + +void AddVirtualColumnEntry::setAutoBackfill(bool value) +{ + m_Auto_backfill = value; + m_Auto_backfillIsSet = true; +} + +bool AddVirtualColumnEntry::autoBackfillIsSet() const +{ + return m_Auto_backfillIsSet; +} + +void AddVirtualColumnEntry::unsetAuto_backfill() +{ + m_Auto_backfillIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getManifest() const +{ + return m_Manifest; +} + + +void AddVirtualColumnEntry::setManifest(const utility::string_t& value) +{ + m_Manifest = value; + m_ManifestIsSet = true; +} + +bool AddVirtualColumnEntry::manifestIsSet() const +{ + return m_ManifestIsSet; +} + +void AddVirtualColumnEntry::unsetManifest() +{ + m_ManifestIsSet = false; +} +utility::string_t AddVirtualColumnEntry::getManifestChecksum() const +{ + return m_Manifest_checksum; +} + + +void AddVirtualColumnEntry::setManifestChecksum(const utility::string_t& value) +{ + m_Manifest_checksum = value; + m_Manifest_checksumIsSet = true; +} + +bool AddVirtualColumnEntry::manifestChecksumIsSet() const +{ + return m_Manifest_checksumIsSet; +} + +void AddVirtualColumnEntry::unsetManifest_checksum() +{ + m_Manifest_checksumIsSet = false; +} +std::map AddVirtualColumnEntry::getFieldMetadata() const +{ + return m_Field_metadata; +} + + +void AddVirtualColumnEntry::setFieldMetadata(const std::map& value) +{ + m_Field_metadata = value; + m_Field_metadataIsSet = true; +} + +bool AddVirtualColumnEntry::fieldMetadataIsSet() const +{ + return m_Field_metadataIsSet; +} + +void AddVirtualColumnEntry::unsetField_metadata() +{ + m_Field_metadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AddVirtualColumnOutputEntry.cpp b/cpp/lance_namespace_rest_client/src/model/AddVirtualColumnOutputEntry.cpp new file mode 100644 index 000000000..3852d17de --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AddVirtualColumnOutputEntry.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AddVirtualColumnOutputEntry::AddVirtualColumnOutputEntry() +{ + m_Column = utility::conversions::to_string_t(""); + m_ColumnIsSet = false; + m_Struct_field = utility::conversions::to_string_t(""); + m_Struct_fieldIsSet = false; + m_Data_typeIsSet = false; + m_Nullable = false; + m_NullableIsSet = false; + m_MetadataIsSet = false; +} + +AddVirtualColumnOutputEntry::~AddVirtualColumnOutputEntry() +{ +} + +void AddVirtualColumnOutputEntry::validate() +{ + // TODO: implement validation +} + +web::json::value AddVirtualColumnOutputEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_ColumnIsSet) + { + + val[utility::conversions::to_string_t(U("column"))] = ModelBase::toJson(m_Column); + } + if(m_Struct_fieldIsSet) + { + + val[utility::conversions::to_string_t(U("struct_field"))] = ModelBase::toJson(m_Struct_field); + } + if(m_Data_typeIsSet) + { + + val[utility::conversions::to_string_t(U("data_type"))] = ModelBase::toJson(m_Data_type); + } + if(m_NullableIsSet) + { + + val[utility::conversions::to_string_t(U("nullable"))] = ModelBase::toJson(m_Nullable); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + + return val; +} + +bool AddVirtualColumnOutputEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumn); + setColumn(refVal_setColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("struct_field")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("struct_field"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setStructField; + ok &= ModelBase::fromJson(fieldValue, refVal_setStructField); + setStructField(refVal_setStructField); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("data_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("data_type"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDataType; + ok &= ModelBase::fromJson(fieldValue, refVal_setDataType); + setDataType(refVal_setDataType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("nullable")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("nullable"))); + if(!fieldValue.is_null()) + { + bool refVal_setNullable; + ok &= ModelBase::fromJson(fieldValue, refVal_setNullable); + setNullable(refVal_setNullable); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + return ok; +} + +void AddVirtualColumnOutputEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_ColumnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column")), m_Column)); + } + if(m_Struct_fieldIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("struct_field")), m_Struct_field)); + } + if(m_Data_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("data_type")), m_Data_type)); + } + if(m_NullableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("nullable")), m_Nullable)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } +} + +bool AddVirtualColumnOutputEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("column")))) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column"))), refVal_setColumn ); + setColumn(refVal_setColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("struct_field")))) + { + utility::string_t refVal_setStructField; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("struct_field"))), refVal_setStructField ); + setStructField(refVal_setStructField); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("data_type")))) + { + std::shared_ptr refVal_setDataType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("data_type"))), refVal_setDataType ); + setDataType(refVal_setDataType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("nullable")))) + { + bool refVal_setNullable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("nullable"))), refVal_setNullable ); + setNullable(refVal_setNullable); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + return ok; +} + + +utility::string_t AddVirtualColumnOutputEntry::getColumn() const +{ + return m_Column; +} + + +void AddVirtualColumnOutputEntry::setColumn(const utility::string_t& value) +{ + m_Column = value; + m_ColumnIsSet = true; +} + +bool AddVirtualColumnOutputEntry::columnIsSet() const +{ + return m_ColumnIsSet; +} + +void AddVirtualColumnOutputEntry::unsetColumn() +{ + m_ColumnIsSet = false; +} +utility::string_t AddVirtualColumnOutputEntry::getStructField() const +{ + return m_Struct_field; +} + + +void AddVirtualColumnOutputEntry::setStructField(const utility::string_t& value) +{ + m_Struct_field = value; + m_Struct_fieldIsSet = true; +} + +bool AddVirtualColumnOutputEntry::structFieldIsSet() const +{ + return m_Struct_fieldIsSet; +} + +void AddVirtualColumnOutputEntry::unsetStruct_field() +{ + m_Struct_fieldIsSet = false; +} +std::shared_ptr AddVirtualColumnOutputEntry::getDataType() const +{ + return m_Data_type; +} + + +void AddVirtualColumnOutputEntry::setDataType(const std::shared_ptr& value) +{ + m_Data_type = value; + m_Data_typeIsSet = true; +} + +bool AddVirtualColumnOutputEntry::dataTypeIsSet() const +{ + return m_Data_typeIsSet; +} + +void AddVirtualColumnOutputEntry::unsetData_type() +{ + m_Data_typeIsSet = false; +} +bool AddVirtualColumnOutputEntry::isNullable() const +{ + return m_Nullable; +} + +void AddVirtualColumnOutputEntry::setNullable(bool value) +{ + m_Nullable = value; + m_NullableIsSet = true; +} + +bool AddVirtualColumnOutputEntry::nullableIsSet() const +{ + return m_NullableIsSet; +} + +void AddVirtualColumnOutputEntry::unsetNullable() +{ + m_NullableIsSet = false; +} +std::map AddVirtualColumnOutputEntry::getMetadata() const +{ + return m_Metadata; +} + + +void AddVirtualColumnOutputEntry::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool AddVirtualColumnOutputEntry::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void AddVirtualColumnOutputEntry::unsetMetadata() +{ + m_MetadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterColumnsEntry.cpp b/cpp/lance_namespace_rest_client/src/model/AlterColumnsEntry.cpp new file mode 100644 index 000000000..bd50e6e69 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterColumnsEntry.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterColumnsEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterColumnsEntry::AlterColumnsEntry() +{ + m_Path = utility::conversions::to_string_t(""); + m_PathIsSet = false; + m_Data_typeIsSet = false; + m_Rename = utility::conversions::to_string_t(""); + m_RenameIsSet = false; + m_Nullable = false; + m_NullableIsSet = false; + m_Virtual_columnIsSet = false; +} + +AlterColumnsEntry::~AlterColumnsEntry() +{ +} + +void AlterColumnsEntry::validate() +{ + // TODO: implement validation +} + +web::json::value AlterColumnsEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_PathIsSet) + { + + val[utility::conversions::to_string_t(U("path"))] = ModelBase::toJson(m_Path); + } + if(m_Data_typeIsSet) + { + + val[utility::conversions::to_string_t(U("data_type"))] = ModelBase::toJson(m_Data_type); + } + if(m_RenameIsSet) + { + + val[utility::conversions::to_string_t(U("rename"))] = ModelBase::toJson(m_Rename); + } + if(m_NullableIsSet) + { + + val[utility::conversions::to_string_t(U("nullable"))] = ModelBase::toJson(m_Nullable); + } + if(m_Virtual_columnIsSet) + { + + val[utility::conversions::to_string_t(U("virtual_column"))] = ModelBase::toJson(m_Virtual_column); + } + + return val; +} + +bool AlterColumnsEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("path")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("path"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPath; + ok &= ModelBase::fromJson(fieldValue, refVal_setPath); + setPath(refVal_setPath); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("data_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("data_type"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDataType; + ok &= ModelBase::fromJson(fieldValue, refVal_setDataType); + setDataType(refVal_setDataType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("rename")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("rename"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setRename; + ok &= ModelBase::fromJson(fieldValue, refVal_setRename); + setRename(refVal_setRename); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("nullable")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("nullable"))); + if(!fieldValue.is_null()) + { + bool refVal_setNullable; + ok &= ModelBase::fromJson(fieldValue, refVal_setNullable); + setNullable(refVal_setNullable); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("virtual_column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("virtual_column"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVirtualColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setVirtualColumn); + setVirtualColumn(refVal_setVirtualColumn); + + } + } + return ok; +} + +void AlterColumnsEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_PathIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("path")), m_Path)); + } + if(m_Data_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("data_type")), m_Data_type)); + } + if(m_RenameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("rename")), m_Rename)); + } + if(m_NullableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("nullable")), m_Nullable)); + } + if(m_Virtual_columnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("virtual_column")), m_Virtual_column)); + } +} + +bool AlterColumnsEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("path")))) + { + utility::string_t refVal_setPath; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("path"))), refVal_setPath ); + setPath(refVal_setPath); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("data_type")))) + { + std::shared_ptr refVal_setDataType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("data_type"))), refVal_setDataType ); + setDataType(refVal_setDataType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("rename")))) + { + utility::string_t refVal_setRename; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("rename"))), refVal_setRename ); + setRename(refVal_setRename); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("nullable")))) + { + bool refVal_setNullable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("nullable"))), refVal_setNullable ); + setNullable(refVal_setNullable); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("virtual_column")))) + { + std::shared_ptr refVal_setVirtualColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("virtual_column"))), refVal_setVirtualColumn ); + setVirtualColumn(refVal_setVirtualColumn); + } + return ok; +} + + +utility::string_t AlterColumnsEntry::getPath() const +{ + return m_Path; +} + + +void AlterColumnsEntry::setPath(const utility::string_t& value) +{ + m_Path = value; + m_PathIsSet = true; +} + +bool AlterColumnsEntry::pathIsSet() const +{ + return m_PathIsSet; +} + +void AlterColumnsEntry::unsetPath() +{ + m_PathIsSet = false; +} +std::shared_ptr AlterColumnsEntry::getDataType() const +{ + return m_Data_type; +} + + +void AlterColumnsEntry::setDataType(const std::shared_ptr& value) +{ + m_Data_type = value; + m_Data_typeIsSet = true; +} + +bool AlterColumnsEntry::dataTypeIsSet() const +{ + return m_Data_typeIsSet; +} + +void AlterColumnsEntry::unsetData_type() +{ + m_Data_typeIsSet = false; +} +utility::string_t AlterColumnsEntry::getRename() const +{ + return m_Rename; +} + + +void AlterColumnsEntry::setRename(const utility::string_t& value) +{ + m_Rename = value; + m_RenameIsSet = true; +} + +bool AlterColumnsEntry::renameIsSet() const +{ + return m_RenameIsSet; +} + +void AlterColumnsEntry::unsetRename() +{ + m_RenameIsSet = false; +} +bool AlterColumnsEntry::isNullable() const +{ + return m_Nullable; +} + +void AlterColumnsEntry::setNullable(bool value) +{ + m_Nullable = value; + m_NullableIsSet = true; +} + +bool AlterColumnsEntry::nullableIsSet() const +{ + return m_NullableIsSet; +} + +void AlterColumnsEntry::unsetNullable() +{ + m_NullableIsSet = false; +} +std::shared_ptr AlterColumnsEntry::getVirtualColumn() const +{ + return m_Virtual_column; +} + + +void AlterColumnsEntry::setVirtualColumn(const std::shared_ptr& value) +{ + m_Virtual_column = value; + m_Virtual_columnIsSet = true; +} + +bool AlterColumnsEntry::virtualColumnIsSet() const +{ + return m_Virtual_columnIsSet; +} + +void AlterColumnsEntry::unsetVirtual_column() +{ + m_Virtual_columnIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsRequest.cpp new file mode 100644 index 000000000..b80a99273 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableAddColumnsRequest::AlterTableAddColumnsRequest() +{ + m_IdentityIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_New_columnsIsSet = false; +} + +AlterTableAddColumnsRequest::~AlterTableAddColumnsRequest() +{ +} + +void AlterTableAddColumnsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableAddColumnsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_New_columnsIsSet) + { + + val[utility::conversions::to_string_t(U("new_columns"))] = ModelBase::toJson(m_New_columns); + } + + return val; +} + +bool AlterTableAddColumnsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("new_columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("new_columns"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setNewColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setNewColumns); + setNewColumns(refVal_setNewColumns); + + } + } + return ok; +} + +void AlterTableAddColumnsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_New_columnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("new_columns")), m_New_columns)); + } +} + +bool AlterTableAddColumnsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("new_columns")))) + { + std::vector> refVal_setNewColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("new_columns"))), refVal_setNewColumns ); + setNewColumns(refVal_setNewColumns); + } + return ok; +} + + +std::shared_ptr AlterTableAddColumnsRequest::getIdentity() const +{ + return m_Identity; +} + + +void AlterTableAddColumnsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool AlterTableAddColumnsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void AlterTableAddColumnsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::vector AlterTableAddColumnsRequest::getId() const +{ + return m_Id; +} + + +void AlterTableAddColumnsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool AlterTableAddColumnsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void AlterTableAddColumnsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t AlterTableAddColumnsRequest::getBranch() const +{ + return m_Branch; +} + + +void AlterTableAddColumnsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool AlterTableAddColumnsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void AlterTableAddColumnsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::vector> AlterTableAddColumnsRequest::getNewColumns() const +{ + return m_New_columns; +} + + +void AlterTableAddColumnsRequest::setNewColumns(const std::vector>& value) +{ + m_New_columns = value; + m_New_columnsIsSet = true; +} + +bool AlterTableAddColumnsRequest::newColumnsIsSet() const +{ + return m_New_columnsIsSet; +} + +void AlterTableAddColumnsRequest::unsetNew_columns() +{ + m_New_columnsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsResponse.cpp new file mode 100644 index 000000000..dc3272e7d --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableAddColumnsResponse.cpp @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableAddColumnsResponse::AlterTableAddColumnsResponse() +{ + m_Version = 0L; + m_VersionIsSet = false; +} + +AlterTableAddColumnsResponse::~AlterTableAddColumnsResponse() +{ +} + +void AlterTableAddColumnsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableAddColumnsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool AlterTableAddColumnsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void AlterTableAddColumnsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool AlterTableAddColumnsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +int64_t AlterTableAddColumnsResponse::getVersion() const +{ + return m_Version; +} + +void AlterTableAddColumnsResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool AlterTableAddColumnsResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void AlterTableAddColumnsResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsRequest.cpp new file mode 100644 index 000000000..dad481b32 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableAlterColumnsRequest::AlterTableAlterColumnsRequest() +{ + m_IdentityIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_AlterationsIsSet = false; +} + +AlterTableAlterColumnsRequest::~AlterTableAlterColumnsRequest() +{ +} + +void AlterTableAlterColumnsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableAlterColumnsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_AlterationsIsSet) + { + + val[utility::conversions::to_string_t(U("alterations"))] = ModelBase::toJson(m_Alterations); + } + + return val; +} + +bool AlterTableAlterColumnsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("alterations")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("alterations"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setAlterations; + ok &= ModelBase::fromJson(fieldValue, refVal_setAlterations); + setAlterations(refVal_setAlterations); + + } + } + return ok; +} + +void AlterTableAlterColumnsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_AlterationsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("alterations")), m_Alterations)); + } +} + +bool AlterTableAlterColumnsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("alterations")))) + { + std::vector> refVal_setAlterations; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("alterations"))), refVal_setAlterations ); + setAlterations(refVal_setAlterations); + } + return ok; +} + + +std::shared_ptr AlterTableAlterColumnsRequest::getIdentity() const +{ + return m_Identity; +} + + +void AlterTableAlterColumnsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool AlterTableAlterColumnsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void AlterTableAlterColumnsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::vector AlterTableAlterColumnsRequest::getId() const +{ + return m_Id; +} + + +void AlterTableAlterColumnsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool AlterTableAlterColumnsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void AlterTableAlterColumnsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t AlterTableAlterColumnsRequest::getBranch() const +{ + return m_Branch; +} + + +void AlterTableAlterColumnsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool AlterTableAlterColumnsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void AlterTableAlterColumnsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::vector> AlterTableAlterColumnsRequest::getAlterations() const +{ + return m_Alterations; +} + + +void AlterTableAlterColumnsRequest::setAlterations(const std::vector>& value) +{ + m_Alterations = value; + m_AlterationsIsSet = true; +} + +bool AlterTableAlterColumnsRequest::alterationsIsSet() const +{ + return m_AlterationsIsSet; +} + +void AlterTableAlterColumnsRequest::unsetAlterations() +{ + m_AlterationsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsResponse.cpp new file mode 100644 index 000000000..155eb5f56 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableAlterColumnsResponse.cpp @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableAlterColumnsResponse::AlterTableAlterColumnsResponse() +{ + m_Version = 0L; + m_VersionIsSet = false; +} + +AlterTableAlterColumnsResponse::~AlterTableAlterColumnsResponse() +{ +} + +void AlterTableAlterColumnsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableAlterColumnsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool AlterTableAlterColumnsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void AlterTableAlterColumnsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool AlterTableAlterColumnsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +int64_t AlterTableAlterColumnsResponse::getVersion() const +{ + return m_Version; +} + +void AlterTableAlterColumnsResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool AlterTableAlterColumnsResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void AlterTableAlterColumnsResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsRequest.cpp new file mode 100644 index 000000000..9cd09ab61 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsRequest.cpp @@ -0,0 +1,896 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableBackfillColumnsRequest::AlterTableBackfillColumnsRequest() +{ + m_IdentityIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Column = utility::conversions::to_string_t(""); + m_ColumnIsSet = false; + m_Where = utility::conversions::to_string_t(""); + m_WhereIsSet = false; + m_Concurrency = 0; + m_ConcurrencyIsSet = false; + m_Intra_applier_concurrency = 0; + m_Intra_applier_concurrencyIsSet = false; + m_Min_checkpoint_size = 0; + m_Min_checkpoint_sizeIsSet = false; + m_Max_checkpoint_size = 0; + m_Max_checkpoint_sizeIsSet = false; + m_Batch_checkpoint_flush_interval_seconds = 0.0; + m_Batch_checkpoint_flush_interval_secondsIsSet = false; + m_Read_version = 0; + m_Read_versionIsSet = false; + m_Task_size = 0; + m_Task_sizeIsSet = false; + m_Num_frags = 0; + m_Num_fragsIsSet = false; + m_Checkpoint_size = 0; + m_Checkpoint_sizeIsSet = false; + m_Commit_granularity = 0; + m_Commit_granularityIsSet = false; + m_Cluster = utility::conversions::to_string_t(""); + m_ClusterIsSet = false; + m_Manifest = utility::conversions::to_string_t(""); + m_ManifestIsSet = false; +} + +AlterTableBackfillColumnsRequest::~AlterTableBackfillColumnsRequest() +{ +} + +void AlterTableBackfillColumnsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableBackfillColumnsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_ColumnIsSet) + { + + val[utility::conversions::to_string_t(U("column"))] = ModelBase::toJson(m_Column); + } + if(m_WhereIsSet) + { + + val[utility::conversions::to_string_t(U("where"))] = ModelBase::toJson(m_Where); + } + if(m_ConcurrencyIsSet) + { + + val[utility::conversions::to_string_t(U("concurrency"))] = ModelBase::toJson(m_Concurrency); + } + if(m_Intra_applier_concurrencyIsSet) + { + + val[utility::conversions::to_string_t(U("intra_applier_concurrency"))] = ModelBase::toJson(m_Intra_applier_concurrency); + } + if(m_Min_checkpoint_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("min_checkpoint_size"))] = ModelBase::toJson(m_Min_checkpoint_size); + } + if(m_Max_checkpoint_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("max_checkpoint_size"))] = ModelBase::toJson(m_Max_checkpoint_size); + } + if(m_Batch_checkpoint_flush_interval_secondsIsSet) + { + + val[utility::conversions::to_string_t(U("batch_checkpoint_flush_interval_seconds"))] = ModelBase::toJson(m_Batch_checkpoint_flush_interval_seconds); + } + if(m_Read_versionIsSet) + { + + val[utility::conversions::to_string_t(U("read_version"))] = ModelBase::toJson(m_Read_version); + } + if(m_Task_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("task_size"))] = ModelBase::toJson(m_Task_size); + } + if(m_Num_fragsIsSet) + { + + val[utility::conversions::to_string_t(U("num_frags"))] = ModelBase::toJson(m_Num_frags); + } + if(m_Checkpoint_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("checkpoint_size"))] = ModelBase::toJson(m_Checkpoint_size); + } + if(m_Commit_granularityIsSet) + { + + val[utility::conversions::to_string_t(U("commit_granularity"))] = ModelBase::toJson(m_Commit_granularity); + } + if(m_ClusterIsSet) + { + + val[utility::conversions::to_string_t(U("cluster"))] = ModelBase::toJson(m_Cluster); + } + if(m_ManifestIsSet) + { + + val[utility::conversions::to_string_t(U("manifest"))] = ModelBase::toJson(m_Manifest); + } + + return val; +} + +bool AlterTableBackfillColumnsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumn); + setColumn(refVal_setColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("where")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("where"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setWhere; + ok &= ModelBase::fromJson(fieldValue, refVal_setWhere); + setWhere(refVal_setWhere); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("concurrency")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("concurrency"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setConcurrency; + ok &= ModelBase::fromJson(fieldValue, refVal_setConcurrency); + setConcurrency(refVal_setConcurrency); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("intra_applier_concurrency")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("intra_applier_concurrency"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setIntraApplierConcurrency; + ok &= ModelBase::fromJson(fieldValue, refVal_setIntraApplierConcurrency); + setIntraApplierConcurrency(refVal_setIntraApplierConcurrency); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("min_checkpoint_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("min_checkpoint_size"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setMinCheckpointSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setMinCheckpointSize); + setMinCheckpointSize(refVal_setMinCheckpointSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("max_checkpoint_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("max_checkpoint_size"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setMaxCheckpointSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setMaxCheckpointSize); + setMaxCheckpointSize(refVal_setMaxCheckpointSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("batch_checkpoint_flush_interval_seconds")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("batch_checkpoint_flush_interval_seconds"))); + if(!fieldValue.is_null()) + { + double refVal_setBatchCheckpointFlushIntervalSeconds; + ok &= ModelBase::fromJson(fieldValue, refVal_setBatchCheckpointFlushIntervalSeconds); + setBatchCheckpointFlushIntervalSeconds(refVal_setBatchCheckpointFlushIntervalSeconds); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("read_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("read_version"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setReadVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setReadVersion); + setReadVersion(refVal_setReadVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("task_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("task_size"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setTaskSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setTaskSize); + setTaskSize(refVal_setTaskSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_frags")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_frags"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNumFrags; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumFrags); + setNumFrags(refVal_setNumFrags); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("checkpoint_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("checkpoint_size"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setCheckpointSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setCheckpointSize); + setCheckpointSize(refVal_setCheckpointSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("commit_granularity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("commit_granularity"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setCommitGranularity; + ok &= ModelBase::fromJson(fieldValue, refVal_setCommitGranularity); + setCommitGranularity(refVal_setCommitGranularity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("cluster")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("cluster"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setCluster; + ok &= ModelBase::fromJson(fieldValue, refVal_setCluster); + setCluster(refVal_setCluster); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifest); + setManifest(refVal_setManifest); + + } + } + return ok; +} + +void AlterTableBackfillColumnsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_ColumnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column")), m_Column)); + } + if(m_WhereIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("where")), m_Where)); + } + if(m_ConcurrencyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("concurrency")), m_Concurrency)); + } + if(m_Intra_applier_concurrencyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("intra_applier_concurrency")), m_Intra_applier_concurrency)); + } + if(m_Min_checkpoint_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("min_checkpoint_size")), m_Min_checkpoint_size)); + } + if(m_Max_checkpoint_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("max_checkpoint_size")), m_Max_checkpoint_size)); + } + if(m_Batch_checkpoint_flush_interval_secondsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("batch_checkpoint_flush_interval_seconds")), m_Batch_checkpoint_flush_interval_seconds)); + } + if(m_Read_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("read_version")), m_Read_version)); + } + if(m_Task_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("task_size")), m_Task_size)); + } + if(m_Num_fragsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_frags")), m_Num_frags)); + } + if(m_Checkpoint_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("checkpoint_size")), m_Checkpoint_size)); + } + if(m_Commit_granularityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("commit_granularity")), m_Commit_granularity)); + } + if(m_ClusterIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("cluster")), m_Cluster)); + } + if(m_ManifestIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest")), m_Manifest)); + } +} + +bool AlterTableBackfillColumnsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("column")))) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column"))), refVal_setColumn ); + setColumn(refVal_setColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("where")))) + { + utility::string_t refVal_setWhere; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("where"))), refVal_setWhere ); + setWhere(refVal_setWhere); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("concurrency")))) + { + int32_t refVal_setConcurrency; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("concurrency"))), refVal_setConcurrency ); + setConcurrency(refVal_setConcurrency); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("intra_applier_concurrency")))) + { + int32_t refVal_setIntraApplierConcurrency; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("intra_applier_concurrency"))), refVal_setIntraApplierConcurrency ); + setIntraApplierConcurrency(refVal_setIntraApplierConcurrency); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("min_checkpoint_size")))) + { + int32_t refVal_setMinCheckpointSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("min_checkpoint_size"))), refVal_setMinCheckpointSize ); + setMinCheckpointSize(refVal_setMinCheckpointSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("max_checkpoint_size")))) + { + int32_t refVal_setMaxCheckpointSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("max_checkpoint_size"))), refVal_setMaxCheckpointSize ); + setMaxCheckpointSize(refVal_setMaxCheckpointSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("batch_checkpoint_flush_interval_seconds")))) + { + double refVal_setBatchCheckpointFlushIntervalSeconds; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("batch_checkpoint_flush_interval_seconds"))), refVal_setBatchCheckpointFlushIntervalSeconds ); + setBatchCheckpointFlushIntervalSeconds(refVal_setBatchCheckpointFlushIntervalSeconds); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("read_version")))) + { + int32_t refVal_setReadVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("read_version"))), refVal_setReadVersion ); + setReadVersion(refVal_setReadVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("task_size")))) + { + int32_t refVal_setTaskSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("task_size"))), refVal_setTaskSize ); + setTaskSize(refVal_setTaskSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_frags")))) + { + int32_t refVal_setNumFrags; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_frags"))), refVal_setNumFrags ); + setNumFrags(refVal_setNumFrags); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("checkpoint_size")))) + { + int32_t refVal_setCheckpointSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("checkpoint_size"))), refVal_setCheckpointSize ); + setCheckpointSize(refVal_setCheckpointSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("commit_granularity")))) + { + int32_t refVal_setCommitGranularity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("commit_granularity"))), refVal_setCommitGranularity ); + setCommitGranularity(refVal_setCommitGranularity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("cluster")))) + { + utility::string_t refVal_setCluster; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("cluster"))), refVal_setCluster ); + setCluster(refVal_setCluster); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest")))) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest"))), refVal_setManifest ); + setManifest(refVal_setManifest); + } + return ok; +} + + +std::shared_ptr AlterTableBackfillColumnsRequest::getIdentity() const +{ + return m_Identity; +} + + +void AlterTableBackfillColumnsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::vector AlterTableBackfillColumnsRequest::getId() const +{ + return m_Id; +} + + +void AlterTableBackfillColumnsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t AlterTableBackfillColumnsRequest::getBranch() const +{ + return m_Branch; +} + + +void AlterTableBackfillColumnsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t AlterTableBackfillColumnsRequest::getColumn() const +{ + return m_Column; +} + + +void AlterTableBackfillColumnsRequest::setColumn(const utility::string_t& value) +{ + m_Column = value; + m_ColumnIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::columnIsSet() const +{ + return m_ColumnIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetColumn() +{ + m_ColumnIsSet = false; +} +utility::string_t AlterTableBackfillColumnsRequest::getWhere() const +{ + return m_Where; +} + + +void AlterTableBackfillColumnsRequest::setWhere(const utility::string_t& value) +{ + m_Where = value; + m_WhereIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::whereIsSet() const +{ + return m_WhereIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetWhere() +{ + m_WhereIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getConcurrency() const +{ + return m_Concurrency; +} + +void AlterTableBackfillColumnsRequest::setConcurrency(int32_t value) +{ + m_Concurrency = value; + m_ConcurrencyIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::concurrencyIsSet() const +{ + return m_ConcurrencyIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetConcurrency() +{ + m_ConcurrencyIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getIntraApplierConcurrency() const +{ + return m_Intra_applier_concurrency; +} + +void AlterTableBackfillColumnsRequest::setIntraApplierConcurrency(int32_t value) +{ + m_Intra_applier_concurrency = value; + m_Intra_applier_concurrencyIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::intraApplierConcurrencyIsSet() const +{ + return m_Intra_applier_concurrencyIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetIntra_applier_concurrency() +{ + m_Intra_applier_concurrencyIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getMinCheckpointSize() const +{ + return m_Min_checkpoint_size; +} + +void AlterTableBackfillColumnsRequest::setMinCheckpointSize(int32_t value) +{ + m_Min_checkpoint_size = value; + m_Min_checkpoint_sizeIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::minCheckpointSizeIsSet() const +{ + return m_Min_checkpoint_sizeIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetMin_checkpoint_size() +{ + m_Min_checkpoint_sizeIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getMaxCheckpointSize() const +{ + return m_Max_checkpoint_size; +} + +void AlterTableBackfillColumnsRequest::setMaxCheckpointSize(int32_t value) +{ + m_Max_checkpoint_size = value; + m_Max_checkpoint_sizeIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::maxCheckpointSizeIsSet() const +{ + return m_Max_checkpoint_sizeIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetMax_checkpoint_size() +{ + m_Max_checkpoint_sizeIsSet = false; +} +double AlterTableBackfillColumnsRequest::getBatchCheckpointFlushIntervalSeconds() const +{ + return m_Batch_checkpoint_flush_interval_seconds; +} + +void AlterTableBackfillColumnsRequest::setBatchCheckpointFlushIntervalSeconds(double value) +{ + m_Batch_checkpoint_flush_interval_seconds = value; + m_Batch_checkpoint_flush_interval_secondsIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::batchCheckpointFlushIntervalSecondsIsSet() const +{ + return m_Batch_checkpoint_flush_interval_secondsIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetBatch_checkpoint_flush_interval_seconds() +{ + m_Batch_checkpoint_flush_interval_secondsIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getReadVersion() const +{ + return m_Read_version; +} + +void AlterTableBackfillColumnsRequest::setReadVersion(int32_t value) +{ + m_Read_version = value; + m_Read_versionIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::readVersionIsSet() const +{ + return m_Read_versionIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetRead_version() +{ + m_Read_versionIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getTaskSize() const +{ + return m_Task_size; +} + +void AlterTableBackfillColumnsRequest::setTaskSize(int32_t value) +{ + m_Task_size = value; + m_Task_sizeIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::taskSizeIsSet() const +{ + return m_Task_sizeIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetTask_size() +{ + m_Task_sizeIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getNumFrags() const +{ + return m_Num_frags; +} + +void AlterTableBackfillColumnsRequest::setNumFrags(int32_t value) +{ + m_Num_frags = value; + m_Num_fragsIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::numFragsIsSet() const +{ + return m_Num_fragsIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetNum_frags() +{ + m_Num_fragsIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getCheckpointSize() const +{ + return m_Checkpoint_size; +} + +void AlterTableBackfillColumnsRequest::setCheckpointSize(int32_t value) +{ + m_Checkpoint_size = value; + m_Checkpoint_sizeIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::checkpointSizeIsSet() const +{ + return m_Checkpoint_sizeIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetCheckpoint_size() +{ + m_Checkpoint_sizeIsSet = false; +} +int32_t AlterTableBackfillColumnsRequest::getCommitGranularity() const +{ + return m_Commit_granularity; +} + +void AlterTableBackfillColumnsRequest::setCommitGranularity(int32_t value) +{ + m_Commit_granularity = value; + m_Commit_granularityIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::commitGranularityIsSet() const +{ + return m_Commit_granularityIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetCommit_granularity() +{ + m_Commit_granularityIsSet = false; +} +utility::string_t AlterTableBackfillColumnsRequest::getCluster() const +{ + return m_Cluster; +} + + +void AlterTableBackfillColumnsRequest::setCluster(const utility::string_t& value) +{ + m_Cluster = value; + m_ClusterIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::clusterIsSet() const +{ + return m_ClusterIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetCluster() +{ + m_ClusterIsSet = false; +} +utility::string_t AlterTableBackfillColumnsRequest::getManifest() const +{ + return m_Manifest; +} + + +void AlterTableBackfillColumnsRequest::setManifest(const utility::string_t& value) +{ + m_Manifest = value; + m_ManifestIsSet = true; +} + +bool AlterTableBackfillColumnsRequest::manifestIsSet() const +{ + return m_ManifestIsSet; +} + +void AlterTableBackfillColumnsRequest::unsetManifest() +{ + m_ManifestIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsResponse.cpp new file mode 100644 index 000000000..024034358 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableBackfillColumnsResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableBackfillColumnsResponse::AlterTableBackfillColumnsResponse() +{ + m_Job_id = utility::conversions::to_string_t(""); + m_Job_idIsSet = false; +} + +AlterTableBackfillColumnsResponse::~AlterTableBackfillColumnsResponse() +{ +} + +void AlterTableBackfillColumnsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableBackfillColumnsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Job_idIsSet) + { + + val[utility::conversions::to_string_t(U("job_id"))] = ModelBase::toJson(m_Job_id); + } + + return val; +} + +bool AlterTableBackfillColumnsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("job_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("job_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setJobId; + ok &= ModelBase::fromJson(fieldValue, refVal_setJobId); + setJobId(refVal_setJobId); + + } + } + return ok; +} + +void AlterTableBackfillColumnsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Job_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("job_id")), m_Job_id)); + } +} + +bool AlterTableBackfillColumnsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("job_id")))) + { + utility::string_t refVal_setJobId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("job_id"))), refVal_setJobId ); + setJobId(refVal_setJobId); + } + return ok; +} + + +utility::string_t AlterTableBackfillColumnsResponse::getJobId() const +{ + return m_Job_id; +} + + +void AlterTableBackfillColumnsResponse::setJobId(const utility::string_t& value) +{ + m_Job_id = value; + m_Job_idIsSet = true; +} + +bool AlterTableBackfillColumnsResponse::jobIdIsSet() const +{ + return m_Job_idIsSet; +} + +void AlterTableBackfillColumnsResponse::unsetJob_id() +{ + m_Job_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsRequest.cpp new file mode 100644 index 000000000..a8610efcf --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableDropColumnsRequest::AlterTableDropColumnsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_ColumnsIsSet = false; +} + +AlterTableDropColumnsRequest::~AlterTableDropColumnsRequest() +{ +} + +void AlterTableDropColumnsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableDropColumnsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_ColumnsIsSet) + { + + val[utility::conversions::to_string_t(U("columns"))] = ModelBase::toJson(m_Columns); + } + + return val; +} + +bool AlterTableDropColumnsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("columns"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumns); + setColumns(refVal_setColumns); + + } + } + return ok; +} + +void AlterTableDropColumnsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_ColumnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("columns")), m_Columns)); + } +} + +bool AlterTableDropColumnsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("columns")))) + { + std::vector refVal_setColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("columns"))), refVal_setColumns ); + setColumns(refVal_setColumns); + } + return ok; +} + + +std::shared_ptr AlterTableDropColumnsRequest::getIdentity() const +{ + return m_Identity; +} + + +void AlterTableDropColumnsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool AlterTableDropColumnsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void AlterTableDropColumnsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map AlterTableDropColumnsRequest::getContext() const +{ + return m_Context; +} + + +void AlterTableDropColumnsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool AlterTableDropColumnsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void AlterTableDropColumnsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector AlterTableDropColumnsRequest::getId() const +{ + return m_Id; +} + + +void AlterTableDropColumnsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool AlterTableDropColumnsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void AlterTableDropColumnsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t AlterTableDropColumnsRequest::getBranch() const +{ + return m_Branch; +} + + +void AlterTableDropColumnsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool AlterTableDropColumnsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void AlterTableDropColumnsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::vector AlterTableDropColumnsRequest::getColumns() const +{ + return m_Columns; +} + + +void AlterTableDropColumnsRequest::setColumns(const std::vector& value) +{ + m_Columns = value; + m_ColumnsIsSet = true; +} + +bool AlterTableDropColumnsRequest::columnsIsSet() const +{ + return m_ColumnsIsSet; +} + +void AlterTableDropColumnsRequest::unsetColumns() +{ + m_ColumnsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsResponse.cpp new file mode 100644 index 000000000..3545cb3b9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTableDropColumnsResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTableDropColumnsResponse::AlterTableDropColumnsResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; +} + +AlterTableDropColumnsResponse::~AlterTableDropColumnsResponse() +{ +} + +void AlterTableDropColumnsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTableDropColumnsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool AlterTableDropColumnsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void AlterTableDropColumnsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool AlterTableDropColumnsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +utility::string_t AlterTableDropColumnsResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void AlterTableDropColumnsResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool AlterTableDropColumnsResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void AlterTableDropColumnsResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +int64_t AlterTableDropColumnsResponse::getVersion() const +{ + return m_Version; +} + +void AlterTableDropColumnsResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool AlterTableDropColumnsResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void AlterTableDropColumnsResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTransactionAction.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTransactionAction.cpp new file mode 100644 index 000000000..e347d4a74 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTransactionAction.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTransactionAction.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTransactionAction::AlterTransactionAction() +{ + m_SetStatusActionIsSet = false; + m_SetPropertyActionIsSet = false; + m_UnsetPropertyActionIsSet = false; +} + +AlterTransactionAction::~AlterTransactionAction() +{ +} + +void AlterTransactionAction::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTransactionAction::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_SetStatusActionIsSet) + { + + val[utility::conversions::to_string_t(U("setStatusAction"))] = ModelBase::toJson(m_SetStatusAction); + } + if(m_SetPropertyActionIsSet) + { + + val[utility::conversions::to_string_t(U("setPropertyAction"))] = ModelBase::toJson(m_SetPropertyAction); + } + if(m_UnsetPropertyActionIsSet) + { + + val[utility::conversions::to_string_t(U("unsetPropertyAction"))] = ModelBase::toJson(m_UnsetPropertyAction); + } + + return val; +} + +bool AlterTransactionAction::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("setStatusAction")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("setStatusAction"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setSetStatusAction; + ok &= ModelBase::fromJson(fieldValue, refVal_setSetStatusAction); + setSetStatusAction(refVal_setSetStatusAction); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("setPropertyAction")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("setPropertyAction"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setSetPropertyAction; + ok &= ModelBase::fromJson(fieldValue, refVal_setSetPropertyAction); + setSetPropertyAction(refVal_setSetPropertyAction); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("unsetPropertyAction")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("unsetPropertyAction"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setUnsetPropertyAction; + ok &= ModelBase::fromJson(fieldValue, refVal_setUnsetPropertyAction); + setUnsetPropertyAction(refVal_setUnsetPropertyAction); + + } + } + return ok; +} + +void AlterTransactionAction::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_SetStatusActionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("setStatusAction")), m_SetStatusAction)); + } + if(m_SetPropertyActionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("setPropertyAction")), m_SetPropertyAction)); + } + if(m_UnsetPropertyActionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("unsetPropertyAction")), m_UnsetPropertyAction)); + } +} + +bool AlterTransactionAction::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("setStatusAction")))) + { + std::shared_ptr refVal_setSetStatusAction; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("setStatusAction"))), refVal_setSetStatusAction ); + setSetStatusAction(refVal_setSetStatusAction); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("setPropertyAction")))) + { + std::shared_ptr refVal_setSetPropertyAction; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("setPropertyAction"))), refVal_setSetPropertyAction ); + setSetPropertyAction(refVal_setSetPropertyAction); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("unsetPropertyAction")))) + { + std::shared_ptr refVal_setUnsetPropertyAction; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("unsetPropertyAction"))), refVal_setUnsetPropertyAction ); + setUnsetPropertyAction(refVal_setUnsetPropertyAction); + } + return ok; +} + + +std::shared_ptr AlterTransactionAction::getSetStatusAction() const +{ + return m_SetStatusAction; +} + + +void AlterTransactionAction::setSetStatusAction(const std::shared_ptr& value) +{ + m_SetStatusAction = value; + m_SetStatusActionIsSet = true; +} + +bool AlterTransactionAction::setStatusActionIsSet() const +{ + return m_SetStatusActionIsSet; +} + +void AlterTransactionAction::unsetSetStatusAction() +{ + m_SetStatusActionIsSet = false; +} +std::shared_ptr AlterTransactionAction::getSetPropertyAction() const +{ + return m_SetPropertyAction; +} + + +void AlterTransactionAction::setSetPropertyAction(const std::shared_ptr& value) +{ + m_SetPropertyAction = value; + m_SetPropertyActionIsSet = true; +} + +bool AlterTransactionAction::setPropertyActionIsSet() const +{ + return m_SetPropertyActionIsSet; +} + +void AlterTransactionAction::unsetSetPropertyAction() +{ + m_SetPropertyActionIsSet = false; +} +std::shared_ptr AlterTransactionAction::getUnsetPropertyAction() const +{ + return m_UnsetPropertyAction; +} + + +void AlterTransactionAction::setUnsetPropertyAction(const std::shared_ptr& value) +{ + m_UnsetPropertyAction = value; + m_UnsetPropertyActionIsSet = true; +} + +bool AlterTransactionAction::unsetPropertyActionIsSet() const +{ + return m_UnsetPropertyActionIsSet; +} + +void AlterTransactionAction::unsetUnsetPropertyAction() +{ + m_UnsetPropertyActionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTransactionRequest.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTransactionRequest.cpp new file mode 100644 index 000000000..bbd895471 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTransactionRequest.cpp @@ -0,0 +1,267 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTransactionRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTransactionRequest::AlterTransactionRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_ActionsIsSet = false; +} + +AlterTransactionRequest::~AlterTransactionRequest() +{ +} + +void AlterTransactionRequest::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTransactionRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_ActionsIsSet) + { + + val[utility::conversions::to_string_t(U("actions"))] = ModelBase::toJson(m_Actions); + } + + return val; +} + +bool AlterTransactionRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("actions")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("actions"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setActions; + ok &= ModelBase::fromJson(fieldValue, refVal_setActions); + setActions(refVal_setActions); + + } + } + return ok; +} + +void AlterTransactionRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_ActionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("actions")), m_Actions)); + } +} + +bool AlterTransactionRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("actions")))) + { + std::vector> refVal_setActions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("actions"))), refVal_setActions ); + setActions(refVal_setActions); + } + return ok; +} + + +std::shared_ptr AlterTransactionRequest::getIdentity() const +{ + return m_Identity; +} + + +void AlterTransactionRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool AlterTransactionRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void AlterTransactionRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map AlterTransactionRequest::getContext() const +{ + return m_Context; +} + + +void AlterTransactionRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool AlterTransactionRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void AlterTransactionRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector AlterTransactionRequest::getId() const +{ + return m_Id; +} + + +void AlterTransactionRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool AlterTransactionRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void AlterTransactionRequest::unsetId() +{ + m_IdIsSet = false; +} +std::vector> AlterTransactionRequest::getActions() const +{ + return m_Actions; +} + + +void AlterTransactionRequest::setActions(const std::vector>& value) +{ + m_Actions = value; + m_ActionsIsSet = true; +} + +bool AlterTransactionRequest::actionsIsSet() const +{ + return m_ActionsIsSet; +} + +void AlterTransactionRequest::unsetActions() +{ + m_ActionsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTransactionResponse.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTransactionResponse.cpp new file mode 100644 index 000000000..96f5b6200 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTransactionResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTransactionResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTransactionResponse::AlterTransactionResponse() +{ + m_Status = utility::conversions::to_string_t(""); + m_StatusIsSet = false; + m_PropertiesIsSet = false; +} + +AlterTransactionResponse::~AlterTransactionResponse() +{ +} + +void AlterTransactionResponse::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTransactionResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_StatusIsSet) + { + + val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool AlterTransactionResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("status")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); + setStatus(refVal_setStatus); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void AlterTransactionResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_StatusIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool AlterTransactionResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); + setStatus(refVal_setStatus); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t AlterTransactionResponse::getStatus() const +{ + return m_Status; +} + + +void AlterTransactionResponse::setStatus(const utility::string_t& value) +{ + m_Status = value; + m_StatusIsSet = true; +} + +bool AlterTransactionResponse::statusIsSet() const +{ + return m_StatusIsSet; +} + +void AlterTransactionResponse::unsetStatus() +{ + m_StatusIsSet = false; +} +std::map AlterTransactionResponse::getProperties() const +{ + return m_Properties; +} + + +void AlterTransactionResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool AlterTransactionResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void AlterTransactionResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTransactionSetProperty.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTransactionSetProperty.cpp new file mode 100644 index 000000000..e51ea32b5 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTransactionSetProperty.cpp @@ -0,0 +1,222 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTransactionSetProperty.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTransactionSetProperty::AlterTransactionSetProperty() +{ + m_Key = utility::conversions::to_string_t(""); + m_KeyIsSet = false; + m_Value = utility::conversions::to_string_t(""); + m_ValueIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; +} + +AlterTransactionSetProperty::~AlterTransactionSetProperty() +{ +} + +void AlterTransactionSetProperty::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTransactionSetProperty::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_KeyIsSet) + { + + val[utility::conversions::to_string_t(U("key"))] = ModelBase::toJson(m_Key); + } + if(m_ValueIsSet) + { + + val[utility::conversions::to_string_t(U("value"))] = ModelBase::toJson(m_Value); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + + return val; +} + +bool AlterTransactionSetProperty::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("key")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("key"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setKey; + ok &= ModelBase::fromJson(fieldValue, refVal_setKey); + setKey(refVal_setKey); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("value")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("value"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setValue; + ok &= ModelBase::fromJson(fieldValue, refVal_setValue); + setValue(refVal_setValue); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + return ok; +} + +void AlterTransactionSetProperty::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_KeyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("key")), m_Key)); + } + if(m_ValueIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("value")), m_Value)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } +} + +bool AlterTransactionSetProperty::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("key")))) + { + utility::string_t refVal_setKey; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("key"))), refVal_setKey ); + setKey(refVal_setKey); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("value")))) + { + utility::string_t refVal_setValue; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("value"))), refVal_setValue ); + setValue(refVal_setValue); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + return ok; +} + + +utility::string_t AlterTransactionSetProperty::getKey() const +{ + return m_Key; +} + + +void AlterTransactionSetProperty::setKey(const utility::string_t& value) +{ + m_Key = value; + m_KeyIsSet = true; +} + +bool AlterTransactionSetProperty::keyIsSet() const +{ + return m_KeyIsSet; +} + +void AlterTransactionSetProperty::unsetKey() +{ + m_KeyIsSet = false; +} +utility::string_t AlterTransactionSetProperty::getValue() const +{ + return m_Value; +} + + +void AlterTransactionSetProperty::setValue(const utility::string_t& value) +{ + m_Value = value; + m_ValueIsSet = true; +} + +bool AlterTransactionSetProperty::valueIsSet() const +{ + return m_ValueIsSet; +} + +void AlterTransactionSetProperty::unsetValue() +{ + m_ValueIsSet = false; +} +utility::string_t AlterTransactionSetProperty::getMode() const +{ + return m_Mode; +} + + +void AlterTransactionSetProperty::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool AlterTransactionSetProperty::modeIsSet() const +{ + return m_ModeIsSet; +} + +void AlterTransactionSetProperty::unsetMode() +{ + m_ModeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTransactionSetStatus.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTransactionSetStatus.cpp new file mode 100644 index 000000000..82f0752de --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTransactionSetStatus.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTransactionSetStatus.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTransactionSetStatus::AlterTransactionSetStatus() +{ + m_Status = utility::conversions::to_string_t(""); + m_StatusIsSet = false; +} + +AlterTransactionSetStatus::~AlterTransactionSetStatus() +{ +} + +void AlterTransactionSetStatus::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTransactionSetStatus::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_StatusIsSet) + { + + val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status); + } + + return val; +} + +bool AlterTransactionSetStatus::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("status")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); + setStatus(refVal_setStatus); + + } + } + return ok; +} + +void AlterTransactionSetStatus::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_StatusIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status)); + } +} + +bool AlterTransactionSetStatus::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); + setStatus(refVal_setStatus); + } + return ok; +} + + +utility::string_t AlterTransactionSetStatus::getStatus() const +{ + return m_Status; +} + + +void AlterTransactionSetStatus::setStatus(const utility::string_t& value) +{ + m_Status = value; + m_StatusIsSet = true; +} + +bool AlterTransactionSetStatus::statusIsSet() const +{ + return m_StatusIsSet; +} + +void AlterTransactionSetStatus::unsetStatus() +{ + m_StatusIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterTransactionUnsetProperty.cpp b/cpp/lance_namespace_rest_client/src/model/AlterTransactionUnsetProperty.cpp new file mode 100644 index 000000000..0532947a3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterTransactionUnsetProperty.cpp @@ -0,0 +1,173 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterTransactionUnsetProperty::AlterTransactionUnsetProperty() +{ + m_Key = utility::conversions::to_string_t(""); + m_KeyIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; +} + +AlterTransactionUnsetProperty::~AlterTransactionUnsetProperty() +{ +} + +void AlterTransactionUnsetProperty::validate() +{ + // TODO: implement validation +} + +web::json::value AlterTransactionUnsetProperty::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_KeyIsSet) + { + + val[utility::conversions::to_string_t(U("key"))] = ModelBase::toJson(m_Key); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + + return val; +} + +bool AlterTransactionUnsetProperty::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("key")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("key"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setKey; + ok &= ModelBase::fromJson(fieldValue, refVal_setKey); + setKey(refVal_setKey); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + return ok; +} + +void AlterTransactionUnsetProperty::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_KeyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("key")), m_Key)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } +} + +bool AlterTransactionUnsetProperty::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("key")))) + { + utility::string_t refVal_setKey; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("key"))), refVal_setKey ); + setKey(refVal_setKey); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + return ok; +} + + +utility::string_t AlterTransactionUnsetProperty::getKey() const +{ + return m_Key; +} + + +void AlterTransactionUnsetProperty::setKey(const utility::string_t& value) +{ + m_Key = value; + m_KeyIsSet = true; +} + +bool AlterTransactionUnsetProperty::keyIsSet() const +{ + return m_KeyIsSet; +} + +void AlterTransactionUnsetProperty::unsetKey() +{ + m_KeyIsSet = false; +} +utility::string_t AlterTransactionUnsetProperty::getMode() const +{ + return m_Mode; +} + + +void AlterTransactionUnsetProperty::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool AlterTransactionUnsetProperty::modeIsSet() const +{ + return m_ModeIsSet; +} + +void AlterTransactionUnsetProperty::unsetMode() +{ + m_ModeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AlterVirtualColumnEntry.cpp b/cpp/lance_namespace_rest_client/src/model/AlterVirtualColumnEntry.cpp new file mode 100644 index 000000000..c61b28e9a --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AlterVirtualColumnEntry.cpp @@ -0,0 +1,562 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AlterVirtualColumnEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AlterVirtualColumnEntry::AlterVirtualColumnEntry() +{ + m_Input_columnsIsSet = false; + m_Image = utility::conversions::to_string_t(""); + m_ImageIsSet = false; + m_Udf = utility::conversions::to_string_t(""); + m_UdfIsSet = false; + m_Udf_name = utility::conversions::to_string_t(""); + m_Udf_nameIsSet = false; + m_Udf_version = utility::conversions::to_string_t(""); + m_Udf_versionIsSet = false; + m_Udf_backend = utility::conversions::to_string_t(""); + m_Udf_backendIsSet = false; + m_Auto_backfill = false; + m_Auto_backfillIsSet = false; + m_Manifest = utility::conversions::to_string_t(""); + m_ManifestIsSet = false; + m_Manifest_checksum = utility::conversions::to_string_t(""); + m_Manifest_checksumIsSet = false; + m_Field_metadataIsSet = false; +} + +AlterVirtualColumnEntry::~AlterVirtualColumnEntry() +{ +} + +void AlterVirtualColumnEntry::validate() +{ + // TODO: implement validation +} + +web::json::value AlterVirtualColumnEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Input_columnsIsSet) + { + + val[utility::conversions::to_string_t(U("input_columns"))] = ModelBase::toJson(m_Input_columns); + } + if(m_ImageIsSet) + { + + val[utility::conversions::to_string_t(U("image"))] = ModelBase::toJson(m_Image); + } + if(m_UdfIsSet) + { + + val[utility::conversions::to_string_t(U("udf"))] = ModelBase::toJson(m_Udf); + } + if(m_Udf_nameIsSet) + { + + val[utility::conversions::to_string_t(U("udf_name"))] = ModelBase::toJson(m_Udf_name); + } + if(m_Udf_versionIsSet) + { + + val[utility::conversions::to_string_t(U("udf_version"))] = ModelBase::toJson(m_Udf_version); + } + if(m_Udf_backendIsSet) + { + + val[utility::conversions::to_string_t(U("udf_backend"))] = ModelBase::toJson(m_Udf_backend); + } + if(m_Auto_backfillIsSet) + { + + val[utility::conversions::to_string_t(U("auto_backfill"))] = ModelBase::toJson(m_Auto_backfill); + } + if(m_ManifestIsSet) + { + + val[utility::conversions::to_string_t(U("manifest"))] = ModelBase::toJson(m_Manifest); + } + if(m_Manifest_checksumIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_checksum"))] = ModelBase::toJson(m_Manifest_checksum); + } + if(m_Field_metadataIsSet) + { + + val[utility::conversions::to_string_t(U("field_metadata"))] = ModelBase::toJson(m_Field_metadata); + } + + return val; +} + +bool AlterVirtualColumnEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("input_columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("input_columns"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setInputColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setInputColumns); + setInputColumns(refVal_setInputColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("image")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("image"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setImage; + ok &= ModelBase::fromJson(fieldValue, refVal_setImage); + setImage(refVal_setImage); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdf; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdf); + setUdf(refVal_setUdf); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdfName; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdfName); + setUdfName(refVal_setUdfName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf_version"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdfVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdfVersion); + setUdfVersion(refVal_setUdfVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udf_backend")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udf_backend"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdfBackend; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdfBackend); + setUdfBackend(refVal_setUdfBackend); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("auto_backfill")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("auto_backfill"))); + if(!fieldValue.is_null()) + { + bool refVal_setAutoBackfill; + ok &= ModelBase::fromJson(fieldValue, refVal_setAutoBackfill); + setAutoBackfill(refVal_setAutoBackfill); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifest); + setManifest(refVal_setManifest); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_checksum")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_checksum"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifestChecksum; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestChecksum); + setManifestChecksum(refVal_setManifestChecksum); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("field_metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("field_metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setFieldMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setFieldMetadata); + setFieldMetadata(refVal_setFieldMetadata); + + } + } + return ok; +} + +void AlterVirtualColumnEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Input_columnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("input_columns")), m_Input_columns)); + } + if(m_ImageIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("image")), m_Image)); + } + if(m_UdfIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf")), m_Udf)); + } + if(m_Udf_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf_name")), m_Udf_name)); + } + if(m_Udf_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf_version")), m_Udf_version)); + } + if(m_Udf_backendIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udf_backend")), m_Udf_backend)); + } + if(m_Auto_backfillIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("auto_backfill")), m_Auto_backfill)); + } + if(m_ManifestIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest")), m_Manifest)); + } + if(m_Manifest_checksumIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_checksum")), m_Manifest_checksum)); + } + if(m_Field_metadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("field_metadata")), m_Field_metadata)); + } +} + +bool AlterVirtualColumnEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("input_columns")))) + { + std::vector refVal_setInputColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("input_columns"))), refVal_setInputColumns ); + setInputColumns(refVal_setInputColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("image")))) + { + utility::string_t refVal_setImage; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("image"))), refVal_setImage ); + setImage(refVal_setImage); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf")))) + { + utility::string_t refVal_setUdf; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf"))), refVal_setUdf ); + setUdf(refVal_setUdf); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf_name")))) + { + utility::string_t refVal_setUdfName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf_name"))), refVal_setUdfName ); + setUdfName(refVal_setUdfName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf_version")))) + { + utility::string_t refVal_setUdfVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf_version"))), refVal_setUdfVersion ); + setUdfVersion(refVal_setUdfVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udf_backend")))) + { + utility::string_t refVal_setUdfBackend; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udf_backend"))), refVal_setUdfBackend ); + setUdfBackend(refVal_setUdfBackend); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("auto_backfill")))) + { + bool refVal_setAutoBackfill; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("auto_backfill"))), refVal_setAutoBackfill ); + setAutoBackfill(refVal_setAutoBackfill); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest")))) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest"))), refVal_setManifest ); + setManifest(refVal_setManifest); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_checksum")))) + { + utility::string_t refVal_setManifestChecksum; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_checksum"))), refVal_setManifestChecksum ); + setManifestChecksum(refVal_setManifestChecksum); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("field_metadata")))) + { + std::map refVal_setFieldMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("field_metadata"))), refVal_setFieldMetadata ); + setFieldMetadata(refVal_setFieldMetadata); + } + return ok; +} + + +std::vector AlterVirtualColumnEntry::getInputColumns() const +{ + return m_Input_columns; +} + + +void AlterVirtualColumnEntry::setInputColumns(const std::vector& value) +{ + m_Input_columns = value; + m_Input_columnsIsSet = true; +} + +bool AlterVirtualColumnEntry::inputColumnsIsSet() const +{ + return m_Input_columnsIsSet; +} + +void AlterVirtualColumnEntry::unsetInput_columns() +{ + m_Input_columnsIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getImage() const +{ + return m_Image; +} + + +void AlterVirtualColumnEntry::setImage(const utility::string_t& value) +{ + m_Image = value; + m_ImageIsSet = true; +} + +bool AlterVirtualColumnEntry::imageIsSet() const +{ + return m_ImageIsSet; +} + +void AlterVirtualColumnEntry::unsetImage() +{ + m_ImageIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getUdf() const +{ + return m_Udf; +} + + +void AlterVirtualColumnEntry::setUdf(const utility::string_t& value) +{ + m_Udf = value; + m_UdfIsSet = true; +} + +bool AlterVirtualColumnEntry::udfIsSet() const +{ + return m_UdfIsSet; +} + +void AlterVirtualColumnEntry::unsetUdf() +{ + m_UdfIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getUdfName() const +{ + return m_Udf_name; +} + + +void AlterVirtualColumnEntry::setUdfName(const utility::string_t& value) +{ + m_Udf_name = value; + m_Udf_nameIsSet = true; +} + +bool AlterVirtualColumnEntry::udfNameIsSet() const +{ + return m_Udf_nameIsSet; +} + +void AlterVirtualColumnEntry::unsetUdf_name() +{ + m_Udf_nameIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getUdfVersion() const +{ + return m_Udf_version; +} + + +void AlterVirtualColumnEntry::setUdfVersion(const utility::string_t& value) +{ + m_Udf_version = value; + m_Udf_versionIsSet = true; +} + +bool AlterVirtualColumnEntry::udfVersionIsSet() const +{ + return m_Udf_versionIsSet; +} + +void AlterVirtualColumnEntry::unsetUdf_version() +{ + m_Udf_versionIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getUdfBackend() const +{ + return m_Udf_backend; +} + + +void AlterVirtualColumnEntry::setUdfBackend(const utility::string_t& value) +{ + m_Udf_backend = value; + m_Udf_backendIsSet = true; +} + +bool AlterVirtualColumnEntry::udfBackendIsSet() const +{ + return m_Udf_backendIsSet; +} + +void AlterVirtualColumnEntry::unsetUdf_backend() +{ + m_Udf_backendIsSet = false; +} +bool AlterVirtualColumnEntry::isAutoBackfill() const +{ + return m_Auto_backfill; +} + +void AlterVirtualColumnEntry::setAutoBackfill(bool value) +{ + m_Auto_backfill = value; + m_Auto_backfillIsSet = true; +} + +bool AlterVirtualColumnEntry::autoBackfillIsSet() const +{ + return m_Auto_backfillIsSet; +} + +void AlterVirtualColumnEntry::unsetAuto_backfill() +{ + m_Auto_backfillIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getManifest() const +{ + return m_Manifest; +} + + +void AlterVirtualColumnEntry::setManifest(const utility::string_t& value) +{ + m_Manifest = value; + m_ManifestIsSet = true; +} + +bool AlterVirtualColumnEntry::manifestIsSet() const +{ + return m_ManifestIsSet; +} + +void AlterVirtualColumnEntry::unsetManifest() +{ + m_ManifestIsSet = false; +} +utility::string_t AlterVirtualColumnEntry::getManifestChecksum() const +{ + return m_Manifest_checksum; +} + + +void AlterVirtualColumnEntry::setManifestChecksum(const utility::string_t& value) +{ + m_Manifest_checksum = value; + m_Manifest_checksumIsSet = true; +} + +bool AlterVirtualColumnEntry::manifestChecksumIsSet() const +{ + return m_Manifest_checksumIsSet; +} + +void AlterVirtualColumnEntry::unsetManifest_checksum() +{ + m_Manifest_checksumIsSet = false; +} +std::map AlterVirtualColumnEntry::getFieldMetadata() const +{ + return m_Field_metadata; +} + + +void AlterVirtualColumnEntry::setFieldMetadata(const std::map& value) +{ + m_Field_metadata = value; + m_Field_metadataIsSet = true; +} + +bool AlterVirtualColumnEntry::fieldMetadataIsSet() const +{ + return m_Field_metadataIsSet; +} + +void AlterVirtualColumnEntry::unsetField_metadata() +{ + m_Field_metadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanRequest.cpp b/cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanRequest.cpp new file mode 100644 index 000000000..0100605b0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanRequest.cpp @@ -0,0 +1,1135 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AnalyzeTableQueryPlanRequest::AnalyzeTableQueryPlanRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Bypass_vector_index = false; + m_Bypass_vector_indexIsSet = false; + m_ColumnsIsSet = false; + m_Distance_type = utility::conversions::to_string_t(""); + m_Distance_typeIsSet = false; + m_Ef = 0; + m_EfIsSet = false; + m_Fast_search = false; + m_Fast_searchIsSet = false; + m_Filter = utility::conversions::to_string_t(""); + m_FilterIsSet = false; + m_Full_text_queryIsSet = false; + m_k = 0; + m_kIsSet = false; + m_Lower_bound = 0.0f; + m_Lower_boundIsSet = false; + m_Nprobes = 0; + m_NprobesIsSet = false; + m_Offset = 0; + m_OffsetIsSet = false; + m_Prefilter = false; + m_PrefilterIsSet = false; + m_Refine_factor = 0; + m_Refine_factorIsSet = false; + m_Upper_bound = 0.0f; + m_Upper_boundIsSet = false; + m_VectorIsSet = false; + m_Vector_column = utility::conversions::to_string_t(""); + m_Vector_columnIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_With_row_id = false; + m_With_row_idIsSet = false; +} + +AnalyzeTableQueryPlanRequest::~AnalyzeTableQueryPlanRequest() +{ +} + +void AnalyzeTableQueryPlanRequest::validate() +{ + // TODO: implement validation +} + +web::json::value AnalyzeTableQueryPlanRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Bypass_vector_indexIsSet) + { + + val[utility::conversions::to_string_t(U("bypass_vector_index"))] = ModelBase::toJson(m_Bypass_vector_index); + } + if(m_ColumnsIsSet) + { + + val[utility::conversions::to_string_t(U("columns"))] = ModelBase::toJson(m_Columns); + } + if(m_Distance_typeIsSet) + { + + val[utility::conversions::to_string_t(U("distance_type"))] = ModelBase::toJson(m_Distance_type); + } + if(m_EfIsSet) + { + + val[utility::conversions::to_string_t(U("ef"))] = ModelBase::toJson(m_Ef); + } + if(m_Fast_searchIsSet) + { + + val[utility::conversions::to_string_t(U("fast_search"))] = ModelBase::toJson(m_Fast_search); + } + if(m_FilterIsSet) + { + + val[utility::conversions::to_string_t(U("filter"))] = ModelBase::toJson(m_Filter); + } + if(m_Full_text_queryIsSet) + { + + val[utility::conversions::to_string_t(U("full_text_query"))] = ModelBase::toJson(m_Full_text_query); + } + if(m_kIsSet) + { + + val[utility::conversions::to_string_t(U("k"))] = ModelBase::toJson(m_k); + } + if(m_Lower_boundIsSet) + { + + val[utility::conversions::to_string_t(U("lower_bound"))] = ModelBase::toJson(m_Lower_bound); + } + if(m_NprobesIsSet) + { + + val[utility::conversions::to_string_t(U("nprobes"))] = ModelBase::toJson(m_Nprobes); + } + if(m_OffsetIsSet) + { + + val[utility::conversions::to_string_t(U("offset"))] = ModelBase::toJson(m_Offset); + } + if(m_PrefilterIsSet) + { + + val[utility::conversions::to_string_t(U("prefilter"))] = ModelBase::toJson(m_Prefilter); + } + if(m_Refine_factorIsSet) + { + + val[utility::conversions::to_string_t(U("refine_factor"))] = ModelBase::toJson(m_Refine_factor); + } + if(m_Upper_boundIsSet) + { + + val[utility::conversions::to_string_t(U("upper_bound"))] = ModelBase::toJson(m_Upper_bound); + } + if(m_VectorIsSet) + { + + val[utility::conversions::to_string_t(U("vector"))] = ModelBase::toJson(m_Vector); + } + if(m_Vector_columnIsSet) + { + + val[utility::conversions::to_string_t(U("vector_column"))] = ModelBase::toJson(m_Vector_column); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_With_row_idIsSet) + { + + val[utility::conversions::to_string_t(U("with_row_id"))] = ModelBase::toJson(m_With_row_id); + } + + return val; +} + +bool AnalyzeTableQueryPlanRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("bypass_vector_index")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("bypass_vector_index"))); + if(!fieldValue.is_null()) + { + bool refVal_setBypassVectorIndex; + ok &= ModelBase::fromJson(fieldValue, refVal_setBypassVectorIndex); + setBypassVectorIndex(refVal_setBypassVectorIndex); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("columns"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumns); + setColumns(refVal_setColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("distance_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("distance_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromJson(fieldValue, refVal_setDistanceType); + setDistanceType(refVal_setDistanceType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("ef")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("ef"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setEf; + ok &= ModelBase::fromJson(fieldValue, refVal_setEf); + setEf(refVal_setEf); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("fast_search")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fast_search"))); + if(!fieldValue.is_null()) + { + bool refVal_setFastSearch; + ok &= ModelBase::fromJson(fieldValue, refVal_setFastSearch); + setFastSearch(refVal_setFastSearch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("filter")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("filter"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setFilter; + ok &= ModelBase::fromJson(fieldValue, refVal_setFilter); + setFilter(refVal_setFilter); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("full_text_query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("full_text_query"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setFullTextQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setFullTextQuery); + setFullTextQuery(refVal_setFullTextQuery); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("k")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("k"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setK; + ok &= ModelBase::fromJson(fieldValue, refVal_setK); + setK(refVal_setK); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("lower_bound")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("lower_bound"))); + if(!fieldValue.is_null()) + { + float refVal_setLowerBound; + ok &= ModelBase::fromJson(fieldValue, refVal_setLowerBound); + setLowerBound(refVal_setLowerBound); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("nprobes")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("nprobes"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNprobes; + ok &= ModelBase::fromJson(fieldValue, refVal_setNprobes); + setNprobes(refVal_setNprobes); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("offset")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("offset"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setOffset; + ok &= ModelBase::fromJson(fieldValue, refVal_setOffset); + setOffset(refVal_setOffset); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("prefilter")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("prefilter"))); + if(!fieldValue.is_null()) + { + bool refVal_setPrefilter; + ok &= ModelBase::fromJson(fieldValue, refVal_setPrefilter); + setPrefilter(refVal_setPrefilter); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("refine_factor")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("refine_factor"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setRefineFactor; + ok &= ModelBase::fromJson(fieldValue, refVal_setRefineFactor); + setRefineFactor(refVal_setRefineFactor); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("upper_bound")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("upper_bound"))); + if(!fieldValue.is_null()) + { + float refVal_setUpperBound; + ok &= ModelBase::fromJson(fieldValue, refVal_setUpperBound); + setUpperBound(refVal_setUpperBound); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("vector")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vector"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVector; + ok &= ModelBase::fromJson(fieldValue, refVal_setVector); + setVector(refVal_setVector); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("vector_column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vector_column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setVectorColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setVectorColumn); + setVectorColumn(refVal_setVectorColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("with_row_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("with_row_id"))); + if(!fieldValue.is_null()) + { + bool refVal_setWithRowId; + ok &= ModelBase::fromJson(fieldValue, refVal_setWithRowId); + setWithRowId(refVal_setWithRowId); + + } + } + return ok; +} + +void AnalyzeTableQueryPlanRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Bypass_vector_indexIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("bypass_vector_index")), m_Bypass_vector_index)); + } + if(m_ColumnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("columns")), m_Columns)); + } + if(m_Distance_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("distance_type")), m_Distance_type)); + } + if(m_EfIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("ef")), m_Ef)); + } + if(m_Fast_searchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fast_search")), m_Fast_search)); + } + if(m_FilterIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("filter")), m_Filter)); + } + if(m_Full_text_queryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("full_text_query")), m_Full_text_query)); + } + if(m_kIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("k")), m_k)); + } + if(m_Lower_boundIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lower_bound")), m_Lower_bound)); + } + if(m_NprobesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("nprobes")), m_Nprobes)); + } + if(m_OffsetIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("offset")), m_Offset)); + } + if(m_PrefilterIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("prefilter")), m_Prefilter)); + } + if(m_Refine_factorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("refine_factor")), m_Refine_factor)); + } + if(m_Upper_boundIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("upper_bound")), m_Upper_bound)); + } + if(m_VectorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vector")), m_Vector)); + } + if(m_Vector_columnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vector_column")), m_Vector_column)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_With_row_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("with_row_id")), m_With_row_id)); + } +} + +bool AnalyzeTableQueryPlanRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("bypass_vector_index")))) + { + bool refVal_setBypassVectorIndex; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("bypass_vector_index"))), refVal_setBypassVectorIndex ); + setBypassVectorIndex(refVal_setBypassVectorIndex); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("columns")))) + { + std::shared_ptr refVal_setColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("columns"))), refVal_setColumns ); + setColumns(refVal_setColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("distance_type")))) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("distance_type"))), refVal_setDistanceType ); + setDistanceType(refVal_setDistanceType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("ef")))) + { + int32_t refVal_setEf; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("ef"))), refVal_setEf ); + setEf(refVal_setEf); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("fast_search")))) + { + bool refVal_setFastSearch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fast_search"))), refVal_setFastSearch ); + setFastSearch(refVal_setFastSearch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("filter")))) + { + utility::string_t refVal_setFilter; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("filter"))), refVal_setFilter ); + setFilter(refVal_setFilter); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("full_text_query")))) + { + std::shared_ptr refVal_setFullTextQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("full_text_query"))), refVal_setFullTextQuery ); + setFullTextQuery(refVal_setFullTextQuery); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("k")))) + { + int32_t refVal_setK; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("k"))), refVal_setK ); + setK(refVal_setK); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("lower_bound")))) + { + float refVal_setLowerBound; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lower_bound"))), refVal_setLowerBound ); + setLowerBound(refVal_setLowerBound); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("nprobes")))) + { + int32_t refVal_setNprobes; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("nprobes"))), refVal_setNprobes ); + setNprobes(refVal_setNprobes); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("offset")))) + { + int32_t refVal_setOffset; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("offset"))), refVal_setOffset ); + setOffset(refVal_setOffset); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("prefilter")))) + { + bool refVal_setPrefilter; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("prefilter"))), refVal_setPrefilter ); + setPrefilter(refVal_setPrefilter); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("refine_factor")))) + { + int32_t refVal_setRefineFactor; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("refine_factor"))), refVal_setRefineFactor ); + setRefineFactor(refVal_setRefineFactor); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("upper_bound")))) + { + float refVal_setUpperBound; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("upper_bound"))), refVal_setUpperBound ); + setUpperBound(refVal_setUpperBound); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vector")))) + { + std::shared_ptr refVal_setVector; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vector"))), refVal_setVector ); + setVector(refVal_setVector); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vector_column")))) + { + utility::string_t refVal_setVectorColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vector_column"))), refVal_setVectorColumn ); + setVectorColumn(refVal_setVectorColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("with_row_id")))) + { + bool refVal_setWithRowId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("with_row_id"))), refVal_setWithRowId ); + setWithRowId(refVal_setWithRowId); + } + return ok; +} + + +std::shared_ptr AnalyzeTableQueryPlanRequest::getIdentity() const +{ + return m_Identity; +} + + +void AnalyzeTableQueryPlanRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map AnalyzeTableQueryPlanRequest::getContext() const +{ + return m_Context; +} + + +void AnalyzeTableQueryPlanRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector AnalyzeTableQueryPlanRequest::getId() const +{ + return m_Id; +} + + +void AnalyzeTableQueryPlanRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t AnalyzeTableQueryPlanRequest::getBranch() const +{ + return m_Branch; +} + + +void AnalyzeTableQueryPlanRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +bool AnalyzeTableQueryPlanRequest::isBypassVectorIndex() const +{ + return m_Bypass_vector_index; +} + +void AnalyzeTableQueryPlanRequest::setBypassVectorIndex(bool value) +{ + m_Bypass_vector_index = value; + m_Bypass_vector_indexIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::bypassVectorIndexIsSet() const +{ + return m_Bypass_vector_indexIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetBypass_vector_index() +{ + m_Bypass_vector_indexIsSet = false; +} +std::shared_ptr AnalyzeTableQueryPlanRequest::getColumns() const +{ + return m_Columns; +} + + +void AnalyzeTableQueryPlanRequest::setColumns(const std::shared_ptr& value) +{ + m_Columns = value; + m_ColumnsIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::columnsIsSet() const +{ + return m_ColumnsIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetColumns() +{ + m_ColumnsIsSet = false; +} +utility::string_t AnalyzeTableQueryPlanRequest::getDistanceType() const +{ + return m_Distance_type; +} + + +void AnalyzeTableQueryPlanRequest::setDistanceType(const utility::string_t& value) +{ + m_Distance_type = value; + m_Distance_typeIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::distanceTypeIsSet() const +{ + return m_Distance_typeIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetDistance_type() +{ + m_Distance_typeIsSet = false; +} +int32_t AnalyzeTableQueryPlanRequest::getEf() const +{ + return m_Ef; +} + +void AnalyzeTableQueryPlanRequest::setEf(int32_t value) +{ + m_Ef = value; + m_EfIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::efIsSet() const +{ + return m_EfIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetEf() +{ + m_EfIsSet = false; +} +bool AnalyzeTableQueryPlanRequest::isFastSearch() const +{ + return m_Fast_search; +} + +void AnalyzeTableQueryPlanRequest::setFastSearch(bool value) +{ + m_Fast_search = value; + m_Fast_searchIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::fastSearchIsSet() const +{ + return m_Fast_searchIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetFast_search() +{ + m_Fast_searchIsSet = false; +} +utility::string_t AnalyzeTableQueryPlanRequest::getFilter() const +{ + return m_Filter; +} + + +void AnalyzeTableQueryPlanRequest::setFilter(const utility::string_t& value) +{ + m_Filter = value; + m_FilterIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::filterIsSet() const +{ + return m_FilterIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetFilter() +{ + m_FilterIsSet = false; +} +std::shared_ptr AnalyzeTableQueryPlanRequest::getFullTextQuery() const +{ + return m_Full_text_query; +} + + +void AnalyzeTableQueryPlanRequest::setFullTextQuery(const std::shared_ptr& value) +{ + m_Full_text_query = value; + m_Full_text_queryIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::fullTextQueryIsSet() const +{ + return m_Full_text_queryIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetFull_text_query() +{ + m_Full_text_queryIsSet = false; +} +int32_t AnalyzeTableQueryPlanRequest::getK() const +{ + return m_k; +} + +void AnalyzeTableQueryPlanRequest::setK(int32_t value) +{ + m_k = value; + m_kIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::KIsSet() const +{ + return m_kIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetk() +{ + m_kIsSet = false; +} +float AnalyzeTableQueryPlanRequest::getLowerBound() const +{ + return m_Lower_bound; +} + +void AnalyzeTableQueryPlanRequest::setLowerBound(float value) +{ + m_Lower_bound = value; + m_Lower_boundIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::lowerBoundIsSet() const +{ + return m_Lower_boundIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetLower_bound() +{ + m_Lower_boundIsSet = false; +} +int32_t AnalyzeTableQueryPlanRequest::getNprobes() const +{ + return m_Nprobes; +} + +void AnalyzeTableQueryPlanRequest::setNprobes(int32_t value) +{ + m_Nprobes = value; + m_NprobesIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::nprobesIsSet() const +{ + return m_NprobesIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetNprobes() +{ + m_NprobesIsSet = false; +} +int32_t AnalyzeTableQueryPlanRequest::getOffset() const +{ + return m_Offset; +} + +void AnalyzeTableQueryPlanRequest::setOffset(int32_t value) +{ + m_Offset = value; + m_OffsetIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::offsetIsSet() const +{ + return m_OffsetIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetOffset() +{ + m_OffsetIsSet = false; +} +bool AnalyzeTableQueryPlanRequest::isPrefilter() const +{ + return m_Prefilter; +} + +void AnalyzeTableQueryPlanRequest::setPrefilter(bool value) +{ + m_Prefilter = value; + m_PrefilterIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::prefilterIsSet() const +{ + return m_PrefilterIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetPrefilter() +{ + m_PrefilterIsSet = false; +} +int32_t AnalyzeTableQueryPlanRequest::getRefineFactor() const +{ + return m_Refine_factor; +} + +void AnalyzeTableQueryPlanRequest::setRefineFactor(int32_t value) +{ + m_Refine_factor = value; + m_Refine_factorIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::refineFactorIsSet() const +{ + return m_Refine_factorIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetRefine_factor() +{ + m_Refine_factorIsSet = false; +} +float AnalyzeTableQueryPlanRequest::getUpperBound() const +{ + return m_Upper_bound; +} + +void AnalyzeTableQueryPlanRequest::setUpperBound(float value) +{ + m_Upper_bound = value; + m_Upper_boundIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::upperBoundIsSet() const +{ + return m_Upper_boundIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetUpper_bound() +{ + m_Upper_boundIsSet = false; +} +std::shared_ptr AnalyzeTableQueryPlanRequest::getVector() const +{ + return m_Vector; +} + + +void AnalyzeTableQueryPlanRequest::setVector(const std::shared_ptr& value) +{ + m_Vector = value; + m_VectorIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::vectorIsSet() const +{ + return m_VectorIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetVector() +{ + m_VectorIsSet = false; +} +utility::string_t AnalyzeTableQueryPlanRequest::getVectorColumn() const +{ + return m_Vector_column; +} + + +void AnalyzeTableQueryPlanRequest::setVectorColumn(const utility::string_t& value) +{ + m_Vector_column = value; + m_Vector_columnIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::vectorColumnIsSet() const +{ + return m_Vector_columnIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetVector_column() +{ + m_Vector_columnIsSet = false; +} +int64_t AnalyzeTableQueryPlanRequest::getVersion() const +{ + return m_Version; +} + +void AnalyzeTableQueryPlanRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +bool AnalyzeTableQueryPlanRequest::isWithRowId() const +{ + return m_With_row_id; +} + +void AnalyzeTableQueryPlanRequest::setWithRowId(bool value) +{ + m_With_row_id = value; + m_With_row_idIsSet = true; +} + +bool AnalyzeTableQueryPlanRequest::withRowIdIsSet() const +{ + return m_With_row_idIsSet; +} + +void AnalyzeTableQueryPlanRequest::unsetWith_row_id() +{ + m_With_row_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanResponse.cpp b/cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanResponse.cpp new file mode 100644 index 000000000..ba4c5faa9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/AnalyzeTableQueryPlanResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/AnalyzeTableQueryPlanResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AnalyzeTableQueryPlanResponse::AnalyzeTableQueryPlanResponse() +{ + m_Analysis = utility::conversions::to_string_t(""); + m_AnalysisIsSet = false; +} + +AnalyzeTableQueryPlanResponse::~AnalyzeTableQueryPlanResponse() +{ +} + +void AnalyzeTableQueryPlanResponse::validate() +{ + // TODO: implement validation +} + +web::json::value AnalyzeTableQueryPlanResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_AnalysisIsSet) + { + + val[utility::conversions::to_string_t(U("analysis"))] = ModelBase::toJson(m_Analysis); + } + + return val; +} + +bool AnalyzeTableQueryPlanResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("analysis")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("analysis"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setAnalysis; + ok &= ModelBase::fromJson(fieldValue, refVal_setAnalysis); + setAnalysis(refVal_setAnalysis); + + } + } + return ok; +} + +void AnalyzeTableQueryPlanResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_AnalysisIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("analysis")), m_Analysis)); + } +} + +bool AnalyzeTableQueryPlanResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("analysis")))) + { + utility::string_t refVal_setAnalysis; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("analysis"))), refVal_setAnalysis ); + setAnalysis(refVal_setAnalysis); + } + return ok; +} + + +utility::string_t AnalyzeTableQueryPlanResponse::getAnalysis() const +{ + return m_Analysis; +} + + +void AnalyzeTableQueryPlanResponse::setAnalysis(const utility::string_t& value) +{ + m_Analysis = value; + m_AnalysisIsSet = true; +} + +bool AnalyzeTableQueryPlanResponse::analysisIsSet() const +{ + return m_AnalysisIsSet; +} + +void AnalyzeTableQueryPlanResponse::unsetAnalysis() +{ + m_AnalysisIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BatchCommitTablesRequest.cpp b/cpp/lance_namespace_rest_client/src/model/BatchCommitTablesRequest.cpp new file mode 100644 index 000000000..017ce81d9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BatchCommitTablesRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BatchCommitTablesRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BatchCommitTablesRequest::BatchCommitTablesRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_OperationsIsSet = false; +} + +BatchCommitTablesRequest::~BatchCommitTablesRequest() +{ +} + +void BatchCommitTablesRequest::validate() +{ + // TODO: implement validation +} + +web::json::value BatchCommitTablesRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_OperationsIsSet) + { + + val[utility::conversions::to_string_t(U("operations"))] = ModelBase::toJson(m_Operations); + } + + return val; +} + +bool BatchCommitTablesRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("operations")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("operations"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setOperations; + ok &= ModelBase::fromJson(fieldValue, refVal_setOperations); + setOperations(refVal_setOperations); + + } + } + return ok; +} + +void BatchCommitTablesRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_OperationsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("operations")), m_Operations)); + } +} + +bool BatchCommitTablesRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("operations")))) + { + std::vector> refVal_setOperations; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("operations"))), refVal_setOperations ); + setOperations(refVal_setOperations); + } + return ok; +} + + +std::shared_ptr BatchCommitTablesRequest::getIdentity() const +{ + return m_Identity; +} + + +void BatchCommitTablesRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool BatchCommitTablesRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void BatchCommitTablesRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map BatchCommitTablesRequest::getContext() const +{ + return m_Context; +} + + +void BatchCommitTablesRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool BatchCommitTablesRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void BatchCommitTablesRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector> BatchCommitTablesRequest::getOperations() const +{ + return m_Operations; +} + + +void BatchCommitTablesRequest::setOperations(const std::vector>& value) +{ + m_Operations = value; + m_OperationsIsSet = true; +} + +bool BatchCommitTablesRequest::operationsIsSet() const +{ + return m_OperationsIsSet; +} + +void BatchCommitTablesRequest::unsetOperations() +{ + m_OperationsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BatchCommitTablesResponse.cpp b/cpp/lance_namespace_rest_client/src/model/BatchCommitTablesResponse.cpp new file mode 100644 index 000000000..6ce93f55f --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BatchCommitTablesResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BatchCommitTablesResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BatchCommitTablesResponse::BatchCommitTablesResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_ResultsIsSet = false; +} + +BatchCommitTablesResponse::~BatchCommitTablesResponse() +{ +} + +void BatchCommitTablesResponse::validate() +{ + // TODO: implement validation +} + +web::json::value BatchCommitTablesResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_ResultsIsSet) + { + + val[utility::conversions::to_string_t(U("results"))] = ModelBase::toJson(m_Results); + } + + return val; +} + +bool BatchCommitTablesResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("results")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("results"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setResults; + ok &= ModelBase::fromJson(fieldValue, refVal_setResults); + setResults(refVal_setResults); + + } + } + return ok; +} + +void BatchCommitTablesResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_ResultsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("results")), m_Results)); + } +} + +bool BatchCommitTablesResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("results")))) + { + std::vector> refVal_setResults; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("results"))), refVal_setResults ); + setResults(refVal_setResults); + } + return ok; +} + + +utility::string_t BatchCommitTablesResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void BatchCommitTablesResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool BatchCommitTablesResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void BatchCommitTablesResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +std::vector> BatchCommitTablesResponse::getResults() const +{ + return m_Results; +} + + +void BatchCommitTablesResponse::setResults(const std::vector>& value) +{ + m_Results = value; + m_ResultsIsSet = true; +} + +bool BatchCommitTablesResponse::resultsIsSet() const +{ + return m_ResultsIsSet; +} + +void BatchCommitTablesResponse::unsetResults() +{ + m_ResultsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsRequest.cpp new file mode 100644 index 000000000..ee5bd2794 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BatchCreateTableVersionsRequest::BatchCreateTableVersionsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_EntriesIsSet = false; +} + +BatchCreateTableVersionsRequest::~BatchCreateTableVersionsRequest() +{ +} + +void BatchCreateTableVersionsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value BatchCreateTableVersionsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_EntriesIsSet) + { + + val[utility::conversions::to_string_t(U("entries"))] = ModelBase::toJson(m_Entries); + } + + return val; +} + +bool BatchCreateTableVersionsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("entries")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("entries"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setEntries; + ok &= ModelBase::fromJson(fieldValue, refVal_setEntries); + setEntries(refVal_setEntries); + + } + } + return ok; +} + +void BatchCreateTableVersionsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_EntriesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("entries")), m_Entries)); + } +} + +bool BatchCreateTableVersionsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("entries")))) + { + std::vector> refVal_setEntries; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("entries"))), refVal_setEntries ); + setEntries(refVal_setEntries); + } + return ok; +} + + +std::shared_ptr BatchCreateTableVersionsRequest::getIdentity() const +{ + return m_Identity; +} + + +void BatchCreateTableVersionsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool BatchCreateTableVersionsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void BatchCreateTableVersionsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map BatchCreateTableVersionsRequest::getContext() const +{ + return m_Context; +} + + +void BatchCreateTableVersionsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool BatchCreateTableVersionsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void BatchCreateTableVersionsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector> BatchCreateTableVersionsRequest::getEntries() const +{ + return m_Entries; +} + + +void BatchCreateTableVersionsRequest::setEntries(const std::vector>& value) +{ + m_Entries = value; + m_EntriesIsSet = true; +} + +bool BatchCreateTableVersionsRequest::entriesIsSet() const +{ + return m_EntriesIsSet; +} + +void BatchCreateTableVersionsRequest::unsetEntries() +{ + m_EntriesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsResponse.cpp new file mode 100644 index 000000000..8d943f99b --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BatchCreateTableVersionsResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BatchCreateTableVersionsResponse::BatchCreateTableVersionsResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_VersionsIsSet = false; +} + +BatchCreateTableVersionsResponse::~BatchCreateTableVersionsResponse() +{ +} + +void BatchCreateTableVersionsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value BatchCreateTableVersionsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_VersionsIsSet) + { + + val[utility::conversions::to_string_t(U("versions"))] = ModelBase::toJson(m_Versions); + } + + return val; +} + +bool BatchCreateTableVersionsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("versions")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("versions"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setVersions; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersions); + setVersions(refVal_setVersions); + + } + } + return ok; +} + +void BatchCreateTableVersionsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_VersionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("versions")), m_Versions)); + } +} + +bool BatchCreateTableVersionsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("versions")))) + { + std::vector> refVal_setVersions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("versions"))), refVal_setVersions ); + setVersions(refVal_setVersions); + } + return ok; +} + + +utility::string_t BatchCreateTableVersionsResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void BatchCreateTableVersionsResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool BatchCreateTableVersionsResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void BatchCreateTableVersionsResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +std::vector> BatchCreateTableVersionsResponse::getVersions() const +{ + return m_Versions; +} + + +void BatchCreateTableVersionsResponse::setVersions(const std::vector>& value) +{ + m_Versions = value; + m_VersionsIsSet = true; +} + +bool BatchCreateTableVersionsResponse::versionsIsSet() const +{ + return m_VersionsIsSet; +} + +void BatchCreateTableVersionsResponse::unsetVersions() +{ + m_VersionsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsRequest.cpp new file mode 100644 index 000000000..6f61365be --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BatchDeleteTableVersionsRequest::BatchDeleteTableVersionsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_RangesIsSet = false; +} + +BatchDeleteTableVersionsRequest::~BatchDeleteTableVersionsRequest() +{ +} + +void BatchDeleteTableVersionsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value BatchDeleteTableVersionsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_RangesIsSet) + { + + val[utility::conversions::to_string_t(U("ranges"))] = ModelBase::toJson(m_Ranges); + } + + return val; +} + +bool BatchDeleteTableVersionsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("ranges")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("ranges"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setRanges; + ok &= ModelBase::fromJson(fieldValue, refVal_setRanges); + setRanges(refVal_setRanges); + + } + } + return ok; +} + +void BatchDeleteTableVersionsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_RangesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("ranges")), m_Ranges)); + } +} + +bool BatchDeleteTableVersionsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("ranges")))) + { + std::vector> refVal_setRanges; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("ranges"))), refVal_setRanges ); + setRanges(refVal_setRanges); + } + return ok; +} + + +std::shared_ptr BatchDeleteTableVersionsRequest::getIdentity() const +{ + return m_Identity; +} + + +void BatchDeleteTableVersionsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool BatchDeleteTableVersionsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void BatchDeleteTableVersionsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map BatchDeleteTableVersionsRequest::getContext() const +{ + return m_Context; +} + + +void BatchDeleteTableVersionsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool BatchDeleteTableVersionsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void BatchDeleteTableVersionsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector BatchDeleteTableVersionsRequest::getId() const +{ + return m_Id; +} + + +void BatchDeleteTableVersionsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool BatchDeleteTableVersionsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void BatchDeleteTableVersionsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t BatchDeleteTableVersionsRequest::getBranch() const +{ + return m_Branch; +} + + +void BatchDeleteTableVersionsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool BatchDeleteTableVersionsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void BatchDeleteTableVersionsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::vector> BatchDeleteTableVersionsRequest::getRanges() const +{ + return m_Ranges; +} + + +void BatchDeleteTableVersionsRequest::setRanges(const std::vector>& value) +{ + m_Ranges = value; + m_RangesIsSet = true; +} + +bool BatchDeleteTableVersionsRequest::rangesIsSet() const +{ + return m_RangesIsSet; +} + +void BatchDeleteTableVersionsRequest::unsetRanges() +{ + m_RangesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsResponse.cpp new file mode 100644 index 000000000..554a01c05 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BatchDeleteTableVersionsResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BatchDeleteTableVersionsResponse::BatchDeleteTableVersionsResponse() +{ + m_Deleted_count = 0L; + m_Deleted_countIsSet = false; + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +BatchDeleteTableVersionsResponse::~BatchDeleteTableVersionsResponse() +{ +} + +void BatchDeleteTableVersionsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value BatchDeleteTableVersionsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Deleted_countIsSet) + { + + val[utility::conversions::to_string_t(U("deleted_count"))] = ModelBase::toJson(m_Deleted_count); + } + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool BatchDeleteTableVersionsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("deleted_count")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("deleted_count"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setDeletedCount; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeletedCount); + setDeletedCount(refVal_setDeletedCount); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void BatchDeleteTableVersionsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Deleted_countIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("deleted_count")), m_Deleted_count)); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool BatchDeleteTableVersionsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("deleted_count")))) + { + int64_t refVal_setDeletedCount; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("deleted_count"))), refVal_setDeletedCount ); + setDeletedCount(refVal_setDeletedCount); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +int64_t BatchDeleteTableVersionsResponse::getDeletedCount() const +{ + return m_Deleted_count; +} + +void BatchDeleteTableVersionsResponse::setDeletedCount(int64_t value) +{ + m_Deleted_count = value; + m_Deleted_countIsSet = true; +} + +bool BatchDeleteTableVersionsResponse::deletedCountIsSet() const +{ + return m_Deleted_countIsSet; +} + +void BatchDeleteTableVersionsResponse::unsetDeleted_count() +{ + m_Deleted_countIsSet = false; +} +utility::string_t BatchDeleteTableVersionsResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void BatchDeleteTableVersionsResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool BatchDeleteTableVersionsResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void BatchDeleteTableVersionsResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BooleanQuery.cpp b/cpp/lance_namespace_rest_client/src/model/BooleanQuery.cpp new file mode 100644 index 000000000..890057bf2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BooleanQuery.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BooleanQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BooleanQuery::BooleanQuery() +{ + m_MustIsSet = false; + m_Must_notIsSet = false; + m_ShouldIsSet = false; +} + +BooleanQuery::~BooleanQuery() +{ +} + +void BooleanQuery::validate() +{ + // TODO: implement validation +} + +web::json::value BooleanQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_MustIsSet) + { + + val[utility::conversions::to_string_t(U("must"))] = ModelBase::toJson(m_Must); + } + if(m_Must_notIsSet) + { + + val[utility::conversions::to_string_t(U("must_not"))] = ModelBase::toJson(m_Must_not); + } + if(m_ShouldIsSet) + { + + val[utility::conversions::to_string_t(U("should"))] = ModelBase::toJson(m_Should); + } + + return val; +} + +bool BooleanQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("must")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("must"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setMust; + ok &= ModelBase::fromJson(fieldValue, refVal_setMust); + setMust(refVal_setMust); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("must_not")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("must_not"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setMustNot; + ok &= ModelBase::fromJson(fieldValue, refVal_setMustNot); + setMustNot(refVal_setMustNot); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("should")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("should"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setShould; + ok &= ModelBase::fromJson(fieldValue, refVal_setShould); + setShould(refVal_setShould); + + } + } + return ok; +} + +void BooleanQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_MustIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("must")), m_Must)); + } + if(m_Must_notIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("must_not")), m_Must_not)); + } + if(m_ShouldIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("should")), m_Should)); + } +} + +bool BooleanQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("must")))) + { + std::vector> refVal_setMust; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("must"))), refVal_setMust ); + setMust(refVal_setMust); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("must_not")))) + { + std::vector> refVal_setMustNot; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("must_not"))), refVal_setMustNot ); + setMustNot(refVal_setMustNot); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("should")))) + { + std::vector> refVal_setShould; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("should"))), refVal_setShould ); + setShould(refVal_setShould); + } + return ok; +} + + +std::vector> BooleanQuery::getMust() const +{ + return m_Must; +} + + +void BooleanQuery::setMust(const std::vector>& value) +{ + m_Must = value; + m_MustIsSet = true; +} + +bool BooleanQuery::mustIsSet() const +{ + return m_MustIsSet; +} + +void BooleanQuery::unsetMust() +{ + m_MustIsSet = false; +} +std::vector> BooleanQuery::getMustNot() const +{ + return m_Must_not; +} + + +void BooleanQuery::setMustNot(const std::vector>& value) +{ + m_Must_not = value; + m_Must_notIsSet = true; +} + +bool BooleanQuery::mustNotIsSet() const +{ + return m_Must_notIsSet; +} + +void BooleanQuery::unsetMust_not() +{ + m_Must_notIsSet = false; +} +std::vector> BooleanQuery::getShould() const +{ + return m_Should; +} + + +void BooleanQuery::setShould(const std::vector>& value) +{ + m_Should = value; + m_ShouldIsSet = true; +} + +bool BooleanQuery::shouldIsSet() const +{ + return m_ShouldIsSet; +} + +void BooleanQuery::unsetShould() +{ + m_ShouldIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BoostQuery.cpp b/cpp/lance_namespace_rest_client/src/model/BoostQuery.cpp new file mode 100644 index 000000000..7678388bc --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BoostQuery.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BoostQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BoostQuery::BoostQuery() +{ + m_PositiveIsSet = false; + m_NegativeIsSet = false; + m_Negative_boost = 0.0f; + m_Negative_boostIsSet = false; +} + +BoostQuery::~BoostQuery() +{ +} + +void BoostQuery::validate() +{ + // TODO: implement validation +} + +web::json::value BoostQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_PositiveIsSet) + { + + val[utility::conversions::to_string_t(U("positive"))] = ModelBase::toJson(m_Positive); + } + if(m_NegativeIsSet) + { + + val[utility::conversions::to_string_t(U("negative"))] = ModelBase::toJson(m_Negative); + } + if(m_Negative_boostIsSet) + { + + val[utility::conversions::to_string_t(U("negative_boost"))] = ModelBase::toJson(m_Negative_boost); + } + + return val; +} + +bool BoostQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("positive")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("positive"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setPositive; + ok &= ModelBase::fromJson(fieldValue, refVal_setPositive); + setPositive(refVal_setPositive); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("negative")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("negative"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setNegative; + ok &= ModelBase::fromJson(fieldValue, refVal_setNegative); + setNegative(refVal_setNegative); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("negative_boost")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("negative_boost"))); + if(!fieldValue.is_null()) + { + float refVal_setNegativeBoost; + ok &= ModelBase::fromJson(fieldValue, refVal_setNegativeBoost); + setNegativeBoost(refVal_setNegativeBoost); + + } + } + return ok; +} + +void BoostQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_PositiveIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("positive")), m_Positive)); + } + if(m_NegativeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("negative")), m_Negative)); + } + if(m_Negative_boostIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("negative_boost")), m_Negative_boost)); + } +} + +bool BoostQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("positive")))) + { + std::shared_ptr refVal_setPositive; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("positive"))), refVal_setPositive ); + setPositive(refVal_setPositive); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("negative")))) + { + std::shared_ptr refVal_setNegative; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("negative"))), refVal_setNegative ); + setNegative(refVal_setNegative); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("negative_boost")))) + { + float refVal_setNegativeBoost; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("negative_boost"))), refVal_setNegativeBoost ); + setNegativeBoost(refVal_setNegativeBoost); + } + return ok; +} + + +std::shared_ptr BoostQuery::getPositive() const +{ + return m_Positive; +} + + +void BoostQuery::setPositive(const std::shared_ptr& value) +{ + m_Positive = value; + m_PositiveIsSet = true; +} + +bool BoostQuery::positiveIsSet() const +{ + return m_PositiveIsSet; +} + +void BoostQuery::unsetPositive() +{ + m_PositiveIsSet = false; +} +std::shared_ptr BoostQuery::getNegative() const +{ + return m_Negative; +} + + +void BoostQuery::setNegative(const std::shared_ptr& value) +{ + m_Negative = value; + m_NegativeIsSet = true; +} + +bool BoostQuery::negativeIsSet() const +{ + return m_NegativeIsSet; +} + +void BoostQuery::unsetNegative() +{ + m_NegativeIsSet = false; +} +float BoostQuery::getNegativeBoost() const +{ + return m_Negative_boost; +} + +void BoostQuery::setNegativeBoost(float value) +{ + m_Negative_boost = value; + m_Negative_boostIsSet = true; +} + +bool BoostQuery::negativeBoostIsSet() const +{ + return m_Negative_boostIsSet; +} + +void BoostQuery::unsetNegative_boost() +{ + m_Negative_boostIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/BranchContents.cpp b/cpp/lance_namespace_rest_client/src/model/BranchContents.cpp new file mode 100644 index 000000000..a3621ff3c --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/BranchContents.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/BranchContents.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +BranchContents::BranchContents() +{ + m_ParentBranch = utility::conversions::to_string_t(""); + m_ParentBranchIsSet = false; + m_ParentVersion = 0L; + m_ParentVersionIsSet = false; + m_CreateAt = 0L; + m_CreateAtIsSet = false; + m_ManifestSize = 0L; + m_ManifestSizeIsSet = false; + m_MetadataIsSet = false; +} + +BranchContents::~BranchContents() +{ +} + +void BranchContents::validate() +{ + // TODO: implement validation +} + +web::json::value BranchContents::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_ParentBranchIsSet) + { + + val[utility::conversions::to_string_t(U("parentBranch"))] = ModelBase::toJson(m_ParentBranch); + } + if(m_ParentVersionIsSet) + { + + val[utility::conversions::to_string_t(U("parentVersion"))] = ModelBase::toJson(m_ParentVersion); + } + if(m_CreateAtIsSet) + { + + val[utility::conversions::to_string_t(U("createAt"))] = ModelBase::toJson(m_CreateAt); + } + if(m_ManifestSizeIsSet) + { + + val[utility::conversions::to_string_t(U("manifestSize"))] = ModelBase::toJson(m_ManifestSize); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + + return val; +} + +bool BranchContents::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("parentBranch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("parentBranch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setParentBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setParentBranch); + setParentBranch(refVal_setParentBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("parentVersion")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("parentVersion"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setParentVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setParentVersion); + setParentVersion(refVal_setParentVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("createAt")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("createAt"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setCreateAt; + ok &= ModelBase::fromJson(fieldValue, refVal_setCreateAt); + setCreateAt(refVal_setCreateAt); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifestSize")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifestSize"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestSize); + setManifestSize(refVal_setManifestSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + return ok; +} + +void BranchContents::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_ParentBranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("parentBranch")), m_ParentBranch)); + } + if(m_ParentVersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("parentVersion")), m_ParentVersion)); + } + if(m_CreateAtIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("createAt")), m_CreateAt)); + } + if(m_ManifestSizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifestSize")), m_ManifestSize)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } +} + +bool BranchContents::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("parentBranch")))) + { + utility::string_t refVal_setParentBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("parentBranch"))), refVal_setParentBranch ); + setParentBranch(refVal_setParentBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("parentVersion")))) + { + int64_t refVal_setParentVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("parentVersion"))), refVal_setParentVersion ); + setParentVersion(refVal_setParentVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("createAt")))) + { + int64_t refVal_setCreateAt; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("createAt"))), refVal_setCreateAt ); + setCreateAt(refVal_setCreateAt); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifestSize")))) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifestSize"))), refVal_setManifestSize ); + setManifestSize(refVal_setManifestSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + return ok; +} + + +utility::string_t BranchContents::getParentBranch() const +{ + return m_ParentBranch; +} + + +void BranchContents::setParentBranch(const utility::string_t& value) +{ + m_ParentBranch = value; + m_ParentBranchIsSet = true; +} + +bool BranchContents::parentBranchIsSet() const +{ + return m_ParentBranchIsSet; +} + +void BranchContents::unsetParentBranch() +{ + m_ParentBranchIsSet = false; +} +int64_t BranchContents::getParentVersion() const +{ + return m_ParentVersion; +} + +void BranchContents::setParentVersion(int64_t value) +{ + m_ParentVersion = value; + m_ParentVersionIsSet = true; +} + +bool BranchContents::parentVersionIsSet() const +{ + return m_ParentVersionIsSet; +} + +void BranchContents::unsetParentVersion() +{ + m_ParentVersionIsSet = false; +} +int64_t BranchContents::getCreateAt() const +{ + return m_CreateAt; +} + +void BranchContents::setCreateAt(int64_t value) +{ + m_CreateAt = value; + m_CreateAtIsSet = true; +} + +bool BranchContents::createAtIsSet() const +{ + return m_CreateAtIsSet; +} + +void BranchContents::unsetCreateAt() +{ + m_CreateAtIsSet = false; +} +int64_t BranchContents::getManifestSize() const +{ + return m_ManifestSize; +} + +void BranchContents::setManifestSize(int64_t value) +{ + m_ManifestSize = value; + m_ManifestSizeIsSet = true; +} + +bool BranchContents::manifestSizeIsSet() const +{ + return m_ManifestSizeIsSet; +} + +void BranchContents::unsetManifestSize() +{ + m_ManifestSizeIsSet = false; +} +std::map BranchContents::getMetadata() const +{ + return m_Metadata; +} + + +void BranchContents::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool BranchContents::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void BranchContents::unsetMetadata() +{ + m_MetadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CommitTableOperation.cpp b/cpp/lance_namespace_rest_client/src/model/CommitTableOperation.cpp new file mode 100644 index 000000000..ac4182b77 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CommitTableOperation.cpp @@ -0,0 +1,267 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CommitTableOperation.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CommitTableOperation::CommitTableOperation() +{ + m_Declare_tableIsSet = false; + m_Create_table_versionIsSet = false; + m_Delete_table_versionsIsSet = false; + m_Deregister_tableIsSet = false; +} + +CommitTableOperation::~CommitTableOperation() +{ +} + +void CommitTableOperation::validate() +{ + // TODO: implement validation +} + +web::json::value CommitTableOperation::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Declare_tableIsSet) + { + + val[utility::conversions::to_string_t(U("declare_table"))] = ModelBase::toJson(m_Declare_table); + } + if(m_Create_table_versionIsSet) + { + + val[utility::conversions::to_string_t(U("create_table_version"))] = ModelBase::toJson(m_Create_table_version); + } + if(m_Delete_table_versionsIsSet) + { + + val[utility::conversions::to_string_t(U("delete_table_versions"))] = ModelBase::toJson(m_Delete_table_versions); + } + if(m_Deregister_tableIsSet) + { + + val[utility::conversions::to_string_t(U("deregister_table"))] = ModelBase::toJson(m_Deregister_table); + } + + return val; +} + +bool CommitTableOperation::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("declare_table")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("declare_table"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDeclareTable; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeclareTable); + setDeclareTable(refVal_setDeclareTable); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("create_table_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("create_table_version"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setCreateTableVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setCreateTableVersion); + setCreateTableVersion(refVal_setCreateTableVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("delete_table_versions")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("delete_table_versions"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDeleteTableVersions; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeleteTableVersions); + setDeleteTableVersions(refVal_setDeleteTableVersions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("deregister_table")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("deregister_table"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDeregisterTable; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeregisterTable); + setDeregisterTable(refVal_setDeregisterTable); + + } + } + return ok; +} + +void CommitTableOperation::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Declare_tableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("declare_table")), m_Declare_table)); + } + if(m_Create_table_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("create_table_version")), m_Create_table_version)); + } + if(m_Delete_table_versionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("delete_table_versions")), m_Delete_table_versions)); + } + if(m_Deregister_tableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("deregister_table")), m_Deregister_table)); + } +} + +bool CommitTableOperation::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("declare_table")))) + { + std::shared_ptr refVal_setDeclareTable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("declare_table"))), refVal_setDeclareTable ); + setDeclareTable(refVal_setDeclareTable); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("create_table_version")))) + { + std::shared_ptr refVal_setCreateTableVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("create_table_version"))), refVal_setCreateTableVersion ); + setCreateTableVersion(refVal_setCreateTableVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("delete_table_versions")))) + { + std::shared_ptr refVal_setDeleteTableVersions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("delete_table_versions"))), refVal_setDeleteTableVersions ); + setDeleteTableVersions(refVal_setDeleteTableVersions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("deregister_table")))) + { + std::shared_ptr refVal_setDeregisterTable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("deregister_table"))), refVal_setDeregisterTable ); + setDeregisterTable(refVal_setDeregisterTable); + } + return ok; +} + + +std::shared_ptr CommitTableOperation::getDeclareTable() const +{ + return m_Declare_table; +} + + +void CommitTableOperation::setDeclareTable(const std::shared_ptr& value) +{ + m_Declare_table = value; + m_Declare_tableIsSet = true; +} + +bool CommitTableOperation::declareTableIsSet() const +{ + return m_Declare_tableIsSet; +} + +void CommitTableOperation::unsetDeclare_table() +{ + m_Declare_tableIsSet = false; +} +std::shared_ptr CommitTableOperation::getCreateTableVersion() const +{ + return m_Create_table_version; +} + + +void CommitTableOperation::setCreateTableVersion(const std::shared_ptr& value) +{ + m_Create_table_version = value; + m_Create_table_versionIsSet = true; +} + +bool CommitTableOperation::createTableVersionIsSet() const +{ + return m_Create_table_versionIsSet; +} + +void CommitTableOperation::unsetCreate_table_version() +{ + m_Create_table_versionIsSet = false; +} +std::shared_ptr CommitTableOperation::getDeleteTableVersions() const +{ + return m_Delete_table_versions; +} + + +void CommitTableOperation::setDeleteTableVersions(const std::shared_ptr& value) +{ + m_Delete_table_versions = value; + m_Delete_table_versionsIsSet = true; +} + +bool CommitTableOperation::deleteTableVersionsIsSet() const +{ + return m_Delete_table_versionsIsSet; +} + +void CommitTableOperation::unsetDelete_table_versions() +{ + m_Delete_table_versionsIsSet = false; +} +std::shared_ptr CommitTableOperation::getDeregisterTable() const +{ + return m_Deregister_table; +} + + +void CommitTableOperation::setDeregisterTable(const std::shared_ptr& value) +{ + m_Deregister_table = value; + m_Deregister_tableIsSet = true; +} + +bool CommitTableOperation::deregisterTableIsSet() const +{ + return m_Deregister_tableIsSet; +} + +void CommitTableOperation::unsetDeregister_table() +{ + m_Deregister_tableIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CommitTableResult.cpp b/cpp/lance_namespace_rest_client/src/model/CommitTableResult.cpp new file mode 100644 index 000000000..b70a42518 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CommitTableResult.cpp @@ -0,0 +1,267 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CommitTableResult.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CommitTableResult::CommitTableResult() +{ + m_Declare_tableIsSet = false; + m_Create_table_versionIsSet = false; + m_Delete_table_versionsIsSet = false; + m_Deregister_tableIsSet = false; +} + +CommitTableResult::~CommitTableResult() +{ +} + +void CommitTableResult::validate() +{ + // TODO: implement validation +} + +web::json::value CommitTableResult::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Declare_tableIsSet) + { + + val[utility::conversions::to_string_t(U("declare_table"))] = ModelBase::toJson(m_Declare_table); + } + if(m_Create_table_versionIsSet) + { + + val[utility::conversions::to_string_t(U("create_table_version"))] = ModelBase::toJson(m_Create_table_version); + } + if(m_Delete_table_versionsIsSet) + { + + val[utility::conversions::to_string_t(U("delete_table_versions"))] = ModelBase::toJson(m_Delete_table_versions); + } + if(m_Deregister_tableIsSet) + { + + val[utility::conversions::to_string_t(U("deregister_table"))] = ModelBase::toJson(m_Deregister_table); + } + + return val; +} + +bool CommitTableResult::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("declare_table")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("declare_table"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDeclareTable; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeclareTable); + setDeclareTable(refVal_setDeclareTable); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("create_table_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("create_table_version"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setCreateTableVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setCreateTableVersion); + setCreateTableVersion(refVal_setCreateTableVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("delete_table_versions")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("delete_table_versions"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDeleteTableVersions; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeleteTableVersions); + setDeleteTableVersions(refVal_setDeleteTableVersions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("deregister_table")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("deregister_table"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDeregisterTable; + ok &= ModelBase::fromJson(fieldValue, refVal_setDeregisterTable); + setDeregisterTable(refVal_setDeregisterTable); + + } + } + return ok; +} + +void CommitTableResult::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Declare_tableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("declare_table")), m_Declare_table)); + } + if(m_Create_table_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("create_table_version")), m_Create_table_version)); + } + if(m_Delete_table_versionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("delete_table_versions")), m_Delete_table_versions)); + } + if(m_Deregister_tableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("deregister_table")), m_Deregister_table)); + } +} + +bool CommitTableResult::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("declare_table")))) + { + std::shared_ptr refVal_setDeclareTable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("declare_table"))), refVal_setDeclareTable ); + setDeclareTable(refVal_setDeclareTable); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("create_table_version")))) + { + std::shared_ptr refVal_setCreateTableVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("create_table_version"))), refVal_setCreateTableVersion ); + setCreateTableVersion(refVal_setCreateTableVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("delete_table_versions")))) + { + std::shared_ptr refVal_setDeleteTableVersions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("delete_table_versions"))), refVal_setDeleteTableVersions ); + setDeleteTableVersions(refVal_setDeleteTableVersions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("deregister_table")))) + { + std::shared_ptr refVal_setDeregisterTable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("deregister_table"))), refVal_setDeregisterTable ); + setDeregisterTable(refVal_setDeregisterTable); + } + return ok; +} + + +std::shared_ptr CommitTableResult::getDeclareTable() const +{ + return m_Declare_table; +} + + +void CommitTableResult::setDeclareTable(const std::shared_ptr& value) +{ + m_Declare_table = value; + m_Declare_tableIsSet = true; +} + +bool CommitTableResult::declareTableIsSet() const +{ + return m_Declare_tableIsSet; +} + +void CommitTableResult::unsetDeclare_table() +{ + m_Declare_tableIsSet = false; +} +std::shared_ptr CommitTableResult::getCreateTableVersion() const +{ + return m_Create_table_version; +} + + +void CommitTableResult::setCreateTableVersion(const std::shared_ptr& value) +{ + m_Create_table_version = value; + m_Create_table_versionIsSet = true; +} + +bool CommitTableResult::createTableVersionIsSet() const +{ + return m_Create_table_versionIsSet; +} + +void CommitTableResult::unsetCreate_table_version() +{ + m_Create_table_versionIsSet = false; +} +std::shared_ptr CommitTableResult::getDeleteTableVersions() const +{ + return m_Delete_table_versions; +} + + +void CommitTableResult::setDeleteTableVersions(const std::shared_ptr& value) +{ + m_Delete_table_versions = value; + m_Delete_table_versionsIsSet = true; +} + +bool CommitTableResult::deleteTableVersionsIsSet() const +{ + return m_Delete_table_versionsIsSet; +} + +void CommitTableResult::unsetDelete_table_versions() +{ + m_Delete_table_versionsIsSet = false; +} +std::shared_ptr CommitTableResult::getDeregisterTable() const +{ + return m_Deregister_table; +} + + +void CommitTableResult::setDeregisterTable(const std::shared_ptr& value) +{ + m_Deregister_table = value; + m_Deregister_tableIsSet = true; +} + +bool CommitTableResult::deregisterTableIsSet() const +{ + return m_Deregister_tableIsSet; +} + +void CommitTableResult::unsetDeregister_table() +{ + m_Deregister_tableIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CountTableRowsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CountTableRowsRequest.cpp new file mode 100644 index 000000000..ae44a9261 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CountTableRowsRequest.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CountTableRowsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CountTableRowsRequest::CountTableRowsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Predicate = utility::conversions::to_string_t(""); + m_PredicateIsSet = false; +} + +CountTableRowsRequest::~CountTableRowsRequest() +{ +} + +void CountTableRowsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CountTableRowsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_PredicateIsSet) + { + + val[utility::conversions::to_string_t(U("predicate"))] = ModelBase::toJson(m_Predicate); + } + + return val; +} + +bool CountTableRowsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("predicate")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("predicate"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPredicate; + ok &= ModelBase::fromJson(fieldValue, refVal_setPredicate); + setPredicate(refVal_setPredicate); + + } + } + return ok; +} + +void CountTableRowsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_PredicateIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("predicate")), m_Predicate)); + } +} + +bool CountTableRowsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("predicate")))) + { + utility::string_t refVal_setPredicate; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("predicate"))), refVal_setPredicate ); + setPredicate(refVal_setPredicate); + } + return ok; +} + + +std::shared_ptr CountTableRowsRequest::getIdentity() const +{ + return m_Identity; +} + + +void CountTableRowsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CountTableRowsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CountTableRowsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CountTableRowsRequest::getContext() const +{ + return m_Context; +} + + +void CountTableRowsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CountTableRowsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CountTableRowsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CountTableRowsRequest::getId() const +{ + return m_Id; +} + + +void CountTableRowsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CountTableRowsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CountTableRowsRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t CountTableRowsRequest::getVersion() const +{ + return m_Version; +} + +void CountTableRowsRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CountTableRowsRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CountTableRowsRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t CountTableRowsRequest::getBranch() const +{ + return m_Branch; +} + + +void CountTableRowsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool CountTableRowsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void CountTableRowsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t CountTableRowsRequest::getPredicate() const +{ + return m_Predicate; +} + + +void CountTableRowsRequest::setPredicate(const utility::string_t& value) +{ + m_Predicate = value; + m_PredicateIsSet = true; +} + +bool CountTableRowsRequest::predicateIsSet() const +{ + return m_PredicateIsSet; +} + +void CountTableRowsRequest::unsetPredicate() +{ + m_PredicateIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewRequest.cpp new file mode 100644 index 000000000..9d3d6ed55 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewRequest.cpp @@ -0,0 +1,497 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateMaterializedViewRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateMaterializedViewRequest::CreateMaterializedViewRequest() +{ + m_IdentityIsSet = false; + m_IdIsSet = false; + m_KindIsSet = false; + m_Source_query = utility::conversions::to_string_t(""); + m_Source_queryIsSet = false; + m_Output_schema = utility::conversions::to_string_t(""); + m_Output_schemaIsSet = false; + m_Udtf_specIsSet = false; + m_With_no_data = false; + m_With_no_dataIsSet = false; + m_Auto_refresh = false; + m_Auto_refreshIsSet = false; +} + +CreateMaterializedViewRequest::~CreateMaterializedViewRequest() +{ +} + +void CreateMaterializedViewRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateMaterializedViewRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_KindIsSet) + { + + utility::string_t refVal = fromKindEnum(m_Kind); + val[utility::conversions::to_string_t(U("kind"))] = ModelBase::toJson(refVal); + + } + if(m_Source_queryIsSet) + { + + val[utility::conversions::to_string_t(U("source_query"))] = ModelBase::toJson(m_Source_query); + } + if(m_Output_schemaIsSet) + { + + val[utility::conversions::to_string_t(U("output_schema"))] = ModelBase::toJson(m_Output_schema); + } + if(m_Udtf_specIsSet) + { + + val[utility::conversions::to_string_t(U("udtf_spec"))] = ModelBase::toJson(m_Udtf_spec); + } + if(m_With_no_dataIsSet) + { + + val[utility::conversions::to_string_t(U("with_no_data"))] = ModelBase::toJson(m_With_no_data); + } + if(m_Auto_refreshIsSet) + { + + val[utility::conversions::to_string_t(U("auto_refresh"))] = ModelBase::toJson(m_Auto_refresh); + } + + return val; +} + +bool CreateMaterializedViewRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("kind")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("kind"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setKind; + ok &= ModelBase::fromJson(fieldValue, refVal_setKind); + + setKind(toKindEnum(refVal_setKind)); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("source_query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("source_query"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setSourceQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setSourceQuery); + setSourceQuery(refVal_setSourceQuery); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("output_schema")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("output_schema"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setOutputSchema; + ok &= ModelBase::fromJson(fieldValue, refVal_setOutputSchema); + setOutputSchema(refVal_setOutputSchema); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udtf_spec")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udtf_spec"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setUdtfSpec; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdtfSpec); + setUdtfSpec(refVal_setUdtfSpec); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("with_no_data")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("with_no_data"))); + if(!fieldValue.is_null()) + { + bool refVal_setWithNoData; + ok &= ModelBase::fromJson(fieldValue, refVal_setWithNoData); + setWithNoData(refVal_setWithNoData); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("auto_refresh")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("auto_refresh"))); + if(!fieldValue.is_null()) + { + bool refVal_setAutoRefresh; + ok &= ModelBase::fromJson(fieldValue, refVal_setAutoRefresh); + setAutoRefresh(refVal_setAutoRefresh); + + } + } + return ok; +} + +void CreateMaterializedViewRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_KindIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("kind")), fromKindEnum(m_Kind))); + } + if(m_Source_queryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("source_query")), m_Source_query)); + } + if(m_Output_schemaIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("output_schema")), m_Output_schema)); + } + if(m_Udtf_specIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udtf_spec")), m_Udtf_spec)); + } + if(m_With_no_dataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("with_no_data")), m_With_no_data)); + } + if(m_Auto_refreshIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("auto_refresh")), m_Auto_refresh)); + } +} + +bool CreateMaterializedViewRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("kind")))) + { + utility::string_t refVal_setKind; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("kind"))), refVal_setKind ); + setKind(toKindEnum(refVal_setKind)); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("source_query")))) + { + utility::string_t refVal_setSourceQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("source_query"))), refVal_setSourceQuery ); + setSourceQuery(refVal_setSourceQuery); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("output_schema")))) + { + utility::string_t refVal_setOutputSchema; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("output_schema"))), refVal_setOutputSchema ); + setOutputSchema(refVal_setOutputSchema); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udtf_spec")))) + { + std::shared_ptr refVal_setUdtfSpec; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udtf_spec"))), refVal_setUdtfSpec ); + setUdtfSpec(refVal_setUdtfSpec); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("with_no_data")))) + { + bool refVal_setWithNoData; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("with_no_data"))), refVal_setWithNoData ); + setWithNoData(refVal_setWithNoData); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("auto_refresh")))) + { + bool refVal_setAutoRefresh; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("auto_refresh"))), refVal_setAutoRefresh ); + setAutoRefresh(refVal_setAutoRefresh); + } + return ok; +} + +CreateMaterializedViewRequest::KindEnum CreateMaterializedViewRequest::toKindEnum(const utility::string_t& value) const +{ + + if (value == utility::conversions::to_string_t("query")) { + return KindEnum::query; + } + + if (value == utility::conversions::to_string_t("udtf")) { + return KindEnum::udtf; + } + + if (value == utility::conversions::to_string_t("chunker")) { + return KindEnum::chunker; + } + + throw std::invalid_argument("Invalid value for conversion to KindEnum"); +} + + +const utility::string_t CreateMaterializedViewRequest::fromKindEnum(const KindEnum value) const +{ + switch(value) + { + + case KindEnum::query: return utility::conversions::to_string_t("query"); + + case KindEnum::udtf: return utility::conversions::to_string_t("udtf"); + + case KindEnum::chunker: return utility::conversions::to_string_t("chunker"); + + } +} + + +std::shared_ptr CreateMaterializedViewRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateMaterializedViewRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateMaterializedViewRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateMaterializedViewRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::vector CreateMaterializedViewRequest::getId() const +{ + return m_Id; +} + + +void CreateMaterializedViewRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateMaterializedViewRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateMaterializedViewRequest::unsetId() +{ + m_IdIsSet = false; +} +CreateMaterializedViewRequest::KindEnum CreateMaterializedViewRequest::getKind() const +{ + return m_Kind; +} + + +void CreateMaterializedViewRequest::setKind(const KindEnum value) +{ + m_Kind = value; + m_KindIsSet = true; +} + +bool CreateMaterializedViewRequest::kindIsSet() const +{ + return m_KindIsSet; +} + +void CreateMaterializedViewRequest::unsetKind() +{ + m_KindIsSet = false; +} +utility::string_t CreateMaterializedViewRequest::getSourceQuery() const +{ + return m_Source_query; +} + + +void CreateMaterializedViewRequest::setSourceQuery(const utility::string_t& value) +{ + m_Source_query = value; + m_Source_queryIsSet = true; +} + +bool CreateMaterializedViewRequest::sourceQueryIsSet() const +{ + return m_Source_queryIsSet; +} + +void CreateMaterializedViewRequest::unsetSource_query() +{ + m_Source_queryIsSet = false; +} +utility::string_t CreateMaterializedViewRequest::getOutputSchema() const +{ + return m_Output_schema; +} + + +void CreateMaterializedViewRequest::setOutputSchema(const utility::string_t& value) +{ + m_Output_schema = value; + m_Output_schemaIsSet = true; +} + +bool CreateMaterializedViewRequest::outputSchemaIsSet() const +{ + return m_Output_schemaIsSet; +} + +void CreateMaterializedViewRequest::unsetOutput_schema() +{ + m_Output_schemaIsSet = false; +} +std::shared_ptr CreateMaterializedViewRequest::getUdtfSpec() const +{ + return m_Udtf_spec; +} + + +void CreateMaterializedViewRequest::setUdtfSpec(const std::shared_ptr& value) +{ + m_Udtf_spec = value; + m_Udtf_specIsSet = true; +} + +bool CreateMaterializedViewRequest::udtfSpecIsSet() const +{ + return m_Udtf_specIsSet; +} + +void CreateMaterializedViewRequest::unsetUdtf_spec() +{ + m_Udtf_specIsSet = false; +} +bool CreateMaterializedViewRequest::isWithNoData() const +{ + return m_With_no_data; +} + +void CreateMaterializedViewRequest::setWithNoData(bool value) +{ + m_With_no_data = value; + m_With_no_dataIsSet = true; +} + +bool CreateMaterializedViewRequest::withNoDataIsSet() const +{ + return m_With_no_dataIsSet; +} + +void CreateMaterializedViewRequest::unsetWith_no_data() +{ + m_With_no_dataIsSet = false; +} +bool CreateMaterializedViewRequest::isAutoRefresh() const +{ + return m_Auto_refresh; +} + +void CreateMaterializedViewRequest::setAutoRefresh(bool value) +{ + m_Auto_refresh = value; + m_Auto_refreshIsSet = true; +} + +bool CreateMaterializedViewRequest::autoRefreshIsSet() const +{ + return m_Auto_refreshIsSet; +} + +void CreateMaterializedViewRequest::unsetAuto_refresh() +{ + m_Auto_refreshIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewResponse.cpp new file mode 100644 index 000000000..3ef5af65b --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateMaterializedViewResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateMaterializedViewResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateMaterializedViewResponse::CreateMaterializedViewResponse() +{ + m_Version = 0L; + m_VersionIsSet = false; + m_Job_id = utility::conversions::to_string_t(""); + m_Job_idIsSet = false; +} + +CreateMaterializedViewResponse::~CreateMaterializedViewResponse() +{ +} + +void CreateMaterializedViewResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateMaterializedViewResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_Job_idIsSet) + { + + val[utility::conversions::to_string_t(U("job_id"))] = ModelBase::toJson(m_Job_id); + } + + return val; +} + +bool CreateMaterializedViewResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("job_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("job_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setJobId; + ok &= ModelBase::fromJson(fieldValue, refVal_setJobId); + setJobId(refVal_setJobId); + + } + } + return ok; +} + +void CreateMaterializedViewResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_Job_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("job_id")), m_Job_id)); + } +} + +bool CreateMaterializedViewResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("job_id")))) + { + utility::string_t refVal_setJobId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("job_id"))), refVal_setJobId ); + setJobId(refVal_setJobId); + } + return ok; +} + + +int64_t CreateMaterializedViewResponse::getVersion() const +{ + return m_Version; +} + +void CreateMaterializedViewResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CreateMaterializedViewResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CreateMaterializedViewResponse::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t CreateMaterializedViewResponse::getJobId() const +{ + return m_Job_id; +} + + +void CreateMaterializedViewResponse::setJobId(const utility::string_t& value) +{ + m_Job_id = value; + m_Job_idIsSet = true; +} + +bool CreateMaterializedViewResponse::jobIdIsSet() const +{ + return m_Job_idIsSet; +} + +void CreateMaterializedViewResponse::unsetJob_id() +{ + m_Job_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateNamespaceRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateNamespaceRequest.cpp new file mode 100644 index 000000000..c9f2ce0ca --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateNamespaceRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateNamespaceRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateNamespaceRequest::CreateNamespaceRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; + m_PropertiesIsSet = false; +} + +CreateNamespaceRequest::~CreateNamespaceRequest() +{ +} + +void CreateNamespaceRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateNamespaceRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool CreateNamespaceRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void CreateNamespaceRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool CreateNamespaceRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +std::shared_ptr CreateNamespaceRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateNamespaceRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateNamespaceRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateNamespaceRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CreateNamespaceRequest::getContext() const +{ + return m_Context; +} + + +void CreateNamespaceRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CreateNamespaceRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CreateNamespaceRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CreateNamespaceRequest::getId() const +{ + return m_Id; +} + + +void CreateNamespaceRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateNamespaceRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateNamespaceRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t CreateNamespaceRequest::getMode() const +{ + return m_Mode; +} + + +void CreateNamespaceRequest::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool CreateNamespaceRequest::modeIsSet() const +{ + return m_ModeIsSet; +} + +void CreateNamespaceRequest::unsetMode() +{ + m_ModeIsSet = false; +} +std::map CreateNamespaceRequest::getProperties() const +{ + return m_Properties; +} + + +void CreateNamespaceRequest::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool CreateNamespaceRequest::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void CreateNamespaceRequest::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateNamespaceResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateNamespaceResponse.cpp new file mode 100644 index 000000000..dbd30dc1d --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateNamespaceResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateNamespaceResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateNamespaceResponse::CreateNamespaceResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_PropertiesIsSet = false; +} + +CreateNamespaceResponse::~CreateNamespaceResponse() +{ +} + +void CreateNamespaceResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateNamespaceResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool CreateNamespaceResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void CreateNamespaceResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool CreateNamespaceResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t CreateNamespaceResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateNamespaceResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateNamespaceResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateNamespaceResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +std::map CreateNamespaceResponse::getProperties() const +{ + return m_Properties; +} + + +void CreateNamespaceResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool CreateNamespaceResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void CreateNamespaceResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableBranchRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableBranchRequest.cpp new file mode 100644 index 000000000..b9be6ea2e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableBranchRequest.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableBranchRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableBranchRequest::CreateTableBranchRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Name = utility::conversions::to_string_t(""); + m_NameIsSet = false; + m_From_branch = utility::conversions::to_string_t(""); + m_From_branchIsSet = false; + m_From_version = 0L; + m_From_versionIsSet = false; +} + +CreateTableBranchRequest::~CreateTableBranchRequest() +{ +} + +void CreateTableBranchRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableBranchRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_NameIsSet) + { + + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); + } + if(m_From_branchIsSet) + { + + val[utility::conversions::to_string_t(U("from_branch"))] = ModelBase::toJson(m_From_branch); + } + if(m_From_versionIsSet) + { + + val[utility::conversions::to_string_t(U("from_version"))] = ModelBase::toJson(m_From_version); + } + + return val; +} + +bool CreateTableBranchRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromJson(fieldValue, refVal_setName); + setName(refVal_setName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("from_branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("from_branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setFromBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setFromBranch); + setFromBranch(refVal_setFromBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("from_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("from_version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setFromVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setFromVersion); + setFromVersion(refVal_setFromVersion); + + } + } + return ok; +} + +void CreateTableBranchRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_NameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } + if(m_From_branchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("from_branch")), m_From_branch)); + } + if(m_From_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("from_version")), m_From_version)); + } +} + +bool CreateTableBranchRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); + setName(refVal_setName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("from_branch")))) + { + utility::string_t refVal_setFromBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("from_branch"))), refVal_setFromBranch ); + setFromBranch(refVal_setFromBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("from_version")))) + { + int64_t refVal_setFromVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("from_version"))), refVal_setFromVersion ); + setFromVersion(refVal_setFromVersion); + } + return ok; +} + + +std::shared_ptr CreateTableBranchRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateTableBranchRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateTableBranchRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateTableBranchRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CreateTableBranchRequest::getContext() const +{ + return m_Context; +} + + +void CreateTableBranchRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CreateTableBranchRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CreateTableBranchRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CreateTableBranchRequest::getId() const +{ + return m_Id; +} + + +void CreateTableBranchRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateTableBranchRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateTableBranchRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t CreateTableBranchRequest::getName() const +{ + return m_Name; +} + + +void CreateTableBranchRequest::setName(const utility::string_t& value) +{ + m_Name = value; + m_NameIsSet = true; +} + +bool CreateTableBranchRequest::nameIsSet() const +{ + return m_NameIsSet; +} + +void CreateTableBranchRequest::unsetName() +{ + m_NameIsSet = false; +} +utility::string_t CreateTableBranchRequest::getFromBranch() const +{ + return m_From_branch; +} + + +void CreateTableBranchRequest::setFromBranch(const utility::string_t& value) +{ + m_From_branch = value; + m_From_branchIsSet = true; +} + +bool CreateTableBranchRequest::fromBranchIsSet() const +{ + return m_From_branchIsSet; +} + +void CreateTableBranchRequest::unsetFrom_branch() +{ + m_From_branchIsSet = false; +} +int64_t CreateTableBranchRequest::getFromVersion() const +{ + return m_From_version; +} + +void CreateTableBranchRequest::setFromVersion(int64_t value) +{ + m_From_version = value; + m_From_versionIsSet = true; +} + +bool CreateTableBranchRequest::fromVersionIsSet() const +{ + return m_From_versionIsSet; +} + +void CreateTableBranchRequest::unsetFrom_version() +{ + m_From_versionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableBranchResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableBranchResponse.cpp new file mode 100644 index 000000000..5f4ad36fd --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableBranchResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableBranchResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableBranchResponse::CreateTableBranchResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +CreateTableBranchResponse::~CreateTableBranchResponse() +{ +} + +void CreateTableBranchResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableBranchResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool CreateTableBranchResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void CreateTableBranchResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool CreateTableBranchResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t CreateTableBranchResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateTableBranchResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateTableBranchResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateTableBranchResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableIndexRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableIndexRequest.cpp new file mode 100644 index 000000000..a2e2795b0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableIndexRequest.cpp @@ -0,0 +1,850 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableIndexRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableIndexRequest::CreateTableIndexRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Column = utility::conversions::to_string_t(""); + m_ColumnIsSet = false; + m_Index_type = utility::conversions::to_string_t(""); + m_Index_typeIsSet = false; + m_Name = utility::conversions::to_string_t(""); + m_NameIsSet = false; + m_Distance_type = utility::conversions::to_string_t(""); + m_Distance_typeIsSet = false; + m_With_position = false; + m_With_positionIsSet = false; + m_Base_tokenizer = utility::conversions::to_string_t(""); + m_Base_tokenizerIsSet = false; + m_Language = utility::conversions::to_string_t(""); + m_LanguageIsSet = false; + m_Max_token_length = 0; + m_Max_token_lengthIsSet = false; + m_Lower_case = false; + m_Lower_caseIsSet = false; + m_Stem = false; + m_StemIsSet = false; + m_Remove_stop_words = false; + m_Remove_stop_wordsIsSet = false; + m_Ascii_folding = false; + m_Ascii_foldingIsSet = false; +} + +CreateTableIndexRequest::~CreateTableIndexRequest() +{ +} + +void CreateTableIndexRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableIndexRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_ColumnIsSet) + { + + val[utility::conversions::to_string_t(U("column"))] = ModelBase::toJson(m_Column); + } + if(m_Index_typeIsSet) + { + + val[utility::conversions::to_string_t(U("index_type"))] = ModelBase::toJson(m_Index_type); + } + if(m_NameIsSet) + { + + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); + } + if(m_Distance_typeIsSet) + { + + val[utility::conversions::to_string_t(U("distance_type"))] = ModelBase::toJson(m_Distance_type); + } + if(m_With_positionIsSet) + { + + val[utility::conversions::to_string_t(U("with_position"))] = ModelBase::toJson(m_With_position); + } + if(m_Base_tokenizerIsSet) + { + + val[utility::conversions::to_string_t(U("base_tokenizer"))] = ModelBase::toJson(m_Base_tokenizer); + } + if(m_LanguageIsSet) + { + + val[utility::conversions::to_string_t(U("language"))] = ModelBase::toJson(m_Language); + } + if(m_Max_token_lengthIsSet) + { + + val[utility::conversions::to_string_t(U("max_token_length"))] = ModelBase::toJson(m_Max_token_length); + } + if(m_Lower_caseIsSet) + { + + val[utility::conversions::to_string_t(U("lower_case"))] = ModelBase::toJson(m_Lower_case); + } + if(m_StemIsSet) + { + + val[utility::conversions::to_string_t(U("stem"))] = ModelBase::toJson(m_Stem); + } + if(m_Remove_stop_wordsIsSet) + { + + val[utility::conversions::to_string_t(U("remove_stop_words"))] = ModelBase::toJson(m_Remove_stop_words); + } + if(m_Ascii_foldingIsSet) + { + + val[utility::conversions::to_string_t(U("ascii_folding"))] = ModelBase::toJson(m_Ascii_folding); + } + + return val; +} + +bool CreateTableIndexRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumn); + setColumn(refVal_setColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexType; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexType); + setIndexType(refVal_setIndexType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromJson(fieldValue, refVal_setName); + setName(refVal_setName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("distance_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("distance_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromJson(fieldValue, refVal_setDistanceType); + setDistanceType(refVal_setDistanceType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("with_position")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("with_position"))); + if(!fieldValue.is_null()) + { + bool refVal_setWithPosition; + ok &= ModelBase::fromJson(fieldValue, refVal_setWithPosition); + setWithPosition(refVal_setWithPosition); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("base_tokenizer")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("base_tokenizer"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBaseTokenizer; + ok &= ModelBase::fromJson(fieldValue, refVal_setBaseTokenizer); + setBaseTokenizer(refVal_setBaseTokenizer); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("language")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("language"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLanguage; + ok &= ModelBase::fromJson(fieldValue, refVal_setLanguage); + setLanguage(refVal_setLanguage); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("max_token_length")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("max_token_length"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setMaxTokenLength; + ok &= ModelBase::fromJson(fieldValue, refVal_setMaxTokenLength); + setMaxTokenLength(refVal_setMaxTokenLength); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("lower_case")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("lower_case"))); + if(!fieldValue.is_null()) + { + bool refVal_setLowerCase; + ok &= ModelBase::fromJson(fieldValue, refVal_setLowerCase); + setLowerCase(refVal_setLowerCase); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("stem")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("stem"))); + if(!fieldValue.is_null()) + { + bool refVal_setStem; + ok &= ModelBase::fromJson(fieldValue, refVal_setStem); + setStem(refVal_setStem); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("remove_stop_words")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("remove_stop_words"))); + if(!fieldValue.is_null()) + { + bool refVal_setRemoveStopWords; + ok &= ModelBase::fromJson(fieldValue, refVal_setRemoveStopWords); + setRemoveStopWords(refVal_setRemoveStopWords); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("ascii_folding")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("ascii_folding"))); + if(!fieldValue.is_null()) + { + bool refVal_setAsciiFolding; + ok &= ModelBase::fromJson(fieldValue, refVal_setAsciiFolding); + setAsciiFolding(refVal_setAsciiFolding); + + } + } + return ok; +} + +void CreateTableIndexRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_ColumnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column")), m_Column)); + } + if(m_Index_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_type")), m_Index_type)); + } + if(m_NameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } + if(m_Distance_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("distance_type")), m_Distance_type)); + } + if(m_With_positionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("with_position")), m_With_position)); + } + if(m_Base_tokenizerIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("base_tokenizer")), m_Base_tokenizer)); + } + if(m_LanguageIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("language")), m_Language)); + } + if(m_Max_token_lengthIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("max_token_length")), m_Max_token_length)); + } + if(m_Lower_caseIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lower_case")), m_Lower_case)); + } + if(m_StemIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("stem")), m_Stem)); + } + if(m_Remove_stop_wordsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("remove_stop_words")), m_Remove_stop_words)); + } + if(m_Ascii_foldingIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("ascii_folding")), m_Ascii_folding)); + } +} + +bool CreateTableIndexRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("column")))) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column"))), refVal_setColumn ); + setColumn(refVal_setColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_type")))) + { + utility::string_t refVal_setIndexType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_type"))), refVal_setIndexType ); + setIndexType(refVal_setIndexType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); + setName(refVal_setName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("distance_type")))) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("distance_type"))), refVal_setDistanceType ); + setDistanceType(refVal_setDistanceType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("with_position")))) + { + bool refVal_setWithPosition; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("with_position"))), refVal_setWithPosition ); + setWithPosition(refVal_setWithPosition); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("base_tokenizer")))) + { + utility::string_t refVal_setBaseTokenizer; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("base_tokenizer"))), refVal_setBaseTokenizer ); + setBaseTokenizer(refVal_setBaseTokenizer); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("language")))) + { + utility::string_t refVal_setLanguage; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("language"))), refVal_setLanguage ); + setLanguage(refVal_setLanguage); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("max_token_length")))) + { + int32_t refVal_setMaxTokenLength; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("max_token_length"))), refVal_setMaxTokenLength ); + setMaxTokenLength(refVal_setMaxTokenLength); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("lower_case")))) + { + bool refVal_setLowerCase; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lower_case"))), refVal_setLowerCase ); + setLowerCase(refVal_setLowerCase); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("stem")))) + { + bool refVal_setStem; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("stem"))), refVal_setStem ); + setStem(refVal_setStem); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("remove_stop_words")))) + { + bool refVal_setRemoveStopWords; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("remove_stop_words"))), refVal_setRemoveStopWords ); + setRemoveStopWords(refVal_setRemoveStopWords); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("ascii_folding")))) + { + bool refVal_setAsciiFolding; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("ascii_folding"))), refVal_setAsciiFolding ); + setAsciiFolding(refVal_setAsciiFolding); + } + return ok; +} + + +std::shared_ptr CreateTableIndexRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateTableIndexRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateTableIndexRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateTableIndexRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CreateTableIndexRequest::getContext() const +{ + return m_Context; +} + + +void CreateTableIndexRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CreateTableIndexRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CreateTableIndexRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CreateTableIndexRequest::getId() const +{ + return m_Id; +} + + +void CreateTableIndexRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateTableIndexRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateTableIndexRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t CreateTableIndexRequest::getBranch() const +{ + return m_Branch; +} + + +void CreateTableIndexRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool CreateTableIndexRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void CreateTableIndexRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t CreateTableIndexRequest::getColumn() const +{ + return m_Column; +} + + +void CreateTableIndexRequest::setColumn(const utility::string_t& value) +{ + m_Column = value; + m_ColumnIsSet = true; +} + +bool CreateTableIndexRequest::columnIsSet() const +{ + return m_ColumnIsSet; +} + +void CreateTableIndexRequest::unsetColumn() +{ + m_ColumnIsSet = false; +} +utility::string_t CreateTableIndexRequest::getIndexType() const +{ + return m_Index_type; +} + + +void CreateTableIndexRequest::setIndexType(const utility::string_t& value) +{ + m_Index_type = value; + m_Index_typeIsSet = true; +} + +bool CreateTableIndexRequest::indexTypeIsSet() const +{ + return m_Index_typeIsSet; +} + +void CreateTableIndexRequest::unsetIndex_type() +{ + m_Index_typeIsSet = false; +} +utility::string_t CreateTableIndexRequest::getName() const +{ + return m_Name; +} + + +void CreateTableIndexRequest::setName(const utility::string_t& value) +{ + m_Name = value; + m_NameIsSet = true; +} + +bool CreateTableIndexRequest::nameIsSet() const +{ + return m_NameIsSet; +} + +void CreateTableIndexRequest::unsetName() +{ + m_NameIsSet = false; +} +utility::string_t CreateTableIndexRequest::getDistanceType() const +{ + return m_Distance_type; +} + + +void CreateTableIndexRequest::setDistanceType(const utility::string_t& value) +{ + m_Distance_type = value; + m_Distance_typeIsSet = true; +} + +bool CreateTableIndexRequest::distanceTypeIsSet() const +{ + return m_Distance_typeIsSet; +} + +void CreateTableIndexRequest::unsetDistance_type() +{ + m_Distance_typeIsSet = false; +} +bool CreateTableIndexRequest::isWithPosition() const +{ + return m_With_position; +} + +void CreateTableIndexRequest::setWithPosition(bool value) +{ + m_With_position = value; + m_With_positionIsSet = true; +} + +bool CreateTableIndexRequest::withPositionIsSet() const +{ + return m_With_positionIsSet; +} + +void CreateTableIndexRequest::unsetWith_position() +{ + m_With_positionIsSet = false; +} +utility::string_t CreateTableIndexRequest::getBaseTokenizer() const +{ + return m_Base_tokenizer; +} + + +void CreateTableIndexRequest::setBaseTokenizer(const utility::string_t& value) +{ + m_Base_tokenizer = value; + m_Base_tokenizerIsSet = true; +} + +bool CreateTableIndexRequest::baseTokenizerIsSet() const +{ + return m_Base_tokenizerIsSet; +} + +void CreateTableIndexRequest::unsetBase_tokenizer() +{ + m_Base_tokenizerIsSet = false; +} +utility::string_t CreateTableIndexRequest::getLanguage() const +{ + return m_Language; +} + + +void CreateTableIndexRequest::setLanguage(const utility::string_t& value) +{ + m_Language = value; + m_LanguageIsSet = true; +} + +bool CreateTableIndexRequest::languageIsSet() const +{ + return m_LanguageIsSet; +} + +void CreateTableIndexRequest::unsetLanguage() +{ + m_LanguageIsSet = false; +} +int32_t CreateTableIndexRequest::getMaxTokenLength() const +{ + return m_Max_token_length; +} + +void CreateTableIndexRequest::setMaxTokenLength(int32_t value) +{ + m_Max_token_length = value; + m_Max_token_lengthIsSet = true; +} + +bool CreateTableIndexRequest::maxTokenLengthIsSet() const +{ + return m_Max_token_lengthIsSet; +} + +void CreateTableIndexRequest::unsetMax_token_length() +{ + m_Max_token_lengthIsSet = false; +} +bool CreateTableIndexRequest::isLowerCase() const +{ + return m_Lower_case; +} + +void CreateTableIndexRequest::setLowerCase(bool value) +{ + m_Lower_case = value; + m_Lower_caseIsSet = true; +} + +bool CreateTableIndexRequest::lowerCaseIsSet() const +{ + return m_Lower_caseIsSet; +} + +void CreateTableIndexRequest::unsetLower_case() +{ + m_Lower_caseIsSet = false; +} +bool CreateTableIndexRequest::isStem() const +{ + return m_Stem; +} + +void CreateTableIndexRequest::setStem(bool value) +{ + m_Stem = value; + m_StemIsSet = true; +} + +bool CreateTableIndexRequest::stemIsSet() const +{ + return m_StemIsSet; +} + +void CreateTableIndexRequest::unsetStem() +{ + m_StemIsSet = false; +} +bool CreateTableIndexRequest::isRemoveStopWords() const +{ + return m_Remove_stop_words; +} + +void CreateTableIndexRequest::setRemoveStopWords(bool value) +{ + m_Remove_stop_words = value; + m_Remove_stop_wordsIsSet = true; +} + +bool CreateTableIndexRequest::removeStopWordsIsSet() const +{ + return m_Remove_stop_wordsIsSet; +} + +void CreateTableIndexRequest::unsetRemove_stop_words() +{ + m_Remove_stop_wordsIsSet = false; +} +bool CreateTableIndexRequest::isAsciiFolding() const +{ + return m_Ascii_folding; +} + +void CreateTableIndexRequest::setAsciiFolding(bool value) +{ + m_Ascii_folding = value; + m_Ascii_foldingIsSet = true; +} + +bool CreateTableIndexRequest::asciiFoldingIsSet() const +{ + return m_Ascii_foldingIsSet; +} + +void CreateTableIndexRequest::unsetAscii_folding() +{ + m_Ascii_foldingIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableIndexResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableIndexResponse.cpp new file mode 100644 index 000000000..1a5cbb3e4 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableIndexResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableIndexResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableIndexResponse::CreateTableIndexResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +CreateTableIndexResponse::~CreateTableIndexResponse() +{ +} + +void CreateTableIndexResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableIndexResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool CreateTableIndexResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void CreateTableIndexResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool CreateTableIndexResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t CreateTableIndexResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateTableIndexResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateTableIndexResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateTableIndexResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableRequest.cpp new file mode 100644 index 000000000..74a7dab85 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableRequest.cpp @@ -0,0 +1,364 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableRequest::CreateTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; + m_PropertiesIsSet = false; + m_Storage_optionsIsSet = false; +} + +CreateTableRequest::~CreateTableRequest() +{ +} + +void CreateTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + if(m_Storage_optionsIsSet) + { + + val[utility::conversions::to_string_t(U("storage_options"))] = ModelBase::toJson(m_Storage_options); + } + + return val; +} + +bool CreateTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("storage_options")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("storage_options"))); + if(!fieldValue.is_null()) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromJson(fieldValue, refVal_setStorageOptions); + setStorageOptions(refVal_setStorageOptions); + + } + } + return ok; +} + +void CreateTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } + if(m_Storage_optionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("storage_options")), m_Storage_options)); + } +} + +bool CreateTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("storage_options")))) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("storage_options"))), refVal_setStorageOptions ); + setStorageOptions(refVal_setStorageOptions); + } + return ok; +} + + +std::shared_ptr CreateTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CreateTableRequest::getContext() const +{ + return m_Context; +} + + +void CreateTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CreateTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CreateTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CreateTableRequest::getId() const +{ + return m_Id; +} + + +void CreateTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t CreateTableRequest::getMode() const +{ + return m_Mode; +} + + +void CreateTableRequest::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool CreateTableRequest::modeIsSet() const +{ + return m_ModeIsSet; +} + +void CreateTableRequest::unsetMode() +{ + m_ModeIsSet = false; +} +std::map CreateTableRequest::getProperties() const +{ + return m_Properties; +} + + +void CreateTableRequest::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool CreateTableRequest::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void CreateTableRequest::unsetProperties() +{ + m_PropertiesIsSet = false; +} +std::map CreateTableRequest::getStorageOptions() const +{ + return m_Storage_options; +} + + +void CreateTableRequest::setStorageOptions(const std::map& value) +{ + m_Storage_options = value; + m_Storage_optionsIsSet = true; +} + +bool CreateTableRequest::storageOptionsIsSet() const +{ + return m_Storage_optionsIsSet; +} + +void CreateTableRequest::unsetStorage_options() +{ + m_Storage_optionsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableResponse.cpp new file mode 100644 index 000000000..9a3c223a5 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableResponse.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableResponse::CreateTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Storage_optionsIsSet = false; + m_PropertiesIsSet = false; +} + +CreateTableResponse::~CreateTableResponse() +{ +} + +void CreateTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_Storage_optionsIsSet) + { + + val[utility::conversions::to_string_t(U("storage_options"))] = ModelBase::toJson(m_Storage_options); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool CreateTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("storage_options")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("storage_options"))); + if(!fieldValue.is_null()) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromJson(fieldValue, refVal_setStorageOptions); + setStorageOptions(refVal_setStorageOptions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void CreateTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_Storage_optionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("storage_options")), m_Storage_options)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool CreateTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("storage_options")))) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("storage_options"))), refVal_setStorageOptions ); + setStorageOptions(refVal_setStorageOptions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t CreateTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +utility::string_t CreateTableResponse::getLocation() const +{ + return m_Location; +} + + +void CreateTableResponse::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool CreateTableResponse::locationIsSet() const +{ + return m_LocationIsSet; +} + +void CreateTableResponse::unsetLocation() +{ + m_LocationIsSet = false; +} +int64_t CreateTableResponse::getVersion() const +{ + return m_Version; +} + +void CreateTableResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CreateTableResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CreateTableResponse::unsetVersion() +{ + m_VersionIsSet = false; +} +std::map CreateTableResponse::getStorageOptions() const +{ + return m_Storage_options; +} + + +void CreateTableResponse::setStorageOptions(const std::map& value) +{ + m_Storage_options = value; + m_Storage_optionsIsSet = true; +} + +bool CreateTableResponse::storageOptionsIsSet() const +{ + return m_Storage_optionsIsSet; +} + +void CreateTableResponse::unsetStorage_options() +{ + m_Storage_optionsIsSet = false; +} +std::map CreateTableResponse::getProperties() const +{ + return m_Properties; +} + + +void CreateTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool CreateTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void CreateTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableScalarIndexResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableScalarIndexResponse.cpp new file mode 100644 index 000000000..a267bba7b --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableScalarIndexResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableScalarIndexResponse::CreateTableScalarIndexResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +CreateTableScalarIndexResponse::~CreateTableScalarIndexResponse() +{ +} + +void CreateTableScalarIndexResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableScalarIndexResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool CreateTableScalarIndexResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void CreateTableScalarIndexResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool CreateTableScalarIndexResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t CreateTableScalarIndexResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateTableScalarIndexResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateTableScalarIndexResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateTableScalarIndexResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableTagRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableTagRequest.cpp new file mode 100644 index 000000000..dd477aaed --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableTagRequest.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableTagRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableTagRequest::CreateTableTagRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Tag = utility::conversions::to_string_t(""); + m_TagIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; +} + +CreateTableTagRequest::~CreateTableTagRequest() +{ +} + +void CreateTableTagRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableTagRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_TagIsSet) + { + + val[utility::conversions::to_string_t(U("tag"))] = ModelBase::toJson(m_Tag); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + + return val; +} + +bool CreateTableTagRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromJson(fieldValue, refVal_setTag); + setTag(refVal_setTag); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + return ok; +} + +void CreateTableTagRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_TagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tag")), m_Tag)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } +} + +bool CreateTableTagRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("tag")))) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tag"))), refVal_setTag ); + setTag(refVal_setTag); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + return ok; +} + + +std::shared_ptr CreateTableTagRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateTableTagRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateTableTagRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateTableTagRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CreateTableTagRequest::getContext() const +{ + return m_Context; +} + + +void CreateTableTagRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CreateTableTagRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CreateTableTagRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CreateTableTagRequest::getId() const +{ + return m_Id; +} + + +void CreateTableTagRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateTableTagRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateTableTagRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t CreateTableTagRequest::getTag() const +{ + return m_Tag; +} + + +void CreateTableTagRequest::setTag(const utility::string_t& value) +{ + m_Tag = value; + m_TagIsSet = true; +} + +bool CreateTableTagRequest::tagIsSet() const +{ + return m_TagIsSet; +} + +void CreateTableTagRequest::unsetTag() +{ + m_TagIsSet = false; +} +int64_t CreateTableTagRequest::getVersion() const +{ + return m_Version; +} + +void CreateTableTagRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CreateTableTagRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CreateTableTagRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t CreateTableTagRequest::getBranch() const +{ + return m_Branch; +} + + +void CreateTableTagRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool CreateTableTagRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void CreateTableTagRequest::unsetBranch() +{ + m_BranchIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableTagResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableTagResponse.cpp new file mode 100644 index 000000000..ad4c8c511 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableTagResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableTagResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableTagResponse::CreateTableTagResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +CreateTableTagResponse::~CreateTableTagResponse() +{ +} + +void CreateTableTagResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableTagResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool CreateTableTagResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void CreateTableTagResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool CreateTableTagResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t CreateTableTagResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateTableTagResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateTableTagResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateTableTagResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableVersionEntry.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableVersionEntry.cpp new file mode 100644 index 000000000..b7d6c8b72 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableVersionEntry.cpp @@ -0,0 +1,463 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableVersionEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableVersionEntry::CreateTableVersionEntry() +{ + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Manifest_path = utility::conversions::to_string_t(""); + m_Manifest_pathIsSet = false; + m_Manifest_size = 0L; + m_Manifest_sizeIsSet = false; + m_E_tag = utility::conversions::to_string_t(""); + m_E_tagIsSet = false; + m_MetadataIsSet = false; + m_Naming_scheme = utility::conversions::to_string_t(""); + m_Naming_schemeIsSet = false; +} + +CreateTableVersionEntry::~CreateTableVersionEntry() +{ +} + +void CreateTableVersionEntry::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableVersionEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Manifest_pathIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_path"))] = ModelBase::toJson(m_Manifest_path); + } + if(m_Manifest_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_size"))] = ModelBase::toJson(m_Manifest_size); + } + if(m_E_tagIsSet) + { + + val[utility::conversions::to_string_t(U("e_tag"))] = ModelBase::toJson(m_E_tag); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + if(m_Naming_schemeIsSet) + { + + val[utility::conversions::to_string_t(U("naming_scheme"))] = ModelBase::toJson(m_Naming_scheme); + } + + return val; +} + +bool CreateTableVersionEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_path")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_path"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifestPath; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestPath); + setManifestPath(refVal_setManifestPath); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_size"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestSize); + setManifestSize(refVal_setManifestSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("e_tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("e_tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setETag; + ok &= ModelBase::fromJson(fieldValue, refVal_setETag); + setETag(refVal_setETag); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("naming_scheme")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("naming_scheme"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setNamingScheme; + ok &= ModelBase::fromJson(fieldValue, refVal_setNamingScheme); + setNamingScheme(refVal_setNamingScheme); + + } + } + return ok; +} + +void CreateTableVersionEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Manifest_pathIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_path")), m_Manifest_path)); + } + if(m_Manifest_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_size")), m_Manifest_size)); + } + if(m_E_tagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("e_tag")), m_E_tag)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } + if(m_Naming_schemeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("naming_scheme")), m_Naming_scheme)); + } +} + +bool CreateTableVersionEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_path")))) + { + utility::string_t refVal_setManifestPath; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_path"))), refVal_setManifestPath ); + setManifestPath(refVal_setManifestPath); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_size")))) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_size"))), refVal_setManifestSize ); + setManifestSize(refVal_setManifestSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("e_tag")))) + { + utility::string_t refVal_setETag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("e_tag"))), refVal_setETag ); + setETag(refVal_setETag); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("naming_scheme")))) + { + utility::string_t refVal_setNamingScheme; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("naming_scheme"))), refVal_setNamingScheme ); + setNamingScheme(refVal_setNamingScheme); + } + return ok; +} + + +std::vector CreateTableVersionEntry::getId() const +{ + return m_Id; +} + + +void CreateTableVersionEntry::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateTableVersionEntry::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateTableVersionEntry::unsetId() +{ + m_IdIsSet = false; +} +int64_t CreateTableVersionEntry::getVersion() const +{ + return m_Version; +} + +void CreateTableVersionEntry::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CreateTableVersionEntry::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CreateTableVersionEntry::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t CreateTableVersionEntry::getBranch() const +{ + return m_Branch; +} + + +void CreateTableVersionEntry::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool CreateTableVersionEntry::branchIsSet() const +{ + return m_BranchIsSet; +} + +void CreateTableVersionEntry::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t CreateTableVersionEntry::getManifestPath() const +{ + return m_Manifest_path; +} + + +void CreateTableVersionEntry::setManifestPath(const utility::string_t& value) +{ + m_Manifest_path = value; + m_Manifest_pathIsSet = true; +} + +bool CreateTableVersionEntry::manifestPathIsSet() const +{ + return m_Manifest_pathIsSet; +} + +void CreateTableVersionEntry::unsetManifest_path() +{ + m_Manifest_pathIsSet = false; +} +int64_t CreateTableVersionEntry::getManifestSize() const +{ + return m_Manifest_size; +} + +void CreateTableVersionEntry::setManifestSize(int64_t value) +{ + m_Manifest_size = value; + m_Manifest_sizeIsSet = true; +} + +bool CreateTableVersionEntry::manifestSizeIsSet() const +{ + return m_Manifest_sizeIsSet; +} + +void CreateTableVersionEntry::unsetManifest_size() +{ + m_Manifest_sizeIsSet = false; +} +utility::string_t CreateTableVersionEntry::getETag() const +{ + return m_E_tag; +} + + +void CreateTableVersionEntry::setETag(const utility::string_t& value) +{ + m_E_tag = value; + m_E_tagIsSet = true; +} + +bool CreateTableVersionEntry::eTagIsSet() const +{ + return m_E_tagIsSet; +} + +void CreateTableVersionEntry::unsetE_tag() +{ + m_E_tagIsSet = false; +} +std::map CreateTableVersionEntry::getMetadata() const +{ + return m_Metadata; +} + + +void CreateTableVersionEntry::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool CreateTableVersionEntry::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void CreateTableVersionEntry::unsetMetadata() +{ + m_MetadataIsSet = false; +} +utility::string_t CreateTableVersionEntry::getNamingScheme() const +{ + return m_Naming_scheme; +} + + +void CreateTableVersionEntry::setNamingScheme(const utility::string_t& value) +{ + m_Naming_scheme = value; + m_Naming_schemeIsSet = true; +} + +bool CreateTableVersionEntry::namingSchemeIsSet() const +{ + return m_Naming_schemeIsSet; +} + +void CreateTableVersionEntry::unsetNaming_scheme() +{ + m_Naming_schemeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableVersionRequest.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableVersionRequest.cpp new file mode 100644 index 000000000..38a7d6059 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableVersionRequest.cpp @@ -0,0 +1,559 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableVersionRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableVersionRequest::CreateTableVersionRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Manifest_path = utility::conversions::to_string_t(""); + m_Manifest_pathIsSet = false; + m_Manifest_size = 0L; + m_Manifest_sizeIsSet = false; + m_E_tag = utility::conversions::to_string_t(""); + m_E_tagIsSet = false; + m_MetadataIsSet = false; + m_Naming_scheme = utility::conversions::to_string_t(""); + m_Naming_schemeIsSet = false; +} + +CreateTableVersionRequest::~CreateTableVersionRequest() +{ +} + +void CreateTableVersionRequest::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableVersionRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Manifest_pathIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_path"))] = ModelBase::toJson(m_Manifest_path); + } + if(m_Manifest_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_size"))] = ModelBase::toJson(m_Manifest_size); + } + if(m_E_tagIsSet) + { + + val[utility::conversions::to_string_t(U("e_tag"))] = ModelBase::toJson(m_E_tag); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + if(m_Naming_schemeIsSet) + { + + val[utility::conversions::to_string_t(U("naming_scheme"))] = ModelBase::toJson(m_Naming_scheme); + } + + return val; +} + +bool CreateTableVersionRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_path")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_path"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifestPath; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestPath); + setManifestPath(refVal_setManifestPath); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_size"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestSize); + setManifestSize(refVal_setManifestSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("e_tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("e_tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setETag; + ok &= ModelBase::fromJson(fieldValue, refVal_setETag); + setETag(refVal_setETag); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("naming_scheme")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("naming_scheme"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setNamingScheme; + ok &= ModelBase::fromJson(fieldValue, refVal_setNamingScheme); + setNamingScheme(refVal_setNamingScheme); + + } + } + return ok; +} + +void CreateTableVersionRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Manifest_pathIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_path")), m_Manifest_path)); + } + if(m_Manifest_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_size")), m_Manifest_size)); + } + if(m_E_tagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("e_tag")), m_E_tag)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } + if(m_Naming_schemeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("naming_scheme")), m_Naming_scheme)); + } +} + +bool CreateTableVersionRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_path")))) + { + utility::string_t refVal_setManifestPath; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_path"))), refVal_setManifestPath ); + setManifestPath(refVal_setManifestPath); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_size")))) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_size"))), refVal_setManifestSize ); + setManifestSize(refVal_setManifestSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("e_tag")))) + { + utility::string_t refVal_setETag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("e_tag"))), refVal_setETag ); + setETag(refVal_setETag); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("naming_scheme")))) + { + utility::string_t refVal_setNamingScheme; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("naming_scheme"))), refVal_setNamingScheme ); + setNamingScheme(refVal_setNamingScheme); + } + return ok; +} + + +std::shared_ptr CreateTableVersionRequest::getIdentity() const +{ + return m_Identity; +} + + +void CreateTableVersionRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool CreateTableVersionRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void CreateTableVersionRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map CreateTableVersionRequest::getContext() const +{ + return m_Context; +} + + +void CreateTableVersionRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool CreateTableVersionRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void CreateTableVersionRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector CreateTableVersionRequest::getId() const +{ + return m_Id; +} + + +void CreateTableVersionRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool CreateTableVersionRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void CreateTableVersionRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t CreateTableVersionRequest::getVersion() const +{ + return m_Version; +} + +void CreateTableVersionRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CreateTableVersionRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CreateTableVersionRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t CreateTableVersionRequest::getBranch() const +{ + return m_Branch; +} + + +void CreateTableVersionRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool CreateTableVersionRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void CreateTableVersionRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t CreateTableVersionRequest::getManifestPath() const +{ + return m_Manifest_path; +} + + +void CreateTableVersionRequest::setManifestPath(const utility::string_t& value) +{ + m_Manifest_path = value; + m_Manifest_pathIsSet = true; +} + +bool CreateTableVersionRequest::manifestPathIsSet() const +{ + return m_Manifest_pathIsSet; +} + +void CreateTableVersionRequest::unsetManifest_path() +{ + m_Manifest_pathIsSet = false; +} +int64_t CreateTableVersionRequest::getManifestSize() const +{ + return m_Manifest_size; +} + +void CreateTableVersionRequest::setManifestSize(int64_t value) +{ + m_Manifest_size = value; + m_Manifest_sizeIsSet = true; +} + +bool CreateTableVersionRequest::manifestSizeIsSet() const +{ + return m_Manifest_sizeIsSet; +} + +void CreateTableVersionRequest::unsetManifest_size() +{ + m_Manifest_sizeIsSet = false; +} +utility::string_t CreateTableVersionRequest::getETag() const +{ + return m_E_tag; +} + + +void CreateTableVersionRequest::setETag(const utility::string_t& value) +{ + m_E_tag = value; + m_E_tagIsSet = true; +} + +bool CreateTableVersionRequest::eTagIsSet() const +{ + return m_E_tagIsSet; +} + +void CreateTableVersionRequest::unsetE_tag() +{ + m_E_tagIsSet = false; +} +std::map CreateTableVersionRequest::getMetadata() const +{ + return m_Metadata; +} + + +void CreateTableVersionRequest::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool CreateTableVersionRequest::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void CreateTableVersionRequest::unsetMetadata() +{ + m_MetadataIsSet = false; +} +utility::string_t CreateTableVersionRequest::getNamingScheme() const +{ + return m_Naming_scheme; +} + + +void CreateTableVersionRequest::setNamingScheme(const utility::string_t& value) +{ + m_Naming_scheme = value; + m_Naming_schemeIsSet = true; +} + +bool CreateTableVersionRequest::namingSchemeIsSet() const +{ + return m_Naming_schemeIsSet; +} + +void CreateTableVersionRequest::unsetNaming_scheme() +{ + m_Naming_schemeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/CreateTableVersionResponse.cpp b/cpp/lance_namespace_rest_client/src/model/CreateTableVersionResponse.cpp new file mode 100644 index 000000000..f2a933405 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/CreateTableVersionResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/CreateTableVersionResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +CreateTableVersionResponse::CreateTableVersionResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_VersionIsSet = false; +} + +CreateTableVersionResponse::~CreateTableVersionResponse() +{ +} + +void CreateTableVersionResponse::validate() +{ + // TODO: implement validation +} + +web::json::value CreateTableVersionResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool CreateTableVersionResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void CreateTableVersionResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool CreateTableVersionResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + std::shared_ptr refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +utility::string_t CreateTableVersionResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void CreateTableVersionResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool CreateTableVersionResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void CreateTableVersionResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +std::shared_ptr CreateTableVersionResponse::getVersion() const +{ + return m_Version; +} + + +void CreateTableVersionResponse::setVersion(const std::shared_ptr& value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool CreateTableVersionResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void CreateTableVersionResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeclareTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DeclareTableRequest.cpp new file mode 100644 index 000000000..21c066c7f --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeclareTableRequest.cpp @@ -0,0 +1,364 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeclareTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeclareTableRequest::DeclareTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_Vend_credentials = false; + m_Vend_credentialsIsSet = false; + m_PropertiesIsSet = false; +} + +DeclareTableRequest::~DeclareTableRequest() +{ +} + +void DeclareTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DeclareTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_Vend_credentialsIsSet) + { + + val[utility::conversions::to_string_t(U("vend_credentials"))] = ModelBase::toJson(m_Vend_credentials); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool DeclareTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("vend_credentials")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vend_credentials"))); + if(!fieldValue.is_null()) + { + bool refVal_setVendCredentials; + ok &= ModelBase::fromJson(fieldValue, refVal_setVendCredentials); + setVendCredentials(refVal_setVendCredentials); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void DeclareTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_Vend_credentialsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vend_credentials")), m_Vend_credentials)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool DeclareTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vend_credentials")))) + { + bool refVal_setVendCredentials; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vend_credentials"))), refVal_setVendCredentials ); + setVendCredentials(refVal_setVendCredentials); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +std::shared_ptr DeclareTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void DeclareTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DeclareTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DeclareTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DeclareTableRequest::getContext() const +{ + return m_Context; +} + + +void DeclareTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DeclareTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DeclareTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DeclareTableRequest::getId() const +{ + return m_Id; +} + + +void DeclareTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DeclareTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DeclareTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DeclareTableRequest::getLocation() const +{ + return m_Location; +} + + +void DeclareTableRequest::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool DeclareTableRequest::locationIsSet() const +{ + return m_LocationIsSet; +} + +void DeclareTableRequest::unsetLocation() +{ + m_LocationIsSet = false; +} +bool DeclareTableRequest::isVendCredentials() const +{ + return m_Vend_credentials; +} + +void DeclareTableRequest::setVendCredentials(bool value) +{ + m_Vend_credentials = value; + m_Vend_credentialsIsSet = true; +} + +bool DeclareTableRequest::vendCredentialsIsSet() const +{ + return m_Vend_credentialsIsSet; +} + +void DeclareTableRequest::unsetVend_credentials() +{ + m_Vend_credentialsIsSet = false; +} +std::map DeclareTableRequest::getProperties() const +{ + return m_Properties; +} + + +void DeclareTableRequest::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DeclareTableRequest::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DeclareTableRequest::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeclareTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DeclareTableResponse.cpp new file mode 100644 index 000000000..90d15d775 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeclareTableResponse.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeclareTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeclareTableResponse::DeclareTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_Storage_optionsIsSet = false; + m_PropertiesIsSet = false; + m_Managed_versioning = false; + m_Managed_versioningIsSet = false; +} + +DeclareTableResponse::~DeclareTableResponse() +{ +} + +void DeclareTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DeclareTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_Storage_optionsIsSet) + { + + val[utility::conversions::to_string_t(U("storage_options"))] = ModelBase::toJson(m_Storage_options); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + if(m_Managed_versioningIsSet) + { + + val[utility::conversions::to_string_t(U("managed_versioning"))] = ModelBase::toJson(m_Managed_versioning); + } + + return val; +} + +bool DeclareTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("storage_options")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("storage_options"))); + if(!fieldValue.is_null()) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromJson(fieldValue, refVal_setStorageOptions); + setStorageOptions(refVal_setStorageOptions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("managed_versioning")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("managed_versioning"))); + if(!fieldValue.is_null()) + { + bool refVal_setManagedVersioning; + ok &= ModelBase::fromJson(fieldValue, refVal_setManagedVersioning); + setManagedVersioning(refVal_setManagedVersioning); + + } + } + return ok; +} + +void DeclareTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_Storage_optionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("storage_options")), m_Storage_options)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } + if(m_Managed_versioningIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("managed_versioning")), m_Managed_versioning)); + } +} + +bool DeclareTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("storage_options")))) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("storage_options"))), refVal_setStorageOptions ); + setStorageOptions(refVal_setStorageOptions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("managed_versioning")))) + { + bool refVal_setManagedVersioning; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("managed_versioning"))), refVal_setManagedVersioning ); + setManagedVersioning(refVal_setManagedVersioning); + } + return ok; +} + + +utility::string_t DeclareTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DeclareTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DeclareTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DeclareTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +utility::string_t DeclareTableResponse::getLocation() const +{ + return m_Location; +} + + +void DeclareTableResponse::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool DeclareTableResponse::locationIsSet() const +{ + return m_LocationIsSet; +} + +void DeclareTableResponse::unsetLocation() +{ + m_LocationIsSet = false; +} +std::map DeclareTableResponse::getStorageOptions() const +{ + return m_Storage_options; +} + + +void DeclareTableResponse::setStorageOptions(const std::map& value) +{ + m_Storage_options = value; + m_Storage_optionsIsSet = true; +} + +bool DeclareTableResponse::storageOptionsIsSet() const +{ + return m_Storage_optionsIsSet; +} + +void DeclareTableResponse::unsetStorage_options() +{ + m_Storage_optionsIsSet = false; +} +std::map DeclareTableResponse::getProperties() const +{ + return m_Properties; +} + + +void DeclareTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DeclareTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DeclareTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} +bool DeclareTableResponse::isManagedVersioning() const +{ + return m_Managed_versioning; +} + +void DeclareTableResponse::setManagedVersioning(bool value) +{ + m_Managed_versioning = value; + m_Managed_versioningIsSet = true; +} + +bool DeclareTableResponse::managedVersioningIsSet() const +{ + return m_Managed_versioningIsSet; +} + +void DeclareTableResponse::unsetManaged_versioning() +{ + m_Managed_versioningIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeleteFromTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DeleteFromTableRequest.cpp new file mode 100644 index 000000000..b7ab62401 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeleteFromTableRequest.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeleteFromTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeleteFromTableRequest::DeleteFromTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Predicate = utility::conversions::to_string_t(""); + m_PredicateIsSet = false; +} + +DeleteFromTableRequest::~DeleteFromTableRequest() +{ +} + +void DeleteFromTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DeleteFromTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_PredicateIsSet) + { + + val[utility::conversions::to_string_t(U("predicate"))] = ModelBase::toJson(m_Predicate); + } + + return val; +} + +bool DeleteFromTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("predicate")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("predicate"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPredicate; + ok &= ModelBase::fromJson(fieldValue, refVal_setPredicate); + setPredicate(refVal_setPredicate); + + } + } + return ok; +} + +void DeleteFromTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_PredicateIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("predicate")), m_Predicate)); + } +} + +bool DeleteFromTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("predicate")))) + { + utility::string_t refVal_setPredicate; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("predicate"))), refVal_setPredicate ); + setPredicate(refVal_setPredicate); + } + return ok; +} + + +std::shared_ptr DeleteFromTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void DeleteFromTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DeleteFromTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DeleteFromTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DeleteFromTableRequest::getContext() const +{ + return m_Context; +} + + +void DeleteFromTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DeleteFromTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DeleteFromTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DeleteFromTableRequest::getId() const +{ + return m_Id; +} + + +void DeleteFromTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DeleteFromTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DeleteFromTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DeleteFromTableRequest::getBranch() const +{ + return m_Branch; +} + + +void DeleteFromTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool DeleteFromTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void DeleteFromTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t DeleteFromTableRequest::getPredicate() const +{ + return m_Predicate; +} + + +void DeleteFromTableRequest::setPredicate(const utility::string_t& value) +{ + m_Predicate = value; + m_PredicateIsSet = true; +} + +bool DeleteFromTableRequest::predicateIsSet() const +{ + return m_PredicateIsSet; +} + +void DeleteFromTableRequest::unsetPredicate() +{ + m_PredicateIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeleteFromTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DeleteFromTableResponse.cpp new file mode 100644 index 000000000..03fb3abbc --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeleteFromTableResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeleteFromTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeleteFromTableResponse::DeleteFromTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; +} + +DeleteFromTableResponse::~DeleteFromTableResponse() +{ +} + +void DeleteFromTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DeleteFromTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool DeleteFromTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void DeleteFromTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool DeleteFromTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +utility::string_t DeleteFromTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DeleteFromTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DeleteFromTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DeleteFromTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +int64_t DeleteFromTableResponse::getVersion() const +{ + return m_Version; +} + +void DeleteFromTableResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool DeleteFromTableResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void DeleteFromTableResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeleteTableBranchRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DeleteTableBranchRequest.cpp new file mode 100644 index 000000000..225984595 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeleteTableBranchRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeleteTableBranchRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeleteTableBranchRequest::DeleteTableBranchRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Name = utility::conversions::to_string_t(""); + m_NameIsSet = false; +} + +DeleteTableBranchRequest::~DeleteTableBranchRequest() +{ +} + +void DeleteTableBranchRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DeleteTableBranchRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_NameIsSet) + { + + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); + } + + return val; +} + +bool DeleteTableBranchRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromJson(fieldValue, refVal_setName); + setName(refVal_setName); + + } + } + return ok; +} + +void DeleteTableBranchRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_NameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } +} + +bool DeleteTableBranchRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); + setName(refVal_setName); + } + return ok; +} + + +std::shared_ptr DeleteTableBranchRequest::getIdentity() const +{ + return m_Identity; +} + + +void DeleteTableBranchRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DeleteTableBranchRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DeleteTableBranchRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DeleteTableBranchRequest::getContext() const +{ + return m_Context; +} + + +void DeleteTableBranchRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DeleteTableBranchRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DeleteTableBranchRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DeleteTableBranchRequest::getId() const +{ + return m_Id; +} + + +void DeleteTableBranchRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DeleteTableBranchRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DeleteTableBranchRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DeleteTableBranchRequest::getName() const +{ + return m_Name; +} + + +void DeleteTableBranchRequest::setName(const utility::string_t& value) +{ + m_Name = value; + m_NameIsSet = true; +} + +bool DeleteTableBranchRequest::nameIsSet() const +{ + return m_NameIsSet; +} + +void DeleteTableBranchRequest::unsetName() +{ + m_NameIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeleteTableBranchResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DeleteTableBranchResponse.cpp new file mode 100644 index 000000000..9d11664da --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeleteTableBranchResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeleteTableBranchResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeleteTableBranchResponse::DeleteTableBranchResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +DeleteTableBranchResponse::~DeleteTableBranchResponse() +{ +} + +void DeleteTableBranchResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DeleteTableBranchResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool DeleteTableBranchResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void DeleteTableBranchResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool DeleteTableBranchResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t DeleteTableBranchResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DeleteTableBranchResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DeleteTableBranchResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DeleteTableBranchResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeleteTableTagRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DeleteTableTagRequest.cpp new file mode 100644 index 000000000..3e2d47b61 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeleteTableTagRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeleteTableTagRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeleteTableTagRequest::DeleteTableTagRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Tag = utility::conversions::to_string_t(""); + m_TagIsSet = false; +} + +DeleteTableTagRequest::~DeleteTableTagRequest() +{ +} + +void DeleteTableTagRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DeleteTableTagRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_TagIsSet) + { + + val[utility::conversions::to_string_t(U("tag"))] = ModelBase::toJson(m_Tag); + } + + return val; +} + +bool DeleteTableTagRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromJson(fieldValue, refVal_setTag); + setTag(refVal_setTag); + + } + } + return ok; +} + +void DeleteTableTagRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_TagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tag")), m_Tag)); + } +} + +bool DeleteTableTagRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("tag")))) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tag"))), refVal_setTag ); + setTag(refVal_setTag); + } + return ok; +} + + +std::shared_ptr DeleteTableTagRequest::getIdentity() const +{ + return m_Identity; +} + + +void DeleteTableTagRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DeleteTableTagRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DeleteTableTagRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DeleteTableTagRequest::getContext() const +{ + return m_Context; +} + + +void DeleteTableTagRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DeleteTableTagRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DeleteTableTagRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DeleteTableTagRequest::getId() const +{ + return m_Id; +} + + +void DeleteTableTagRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DeleteTableTagRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DeleteTableTagRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DeleteTableTagRequest::getTag() const +{ + return m_Tag; +} + + +void DeleteTableTagRequest::setTag(const utility::string_t& value) +{ + m_Tag = value; + m_TagIsSet = true; +} + +bool DeleteTableTagRequest::tagIsSet() const +{ + return m_TagIsSet; +} + +void DeleteTableTagRequest::unsetTag() +{ + m_TagIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeleteTableTagResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DeleteTableTagResponse.cpp new file mode 100644 index 000000000..2cf1d20ae --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeleteTableTagResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeleteTableTagResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeleteTableTagResponse::DeleteTableTagResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +DeleteTableTagResponse::~DeleteTableTagResponse() +{ +} + +void DeleteTableTagResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DeleteTableTagResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool DeleteTableTagResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void DeleteTableTagResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool DeleteTableTagResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t DeleteTableTagResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DeleteTableTagResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DeleteTableTagResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DeleteTableTagResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeregisterTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DeregisterTableRequest.cpp new file mode 100644 index 000000000..e060646dd --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeregisterTableRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeregisterTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeregisterTableRequest::DeregisterTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; +} + +DeregisterTableRequest::~DeregisterTableRequest() +{ +} + +void DeregisterTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DeregisterTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + + return val; +} + +bool DeregisterTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + return ok; +} + +void DeregisterTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } +} + +bool DeregisterTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + return ok; +} + + +std::shared_ptr DeregisterTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void DeregisterTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DeregisterTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DeregisterTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DeregisterTableRequest::getContext() const +{ + return m_Context; +} + + +void DeregisterTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DeregisterTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DeregisterTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DeregisterTableRequest::getId() const +{ + return m_Id; +} + + +void DeregisterTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DeregisterTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DeregisterTableRequest::unsetId() +{ + m_IdIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DeregisterTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DeregisterTableResponse.cpp new file mode 100644 index 000000000..a862454b4 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DeregisterTableResponse.cpp @@ -0,0 +1,269 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DeregisterTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DeregisterTableResponse::DeregisterTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_IdIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_PropertiesIsSet = false; +} + +DeregisterTableResponse::~DeregisterTableResponse() +{ +} + +void DeregisterTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DeregisterTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool DeregisterTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void DeregisterTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool DeregisterTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t DeregisterTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DeregisterTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DeregisterTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DeregisterTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +std::vector DeregisterTableResponse::getId() const +{ + return m_Id; +} + + +void DeregisterTableResponse::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DeregisterTableResponse::idIsSet() const +{ + return m_IdIsSet; +} + +void DeregisterTableResponse::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DeregisterTableResponse::getLocation() const +{ + return m_Location; +} + + +void DeregisterTableResponse::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool DeregisterTableResponse::locationIsSet() const +{ + return m_LocationIsSet; +} + +void DeregisterTableResponse::unsetLocation() +{ + m_LocationIsSet = false; +} +std::map DeregisterTableResponse::getProperties() const +{ + return m_Properties; +} + + +void DeregisterTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DeregisterTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DeregisterTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeNamespaceRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeNamespaceRequest.cpp new file mode 100644 index 000000000..e68dbc203 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeNamespaceRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeNamespaceRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeNamespaceRequest::DescribeNamespaceRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; +} + +DescribeNamespaceRequest::~DescribeNamespaceRequest() +{ +} + +void DescribeNamespaceRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeNamespaceRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + + return val; +} + +bool DescribeNamespaceRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + return ok; +} + +void DescribeNamespaceRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } +} + +bool DescribeNamespaceRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + return ok; +} + + +std::shared_ptr DescribeNamespaceRequest::getIdentity() const +{ + return m_Identity; +} + + +void DescribeNamespaceRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DescribeNamespaceRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DescribeNamespaceRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DescribeNamespaceRequest::getContext() const +{ + return m_Context; +} + + +void DescribeNamespaceRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DescribeNamespaceRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DescribeNamespaceRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DescribeNamespaceRequest::getId() const +{ + return m_Id; +} + + +void DescribeNamespaceRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DescribeNamespaceRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DescribeNamespaceRequest::unsetId() +{ + m_IdIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeNamespaceResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeNamespaceResponse.cpp new file mode 100644 index 000000000..904c839e1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeNamespaceResponse.cpp @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeNamespaceResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeNamespaceResponse::DescribeNamespaceResponse() +{ + m_PropertiesIsSet = false; +} + +DescribeNamespaceResponse::~DescribeNamespaceResponse() +{ +} + +void DescribeNamespaceResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeNamespaceResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool DescribeNamespaceResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void DescribeNamespaceResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool DescribeNamespaceResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +std::map DescribeNamespaceResponse::getProperties() const +{ + return m_Properties; +} + + +void DescribeNamespaceResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DescribeNamespaceResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DescribeNamespaceResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsRequest.cpp new file mode 100644 index 000000000..5ab602c57 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsRequest.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTableIndexStatsRequest::DescribeTableIndexStatsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Index_name = utility::conversions::to_string_t(""); + m_Index_nameIsSet = false; +} + +DescribeTableIndexStatsRequest::~DescribeTableIndexStatsRequest() +{ +} + +void DescribeTableIndexStatsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTableIndexStatsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Index_nameIsSet) + { + + val[utility::conversions::to_string_t(U("index_name"))] = ModelBase::toJson(m_Index_name); + } + + return val; +} + +bool DescribeTableIndexStatsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexName; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexName); + setIndexName(refVal_setIndexName); + + } + } + return ok; +} + +void DescribeTableIndexStatsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Index_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_name")), m_Index_name)); + } +} + +bool DescribeTableIndexStatsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_name")))) + { + utility::string_t refVal_setIndexName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_name"))), refVal_setIndexName ); + setIndexName(refVal_setIndexName); + } + return ok; +} + + +std::shared_ptr DescribeTableIndexStatsRequest::getIdentity() const +{ + return m_Identity; +} + + +void DescribeTableIndexStatsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DescribeTableIndexStatsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DescribeTableIndexStatsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DescribeTableIndexStatsRequest::getContext() const +{ + return m_Context; +} + + +void DescribeTableIndexStatsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DescribeTableIndexStatsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DescribeTableIndexStatsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DescribeTableIndexStatsRequest::getId() const +{ + return m_Id; +} + + +void DescribeTableIndexStatsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DescribeTableIndexStatsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DescribeTableIndexStatsRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t DescribeTableIndexStatsRequest::getVersion() const +{ + return m_Version; +} + +void DescribeTableIndexStatsRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool DescribeTableIndexStatsRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void DescribeTableIndexStatsRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t DescribeTableIndexStatsRequest::getBranch() const +{ + return m_Branch; +} + + +void DescribeTableIndexStatsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool DescribeTableIndexStatsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void DescribeTableIndexStatsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t DescribeTableIndexStatsRequest::getIndexName() const +{ + return m_Index_name; +} + + +void DescribeTableIndexStatsRequest::setIndexName(const utility::string_t& value) +{ + m_Index_name = value; + m_Index_nameIsSet = true; +} + +bool DescribeTableIndexStatsRequest::indexNameIsSet() const +{ + return m_Index_nameIsSet; +} + +void DescribeTableIndexStatsRequest::unsetIndex_name() +{ + m_Index_nameIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsResponse.cpp new file mode 100644 index 000000000..9ecff0476 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTableIndexStatsResponse.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTableIndexStatsResponse::DescribeTableIndexStatsResponse() +{ + m_Distance_type = utility::conversions::to_string_t(""); + m_Distance_typeIsSet = false; + m_Index_type = utility::conversions::to_string_t(""); + m_Index_typeIsSet = false; + m_Num_indexed_rows = 0L; + m_Num_indexed_rowsIsSet = false; + m_Num_unindexed_rows = 0L; + m_Num_unindexed_rowsIsSet = false; + m_Num_indices = 0; + m_Num_indicesIsSet = false; +} + +DescribeTableIndexStatsResponse::~DescribeTableIndexStatsResponse() +{ +} + +void DescribeTableIndexStatsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTableIndexStatsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Distance_typeIsSet) + { + + val[utility::conversions::to_string_t(U("distance_type"))] = ModelBase::toJson(m_Distance_type); + } + if(m_Index_typeIsSet) + { + + val[utility::conversions::to_string_t(U("index_type"))] = ModelBase::toJson(m_Index_type); + } + if(m_Num_indexed_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_indexed_rows"))] = ModelBase::toJson(m_Num_indexed_rows); + } + if(m_Num_unindexed_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_unindexed_rows"))] = ModelBase::toJson(m_Num_unindexed_rows); + } + if(m_Num_indicesIsSet) + { + + val[utility::conversions::to_string_t(U("num_indices"))] = ModelBase::toJson(m_Num_indices); + } + + return val; +} + +bool DescribeTableIndexStatsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("distance_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("distance_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromJson(fieldValue, refVal_setDistanceType); + setDistanceType(refVal_setDistanceType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexType; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexType); + setIndexType(refVal_setIndexType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_indexed_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_indexed_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumIndexedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumIndexedRows); + setNumIndexedRows(refVal_setNumIndexedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_unindexed_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_unindexed_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumUnindexedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumUnindexedRows); + setNumUnindexedRows(refVal_setNumUnindexedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_indices")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_indices"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNumIndices; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumIndices); + setNumIndices(refVal_setNumIndices); + + } + } + return ok; +} + +void DescribeTableIndexStatsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Distance_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("distance_type")), m_Distance_type)); + } + if(m_Index_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_type")), m_Index_type)); + } + if(m_Num_indexed_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_indexed_rows")), m_Num_indexed_rows)); + } + if(m_Num_unindexed_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_unindexed_rows")), m_Num_unindexed_rows)); + } + if(m_Num_indicesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_indices")), m_Num_indices)); + } +} + +bool DescribeTableIndexStatsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("distance_type")))) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("distance_type"))), refVal_setDistanceType ); + setDistanceType(refVal_setDistanceType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_type")))) + { + utility::string_t refVal_setIndexType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_type"))), refVal_setIndexType ); + setIndexType(refVal_setIndexType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_indexed_rows")))) + { + int64_t refVal_setNumIndexedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_indexed_rows"))), refVal_setNumIndexedRows ); + setNumIndexedRows(refVal_setNumIndexedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_unindexed_rows")))) + { + int64_t refVal_setNumUnindexedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_unindexed_rows"))), refVal_setNumUnindexedRows ); + setNumUnindexedRows(refVal_setNumUnindexedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_indices")))) + { + int32_t refVal_setNumIndices; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_indices"))), refVal_setNumIndices ); + setNumIndices(refVal_setNumIndices); + } + return ok; +} + + +utility::string_t DescribeTableIndexStatsResponse::getDistanceType() const +{ + return m_Distance_type; +} + + +void DescribeTableIndexStatsResponse::setDistanceType(const utility::string_t& value) +{ + m_Distance_type = value; + m_Distance_typeIsSet = true; +} + +bool DescribeTableIndexStatsResponse::distanceTypeIsSet() const +{ + return m_Distance_typeIsSet; +} + +void DescribeTableIndexStatsResponse::unsetDistance_type() +{ + m_Distance_typeIsSet = false; +} +utility::string_t DescribeTableIndexStatsResponse::getIndexType() const +{ + return m_Index_type; +} + + +void DescribeTableIndexStatsResponse::setIndexType(const utility::string_t& value) +{ + m_Index_type = value; + m_Index_typeIsSet = true; +} + +bool DescribeTableIndexStatsResponse::indexTypeIsSet() const +{ + return m_Index_typeIsSet; +} + +void DescribeTableIndexStatsResponse::unsetIndex_type() +{ + m_Index_typeIsSet = false; +} +int64_t DescribeTableIndexStatsResponse::getNumIndexedRows() const +{ + return m_Num_indexed_rows; +} + +void DescribeTableIndexStatsResponse::setNumIndexedRows(int64_t value) +{ + m_Num_indexed_rows = value; + m_Num_indexed_rowsIsSet = true; +} + +bool DescribeTableIndexStatsResponse::numIndexedRowsIsSet() const +{ + return m_Num_indexed_rowsIsSet; +} + +void DescribeTableIndexStatsResponse::unsetNum_indexed_rows() +{ + m_Num_indexed_rowsIsSet = false; +} +int64_t DescribeTableIndexStatsResponse::getNumUnindexedRows() const +{ + return m_Num_unindexed_rows; +} + +void DescribeTableIndexStatsResponse::setNumUnindexedRows(int64_t value) +{ + m_Num_unindexed_rows = value; + m_Num_unindexed_rowsIsSet = true; +} + +bool DescribeTableIndexStatsResponse::numUnindexedRowsIsSet() const +{ + return m_Num_unindexed_rowsIsSet; +} + +void DescribeTableIndexStatsResponse::unsetNum_unindexed_rows() +{ + m_Num_unindexed_rowsIsSet = false; +} +int32_t DescribeTableIndexStatsResponse::getNumIndices() const +{ + return m_Num_indices; +} + +void DescribeTableIndexStatsResponse::setNumIndices(int32_t value) +{ + m_Num_indices = value; + m_Num_indicesIsSet = true; +} + +bool DescribeTableIndexStatsResponse::numIndicesIsSet() const +{ + return m_Num_indicesIsSet; +} + +void DescribeTableIndexStatsResponse::unsetNum_indices() +{ + m_Num_indicesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTableRequest.cpp new file mode 100644 index 000000000..29ca61710 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTableRequest.cpp @@ -0,0 +1,508 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTableRequest::DescribeTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_With_table_uri = false; + m_With_table_uriIsSet = false; + m_Load_detailed_metadata = false; + m_Load_detailed_metadataIsSet = false; + m_Check_declared = false; + m_Check_declaredIsSet = false; + m_Vend_credentials = false; + m_Vend_credentialsIsSet = false; +} + +DescribeTableRequest::~DescribeTableRequest() +{ +} + +void DescribeTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_With_table_uriIsSet) + { + + val[utility::conversions::to_string_t(U("with_table_uri"))] = ModelBase::toJson(m_With_table_uri); + } + if(m_Load_detailed_metadataIsSet) + { + + val[utility::conversions::to_string_t(U("load_detailed_metadata"))] = ModelBase::toJson(m_Load_detailed_metadata); + } + if(m_Check_declaredIsSet) + { + + val[utility::conversions::to_string_t(U("check_declared"))] = ModelBase::toJson(m_Check_declared); + } + if(m_Vend_credentialsIsSet) + { + + val[utility::conversions::to_string_t(U("vend_credentials"))] = ModelBase::toJson(m_Vend_credentials); + } + + return val; +} + +bool DescribeTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("with_table_uri")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("with_table_uri"))); + if(!fieldValue.is_null()) + { + bool refVal_setWithTableUri; + ok &= ModelBase::fromJson(fieldValue, refVal_setWithTableUri); + setWithTableUri(refVal_setWithTableUri); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("load_detailed_metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("load_detailed_metadata"))); + if(!fieldValue.is_null()) + { + bool refVal_setLoadDetailedMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setLoadDetailedMetadata); + setLoadDetailedMetadata(refVal_setLoadDetailedMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("check_declared")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("check_declared"))); + if(!fieldValue.is_null()) + { + bool refVal_setCheckDeclared; + ok &= ModelBase::fromJson(fieldValue, refVal_setCheckDeclared); + setCheckDeclared(refVal_setCheckDeclared); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("vend_credentials")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vend_credentials"))); + if(!fieldValue.is_null()) + { + bool refVal_setVendCredentials; + ok &= ModelBase::fromJson(fieldValue, refVal_setVendCredentials); + setVendCredentials(refVal_setVendCredentials); + + } + } + return ok; +} + +void DescribeTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_With_table_uriIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("with_table_uri")), m_With_table_uri)); + } + if(m_Load_detailed_metadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("load_detailed_metadata")), m_Load_detailed_metadata)); + } + if(m_Check_declaredIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("check_declared")), m_Check_declared)); + } + if(m_Vend_credentialsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vend_credentials")), m_Vend_credentials)); + } +} + +bool DescribeTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("with_table_uri")))) + { + bool refVal_setWithTableUri; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("with_table_uri"))), refVal_setWithTableUri ); + setWithTableUri(refVal_setWithTableUri); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("load_detailed_metadata")))) + { + bool refVal_setLoadDetailedMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("load_detailed_metadata"))), refVal_setLoadDetailedMetadata ); + setLoadDetailedMetadata(refVal_setLoadDetailedMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("check_declared")))) + { + bool refVal_setCheckDeclared; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("check_declared"))), refVal_setCheckDeclared ); + setCheckDeclared(refVal_setCheckDeclared); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vend_credentials")))) + { + bool refVal_setVendCredentials; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vend_credentials"))), refVal_setVendCredentials ); + setVendCredentials(refVal_setVendCredentials); + } + return ok; +} + + +std::shared_ptr DescribeTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void DescribeTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DescribeTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DescribeTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DescribeTableRequest::getContext() const +{ + return m_Context; +} + + +void DescribeTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DescribeTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DescribeTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DescribeTableRequest::getId() const +{ + return m_Id; +} + + +void DescribeTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DescribeTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DescribeTableRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t DescribeTableRequest::getVersion() const +{ + return m_Version; +} + +void DescribeTableRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool DescribeTableRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void DescribeTableRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t DescribeTableRequest::getBranch() const +{ + return m_Branch; +} + + +void DescribeTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool DescribeTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void DescribeTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +bool DescribeTableRequest::isWithTableUri() const +{ + return m_With_table_uri; +} + +void DescribeTableRequest::setWithTableUri(bool value) +{ + m_With_table_uri = value; + m_With_table_uriIsSet = true; +} + +bool DescribeTableRequest::withTableUriIsSet() const +{ + return m_With_table_uriIsSet; +} + +void DescribeTableRequest::unsetWith_table_uri() +{ + m_With_table_uriIsSet = false; +} +bool DescribeTableRequest::isLoadDetailedMetadata() const +{ + return m_Load_detailed_metadata; +} + +void DescribeTableRequest::setLoadDetailedMetadata(bool value) +{ + m_Load_detailed_metadata = value; + m_Load_detailed_metadataIsSet = true; +} + +bool DescribeTableRequest::loadDetailedMetadataIsSet() const +{ + return m_Load_detailed_metadataIsSet; +} + +void DescribeTableRequest::unsetLoad_detailed_metadata() +{ + m_Load_detailed_metadataIsSet = false; +} +bool DescribeTableRequest::isCheckDeclared() const +{ + return m_Check_declared; +} + +void DescribeTableRequest::setCheckDeclared(bool value) +{ + m_Check_declared = value; + m_Check_declaredIsSet = true; +} + +bool DescribeTableRequest::checkDeclaredIsSet() const +{ + return m_Check_declaredIsSet; +} + +void DescribeTableRequest::unsetCheck_declared() +{ + m_Check_declaredIsSet = false; +} +bool DescribeTableRequest::isVendCredentials() const +{ + return m_Vend_credentials; +} + +void DescribeTableRequest::setVendCredentials(bool value) +{ + m_Vend_credentials = value; + m_Vend_credentialsIsSet = true; +} + +bool DescribeTableRequest::vendCredentialsIsSet() const +{ + return m_Vend_credentialsIsSet; +} + +void DescribeTableRequest::unsetVend_credentials() +{ + m_Vend_credentialsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTableResponse.cpp new file mode 100644 index 000000000..ce412c44d --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTableResponse.cpp @@ -0,0 +1,654 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTableResponse::DescribeTableResponse() +{ + m_Table = utility::conversions::to_string_t(""); + m_TableIsSet = false; + m_r_namespaceIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_Table_uri = utility::conversions::to_string_t(""); + m_Table_uriIsSet = false; + m_SchemaIsSet = false; + m_Storage_optionsIsSet = false; + m_StatsIsSet = false; + m_MetadataIsSet = false; + m_PropertiesIsSet = false; + m_Managed_versioning = false; + m_Managed_versioningIsSet = false; + m_Is_only_declared = false; + m_Is_only_declaredIsSet = false; +} + +DescribeTableResponse::~DescribeTableResponse() +{ +} + +void DescribeTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_TableIsSet) + { + + val[utility::conversions::to_string_t(U("table"))] = ModelBase::toJson(m_Table); + } + if(m_r_namespaceIsSet) + { + + val[utility::conversions::to_string_t(U("namespace"))] = ModelBase::toJson(m_r_namespace); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_Table_uriIsSet) + { + + val[utility::conversions::to_string_t(U("table_uri"))] = ModelBase::toJson(m_Table_uri); + } + if(m_SchemaIsSet) + { + + val[utility::conversions::to_string_t(U("schema"))] = ModelBase::toJson(m_Schema); + } + if(m_Storage_optionsIsSet) + { + + val[utility::conversions::to_string_t(U("storage_options"))] = ModelBase::toJson(m_Storage_options); + } + if(m_StatsIsSet) + { + + val[utility::conversions::to_string_t(U("stats"))] = ModelBase::toJson(m_Stats); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + if(m_Managed_versioningIsSet) + { + + val[utility::conversions::to_string_t(U("managed_versioning"))] = ModelBase::toJson(m_Managed_versioning); + } + if(m_Is_only_declaredIsSet) + { + + val[utility::conversions::to_string_t(U("is_only_declared"))] = ModelBase::toJson(m_Is_only_declared); + } + + return val; +} + +bool DescribeTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("table")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("table"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTable; + ok &= ModelBase::fromJson(fieldValue, refVal_setTable); + setTable(refVal_setTable); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("namespace")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("namespace"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setRNamespace; + ok &= ModelBase::fromJson(fieldValue, refVal_setRNamespace); + setRNamespace(refVal_setRNamespace); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("table_uri")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("table_uri"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTableUri; + ok &= ModelBase::fromJson(fieldValue, refVal_setTableUri); + setTableUri(refVal_setTableUri); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("schema")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("schema"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setSchema; + ok &= ModelBase::fromJson(fieldValue, refVal_setSchema); + setSchema(refVal_setSchema); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("storage_options")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("storage_options"))); + if(!fieldValue.is_null()) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromJson(fieldValue, refVal_setStorageOptions); + setStorageOptions(refVal_setStorageOptions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("stats")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("stats"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setStats; + ok &= ModelBase::fromJson(fieldValue, refVal_setStats); + setStats(refVal_setStats); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("managed_versioning")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("managed_versioning"))); + if(!fieldValue.is_null()) + { + bool refVal_setManagedVersioning; + ok &= ModelBase::fromJson(fieldValue, refVal_setManagedVersioning); + setManagedVersioning(refVal_setManagedVersioning); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("is_only_declared")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("is_only_declared"))); + if(!fieldValue.is_null()) + { + bool refVal_setIsOnlyDeclared; + ok &= ModelBase::fromJson(fieldValue, refVal_setIsOnlyDeclared); + setIsOnlyDeclared(refVal_setIsOnlyDeclared); + + } + } + return ok; +} + +void DescribeTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_TableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("table")), m_Table)); + } + if(m_r_namespaceIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("namespace")), m_r_namespace)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_Table_uriIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("table_uri")), m_Table_uri)); + } + if(m_SchemaIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("schema")), m_Schema)); + } + if(m_Storage_optionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("storage_options")), m_Storage_options)); + } + if(m_StatsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("stats")), m_Stats)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } + if(m_Managed_versioningIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("managed_versioning")), m_Managed_versioning)); + } + if(m_Is_only_declaredIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("is_only_declared")), m_Is_only_declared)); + } +} + +bool DescribeTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("table")))) + { + utility::string_t refVal_setTable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("table"))), refVal_setTable ); + setTable(refVal_setTable); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("namespace")))) + { + std::vector refVal_setRNamespace; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("namespace"))), refVal_setRNamespace ); + setRNamespace(refVal_setRNamespace); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("table_uri")))) + { + utility::string_t refVal_setTableUri; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("table_uri"))), refVal_setTableUri ); + setTableUri(refVal_setTableUri); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("schema")))) + { + std::shared_ptr refVal_setSchema; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("schema"))), refVal_setSchema ); + setSchema(refVal_setSchema); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("storage_options")))) + { + std::map refVal_setStorageOptions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("storage_options"))), refVal_setStorageOptions ); + setStorageOptions(refVal_setStorageOptions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("stats")))) + { + std::shared_ptr refVal_setStats; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("stats"))), refVal_setStats ); + setStats(refVal_setStats); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("managed_versioning")))) + { + bool refVal_setManagedVersioning; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("managed_versioning"))), refVal_setManagedVersioning ); + setManagedVersioning(refVal_setManagedVersioning); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("is_only_declared")))) + { + bool refVal_setIsOnlyDeclared; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("is_only_declared"))), refVal_setIsOnlyDeclared ); + setIsOnlyDeclared(refVal_setIsOnlyDeclared); + } + return ok; +} + + +utility::string_t DescribeTableResponse::getTable() const +{ + return m_Table; +} + + +void DescribeTableResponse::setTable(const utility::string_t& value) +{ + m_Table = value; + m_TableIsSet = true; +} + +bool DescribeTableResponse::tableIsSet() const +{ + return m_TableIsSet; +} + +void DescribeTableResponse::unsetTable() +{ + m_TableIsSet = false; +} +std::vector DescribeTableResponse::getRNamespace() const +{ + return m_r_namespace; +} + + +void DescribeTableResponse::setRNamespace(const std::vector& value) +{ + m_r_namespace = value; + m_r_namespaceIsSet = true; +} + +bool DescribeTableResponse::rNamespaceIsSet() const +{ + return m_r_namespaceIsSet; +} + +void DescribeTableResponse::unsetr_namespace() +{ + m_r_namespaceIsSet = false; +} +int64_t DescribeTableResponse::getVersion() const +{ + return m_Version; +} + +void DescribeTableResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool DescribeTableResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void DescribeTableResponse::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t DescribeTableResponse::getLocation() const +{ + return m_Location; +} + + +void DescribeTableResponse::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool DescribeTableResponse::locationIsSet() const +{ + return m_LocationIsSet; +} + +void DescribeTableResponse::unsetLocation() +{ + m_LocationIsSet = false; +} +utility::string_t DescribeTableResponse::getTableUri() const +{ + return m_Table_uri; +} + + +void DescribeTableResponse::setTableUri(const utility::string_t& value) +{ + m_Table_uri = value; + m_Table_uriIsSet = true; +} + +bool DescribeTableResponse::tableUriIsSet() const +{ + return m_Table_uriIsSet; +} + +void DescribeTableResponse::unsetTable_uri() +{ + m_Table_uriIsSet = false; +} +std::shared_ptr DescribeTableResponse::getSchema() const +{ + return m_Schema; +} + + +void DescribeTableResponse::setSchema(const std::shared_ptr& value) +{ + m_Schema = value; + m_SchemaIsSet = true; +} + +bool DescribeTableResponse::schemaIsSet() const +{ + return m_SchemaIsSet; +} + +void DescribeTableResponse::unsetSchema() +{ + m_SchemaIsSet = false; +} +std::map DescribeTableResponse::getStorageOptions() const +{ + return m_Storage_options; +} + + +void DescribeTableResponse::setStorageOptions(const std::map& value) +{ + m_Storage_options = value; + m_Storage_optionsIsSet = true; +} + +bool DescribeTableResponse::storageOptionsIsSet() const +{ + return m_Storage_optionsIsSet; +} + +void DescribeTableResponse::unsetStorage_options() +{ + m_Storage_optionsIsSet = false; +} +std::shared_ptr DescribeTableResponse::getStats() const +{ + return m_Stats; +} + + +void DescribeTableResponse::setStats(const std::shared_ptr& value) +{ + m_Stats = value; + m_StatsIsSet = true; +} + +bool DescribeTableResponse::statsIsSet() const +{ + return m_StatsIsSet; +} + +void DescribeTableResponse::unsetStats() +{ + m_StatsIsSet = false; +} +std::map DescribeTableResponse::getMetadata() const +{ + return m_Metadata; +} + + +void DescribeTableResponse::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool DescribeTableResponse::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void DescribeTableResponse::unsetMetadata() +{ + m_MetadataIsSet = false; +} +std::map DescribeTableResponse::getProperties() const +{ + return m_Properties; +} + + +void DescribeTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DescribeTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DescribeTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} +bool DescribeTableResponse::isManagedVersioning() const +{ + return m_Managed_versioning; +} + +void DescribeTableResponse::setManagedVersioning(bool value) +{ + m_Managed_versioning = value; + m_Managed_versioningIsSet = true; +} + +bool DescribeTableResponse::managedVersioningIsSet() const +{ + return m_Managed_versioningIsSet; +} + +void DescribeTableResponse::unsetManaged_versioning() +{ + m_Managed_versioningIsSet = false; +} +bool DescribeTableResponse::isIsOnlyDeclared() const +{ + return m_Is_only_declared; +} + +void DescribeTableResponse::setIsOnlyDeclared(bool value) +{ + m_Is_only_declared = value; + m_Is_only_declaredIsSet = true; +} + +bool DescribeTableResponse::isOnlyDeclaredIsSet() const +{ + return m_Is_only_declaredIsSet; +} + +void DescribeTableResponse::unsetIs_only_declared() +{ + m_Is_only_declaredIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTableVersionRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTableVersionRequest.cpp new file mode 100644 index 000000000..6603fa6be --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTableVersionRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTableVersionRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTableVersionRequest::DescribeTableVersionRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; +} + +DescribeTableVersionRequest::~DescribeTableVersionRequest() +{ +} + +void DescribeTableVersionRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTableVersionRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + + return val; +} + +bool DescribeTableVersionRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + return ok; +} + +void DescribeTableVersionRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } +} + +bool DescribeTableVersionRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + return ok; +} + + +std::shared_ptr DescribeTableVersionRequest::getIdentity() const +{ + return m_Identity; +} + + +void DescribeTableVersionRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DescribeTableVersionRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DescribeTableVersionRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DescribeTableVersionRequest::getContext() const +{ + return m_Context; +} + + +void DescribeTableVersionRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DescribeTableVersionRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DescribeTableVersionRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DescribeTableVersionRequest::getId() const +{ + return m_Id; +} + + +void DescribeTableVersionRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DescribeTableVersionRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DescribeTableVersionRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t DescribeTableVersionRequest::getVersion() const +{ + return m_Version; +} + +void DescribeTableVersionRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool DescribeTableVersionRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void DescribeTableVersionRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t DescribeTableVersionRequest::getBranch() const +{ + return m_Branch; +} + + +void DescribeTableVersionRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool DescribeTableVersionRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void DescribeTableVersionRequest::unsetBranch() +{ + m_BranchIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTableVersionResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTableVersionResponse.cpp new file mode 100644 index 000000000..c368cefc2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTableVersionResponse.cpp @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTableVersionResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTableVersionResponse::DescribeTableVersionResponse() +{ + m_VersionIsSet = false; +} + +DescribeTableVersionResponse::~DescribeTableVersionResponse() +{ +} + +void DescribeTableVersionResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTableVersionResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool DescribeTableVersionResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void DescribeTableVersionResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool DescribeTableVersionResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + std::shared_ptr refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +std::shared_ptr DescribeTableVersionResponse::getVersion() const +{ + return m_Version; +} + + +void DescribeTableVersionResponse::setVersion(const std::shared_ptr& value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool DescribeTableVersionResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void DescribeTableVersionResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTransactionRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTransactionRequest.cpp new file mode 100644 index 000000000..f564fefe4 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTransactionRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTransactionRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTransactionRequest::DescribeTransactionRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; +} + +DescribeTransactionRequest::~DescribeTransactionRequest() +{ +} + +void DescribeTransactionRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTransactionRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + + return val; +} + +bool DescribeTransactionRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + return ok; +} + +void DescribeTransactionRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } +} + +bool DescribeTransactionRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + return ok; +} + + +std::shared_ptr DescribeTransactionRequest::getIdentity() const +{ + return m_Identity; +} + + +void DescribeTransactionRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DescribeTransactionRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DescribeTransactionRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DescribeTransactionRequest::getContext() const +{ + return m_Context; +} + + +void DescribeTransactionRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DescribeTransactionRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DescribeTransactionRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DescribeTransactionRequest::getId() const +{ + return m_Id; +} + + +void DescribeTransactionRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DescribeTransactionRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DescribeTransactionRequest::unsetId() +{ + m_IdIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DescribeTransactionResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DescribeTransactionResponse.cpp new file mode 100644 index 000000000..e91610678 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DescribeTransactionResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DescribeTransactionResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DescribeTransactionResponse::DescribeTransactionResponse() +{ + m_Status = utility::conversions::to_string_t(""); + m_StatusIsSet = false; + m_PropertiesIsSet = false; +} + +DescribeTransactionResponse::~DescribeTransactionResponse() +{ +} + +void DescribeTransactionResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DescribeTransactionResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_StatusIsSet) + { + + val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool DescribeTransactionResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("status")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); + setStatus(refVal_setStatus); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void DescribeTransactionResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_StatusIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool DescribeTransactionResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); + setStatus(refVal_setStatus); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t DescribeTransactionResponse::getStatus() const +{ + return m_Status; +} + + +void DescribeTransactionResponse::setStatus(const utility::string_t& value) +{ + m_Status = value; + m_StatusIsSet = true; +} + +bool DescribeTransactionResponse::statusIsSet() const +{ + return m_StatusIsSet; +} + +void DescribeTransactionResponse::unsetStatus() +{ + m_StatusIsSet = false; +} +std::map DescribeTransactionResponse::getProperties() const +{ + return m_Properties; +} + + +void DescribeTransactionResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DescribeTransactionResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DescribeTransactionResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DropNamespaceRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DropNamespaceRequest.cpp new file mode 100644 index 000000000..8c982b267 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DropNamespaceRequest.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DropNamespaceRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DropNamespaceRequest::DropNamespaceRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; + m_Behavior = utility::conversions::to_string_t(""); + m_BehaviorIsSet = false; +} + +DropNamespaceRequest::~DropNamespaceRequest() +{ +} + +void DropNamespaceRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DropNamespaceRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + if(m_BehaviorIsSet) + { + + val[utility::conversions::to_string_t(U("behavior"))] = ModelBase::toJson(m_Behavior); + } + + return val; +} + +bool DropNamespaceRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("behavior")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("behavior"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBehavior; + ok &= ModelBase::fromJson(fieldValue, refVal_setBehavior); + setBehavior(refVal_setBehavior); + + } + } + return ok; +} + +void DropNamespaceRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } + if(m_BehaviorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("behavior")), m_Behavior)); + } +} + +bool DropNamespaceRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("behavior")))) + { + utility::string_t refVal_setBehavior; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("behavior"))), refVal_setBehavior ); + setBehavior(refVal_setBehavior); + } + return ok; +} + + +std::shared_ptr DropNamespaceRequest::getIdentity() const +{ + return m_Identity; +} + + +void DropNamespaceRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DropNamespaceRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DropNamespaceRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DropNamespaceRequest::getContext() const +{ + return m_Context; +} + + +void DropNamespaceRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DropNamespaceRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DropNamespaceRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DropNamespaceRequest::getId() const +{ + return m_Id; +} + + +void DropNamespaceRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DropNamespaceRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DropNamespaceRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DropNamespaceRequest::getMode() const +{ + return m_Mode; +} + + +void DropNamespaceRequest::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool DropNamespaceRequest::modeIsSet() const +{ + return m_ModeIsSet; +} + +void DropNamespaceRequest::unsetMode() +{ + m_ModeIsSet = false; +} +utility::string_t DropNamespaceRequest::getBehavior() const +{ + return m_Behavior; +} + + +void DropNamespaceRequest::setBehavior(const utility::string_t& value) +{ + m_Behavior = value; + m_BehaviorIsSet = true; +} + +bool DropNamespaceRequest::behaviorIsSet() const +{ + return m_BehaviorIsSet; +} + +void DropNamespaceRequest::unsetBehavior() +{ + m_BehaviorIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DropNamespaceResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DropNamespaceResponse.cpp new file mode 100644 index 000000000..be2083f84 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DropNamespaceResponse.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DropNamespaceResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DropNamespaceResponse::DropNamespaceResponse() +{ + m_PropertiesIsSet = false; + m_Transaction_idIsSet = false; +} + +DropNamespaceResponse::~DropNamespaceResponse() +{ +} + +void DropNamespaceResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DropNamespaceResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool DropNamespaceResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void DropNamespaceResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool DropNamespaceResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + std::vector refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +std::map DropNamespaceResponse::getProperties() const +{ + return m_Properties; +} + + +void DropNamespaceResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DropNamespaceResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DropNamespaceResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} +std::vector DropNamespaceResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DropNamespaceResponse::setTransactionId(const std::vector& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DropNamespaceResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DropNamespaceResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DropTableIndexRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DropTableIndexRequest.cpp new file mode 100644 index 000000000..1ab778fb2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DropTableIndexRequest.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DropTableIndexRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DropTableIndexRequest::DropTableIndexRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Index_name = utility::conversions::to_string_t(""); + m_Index_nameIsSet = false; +} + +DropTableIndexRequest::~DropTableIndexRequest() +{ +} + +void DropTableIndexRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DropTableIndexRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Index_nameIsSet) + { + + val[utility::conversions::to_string_t(U("index_name"))] = ModelBase::toJson(m_Index_name); + } + + return val; +} + +bool DropTableIndexRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexName; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexName); + setIndexName(refVal_setIndexName); + + } + } + return ok; +} + +void DropTableIndexRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Index_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_name")), m_Index_name)); + } +} + +bool DropTableIndexRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_name")))) + { + utility::string_t refVal_setIndexName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_name"))), refVal_setIndexName ); + setIndexName(refVal_setIndexName); + } + return ok; +} + + +std::shared_ptr DropTableIndexRequest::getIdentity() const +{ + return m_Identity; +} + + +void DropTableIndexRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DropTableIndexRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DropTableIndexRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DropTableIndexRequest::getContext() const +{ + return m_Context; +} + + +void DropTableIndexRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DropTableIndexRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DropTableIndexRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DropTableIndexRequest::getId() const +{ + return m_Id; +} + + +void DropTableIndexRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DropTableIndexRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DropTableIndexRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DropTableIndexRequest::getBranch() const +{ + return m_Branch; +} + + +void DropTableIndexRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool DropTableIndexRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void DropTableIndexRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t DropTableIndexRequest::getIndexName() const +{ + return m_Index_name; +} + + +void DropTableIndexRequest::setIndexName(const utility::string_t& value) +{ + m_Index_name = value; + m_Index_nameIsSet = true; +} + +bool DropTableIndexRequest::indexNameIsSet() const +{ + return m_Index_nameIsSet; +} + +void DropTableIndexRequest::unsetIndex_name() +{ + m_Index_nameIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DropTableIndexResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DropTableIndexResponse.cpp new file mode 100644 index 000000000..4526e03c1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DropTableIndexResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DropTableIndexResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DropTableIndexResponse::DropTableIndexResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +DropTableIndexResponse::~DropTableIndexResponse() +{ +} + +void DropTableIndexResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DropTableIndexResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool DropTableIndexResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void DropTableIndexResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool DropTableIndexResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t DropTableIndexResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DropTableIndexResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DropTableIndexResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DropTableIndexResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DropTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/DropTableRequest.cpp new file mode 100644 index 000000000..5620492fe --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DropTableRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DropTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DropTableRequest::DropTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; +} + +DropTableRequest::~DropTableRequest() +{ +} + +void DropTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value DropTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + + return val; +} + +bool DropTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + return ok; +} + +void DropTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } +} + +bool DropTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + return ok; +} + + +std::shared_ptr DropTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void DropTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool DropTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void DropTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map DropTableRequest::getContext() const +{ + return m_Context; +} + + +void DropTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool DropTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void DropTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector DropTableRequest::getId() const +{ + return m_Id; +} + + +void DropTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DropTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void DropTableRequest::unsetId() +{ + m_IdIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/DropTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/DropTableResponse.cpp new file mode 100644 index 000000000..3e87b7c30 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/DropTableResponse.cpp @@ -0,0 +1,269 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/DropTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +DropTableResponse::DropTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_IdIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_PropertiesIsSet = false; +} + +DropTableResponse::~DropTableResponse() +{ +} + +void DropTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value DropTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool DropTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void DropTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool DropTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t DropTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void DropTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool DropTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void DropTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +std::vector DropTableResponse::getId() const +{ + return m_Id; +} + + +void DropTableResponse::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool DropTableResponse::idIsSet() const +{ + return m_IdIsSet; +} + +void DropTableResponse::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t DropTableResponse::getLocation() const +{ + return m_Location; +} + + +void DropTableResponse::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool DropTableResponse::locationIsSet() const +{ + return m_LocationIsSet; +} + +void DropTableResponse::unsetLocation() +{ + m_LocationIsSet = false; +} +std::map DropTableResponse::getProperties() const +{ + return m_Properties; +} + + +void DropTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool DropTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void DropTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ErrorResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ErrorResponse.cpp new file mode 100644 index 000000000..44fa342b6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ErrorResponse.cpp @@ -0,0 +1,270 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ErrorResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ErrorResponse::ErrorResponse() +{ + m_Error = utility::conversions::to_string_t(""); + m_ErrorIsSet = false; + m_Code = 0; + m_CodeIsSet = false; + m_Detail = utility::conversions::to_string_t(""); + m_DetailIsSet = false; + m_Instance = utility::conversions::to_string_t(""); + m_InstanceIsSet = false; +} + +ErrorResponse::~ErrorResponse() +{ +} + +void ErrorResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ErrorResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_ErrorIsSet) + { + + val[utility::conversions::to_string_t(U("error"))] = ModelBase::toJson(m_Error); + } + if(m_CodeIsSet) + { + + val[utility::conversions::to_string_t(U("code"))] = ModelBase::toJson(m_Code); + } + if(m_DetailIsSet) + { + + val[utility::conversions::to_string_t(U("detail"))] = ModelBase::toJson(m_Detail); + } + if(m_InstanceIsSet) + { + + val[utility::conversions::to_string_t(U("instance"))] = ModelBase::toJson(m_Instance); + } + + return val; +} + +bool ErrorResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("error")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("error"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setError; + ok &= ModelBase::fromJson(fieldValue, refVal_setError); + setError(refVal_setError); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("code")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("code"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setCode; + ok &= ModelBase::fromJson(fieldValue, refVal_setCode); + setCode(refVal_setCode); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("detail")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("detail"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setDetail; + ok &= ModelBase::fromJson(fieldValue, refVal_setDetail); + setDetail(refVal_setDetail); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("instance")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("instance"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setInstance; + ok &= ModelBase::fromJson(fieldValue, refVal_setInstance); + setInstance(refVal_setInstance); + + } + } + return ok; +} + +void ErrorResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_ErrorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("error")), m_Error)); + } + if(m_CodeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code")), m_Code)); + } + if(m_DetailIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("detail")), m_Detail)); + } + if(m_InstanceIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("instance")), m_Instance)); + } +} + +bool ErrorResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("error")))) + { + utility::string_t refVal_setError; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("error"))), refVal_setError ); + setError(refVal_setError); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("code")))) + { + int32_t refVal_setCode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode ); + setCode(refVal_setCode); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("detail")))) + { + utility::string_t refVal_setDetail; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("detail"))), refVal_setDetail ); + setDetail(refVal_setDetail); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("instance")))) + { + utility::string_t refVal_setInstance; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("instance"))), refVal_setInstance ); + setInstance(refVal_setInstance); + } + return ok; +} + + +utility::string_t ErrorResponse::getError() const +{ + return m_Error; +} + + +void ErrorResponse::setError(const utility::string_t& value) +{ + m_Error = value; + m_ErrorIsSet = true; +} + +bool ErrorResponse::errorIsSet() const +{ + return m_ErrorIsSet; +} + +void ErrorResponse::unsetError() +{ + m_ErrorIsSet = false; +} +int32_t ErrorResponse::getCode() const +{ + return m_Code; +} + +void ErrorResponse::setCode(int32_t value) +{ + m_Code = value; + m_CodeIsSet = true; +} + +bool ErrorResponse::codeIsSet() const +{ + return m_CodeIsSet; +} + +void ErrorResponse::unsetCode() +{ + m_CodeIsSet = false; +} +utility::string_t ErrorResponse::getDetail() const +{ + return m_Detail; +} + + +void ErrorResponse::setDetail(const utility::string_t& value) +{ + m_Detail = value; + m_DetailIsSet = true; +} + +bool ErrorResponse::detailIsSet() const +{ + return m_DetailIsSet; +} + +void ErrorResponse::unsetDetail() +{ + m_DetailIsSet = false; +} +utility::string_t ErrorResponse::getInstance() const +{ + return m_Instance; +} + + +void ErrorResponse::setInstance(const utility::string_t& value) +{ + m_Instance = value; + m_InstanceIsSet = true; +} + +bool ErrorResponse::instanceIsSet() const +{ + return m_InstanceIsSet; +} + +void ErrorResponse::unsetInstance() +{ + m_InstanceIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanRequest.cpp new file mode 100644 index 000000000..f531f7ebd --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanRequest.cpp @@ -0,0 +1,364 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ExplainTableQueryPlanRequest::ExplainTableQueryPlanRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_QueryIsSet = false; + m_Verbose = false; + m_VerboseIsSet = false; +} + +ExplainTableQueryPlanRequest::~ExplainTableQueryPlanRequest() +{ +} + +void ExplainTableQueryPlanRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ExplainTableQueryPlanRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_QueryIsSet) + { + + val[utility::conversions::to_string_t(U("query"))] = ModelBase::toJson(m_Query); + } + if(m_VerboseIsSet) + { + + val[utility::conversions::to_string_t(U("verbose"))] = ModelBase::toJson(m_Verbose); + } + + return val; +} + +bool ExplainTableQueryPlanRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("query"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setQuery); + setQuery(refVal_setQuery); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("verbose")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("verbose"))); + if(!fieldValue.is_null()) + { + bool refVal_setVerbose; + ok &= ModelBase::fromJson(fieldValue, refVal_setVerbose); + setVerbose(refVal_setVerbose); + + } + } + return ok; +} + +void ExplainTableQueryPlanRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_QueryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("query")), m_Query)); + } + if(m_VerboseIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("verbose")), m_Verbose)); + } +} + +bool ExplainTableQueryPlanRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("query")))) + { + std::shared_ptr refVal_setQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("query"))), refVal_setQuery ); + setQuery(refVal_setQuery); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("verbose")))) + { + bool refVal_setVerbose; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("verbose"))), refVal_setVerbose ); + setVerbose(refVal_setVerbose); + } + return ok; +} + + +std::shared_ptr ExplainTableQueryPlanRequest::getIdentity() const +{ + return m_Identity; +} + + +void ExplainTableQueryPlanRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ExplainTableQueryPlanRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ExplainTableQueryPlanRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ExplainTableQueryPlanRequest::getContext() const +{ + return m_Context; +} + + +void ExplainTableQueryPlanRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ExplainTableQueryPlanRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ExplainTableQueryPlanRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ExplainTableQueryPlanRequest::getId() const +{ + return m_Id; +} + + +void ExplainTableQueryPlanRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ExplainTableQueryPlanRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ExplainTableQueryPlanRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t ExplainTableQueryPlanRequest::getBranch() const +{ + return m_Branch; +} + + +void ExplainTableQueryPlanRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool ExplainTableQueryPlanRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void ExplainTableQueryPlanRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::shared_ptr ExplainTableQueryPlanRequest::getQuery() const +{ + return m_Query; +} + + +void ExplainTableQueryPlanRequest::setQuery(const std::shared_ptr& value) +{ + m_Query = value; + m_QueryIsSet = true; +} + +bool ExplainTableQueryPlanRequest::queryIsSet() const +{ + return m_QueryIsSet; +} + +void ExplainTableQueryPlanRequest::unsetQuery() +{ + m_QueryIsSet = false; +} +bool ExplainTableQueryPlanRequest::isVerbose() const +{ + return m_Verbose; +} + +void ExplainTableQueryPlanRequest::setVerbose(bool value) +{ + m_Verbose = value; + m_VerboseIsSet = true; +} + +bool ExplainTableQueryPlanRequest::verboseIsSet() const +{ + return m_VerboseIsSet; +} + +void ExplainTableQueryPlanRequest::unsetVerbose() +{ + m_VerboseIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanResponse.cpp new file mode 100644 index 000000000..1a1027dd1 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ExplainTableQueryPlanResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ExplainTableQueryPlanResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ExplainTableQueryPlanResponse::ExplainTableQueryPlanResponse() +{ + m_Plan = utility::conversions::to_string_t(""); + m_PlanIsSet = false; +} + +ExplainTableQueryPlanResponse::~ExplainTableQueryPlanResponse() +{ +} + +void ExplainTableQueryPlanResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ExplainTableQueryPlanResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_PlanIsSet) + { + + val[utility::conversions::to_string_t(U("plan"))] = ModelBase::toJson(m_Plan); + } + + return val; +} + +bool ExplainTableQueryPlanResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("plan")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("plan"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPlan; + ok &= ModelBase::fromJson(fieldValue, refVal_setPlan); + setPlan(refVal_setPlan); + + } + } + return ok; +} + +void ExplainTableQueryPlanResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_PlanIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("plan")), m_Plan)); + } +} + +bool ExplainTableQueryPlanResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("plan")))) + { + utility::string_t refVal_setPlan; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("plan"))), refVal_setPlan ); + setPlan(refVal_setPlan); + } + return ok; +} + + +utility::string_t ExplainTableQueryPlanResponse::getPlan() const +{ + return m_Plan; +} + + +void ExplainTableQueryPlanResponse::setPlan(const utility::string_t& value) +{ + m_Plan = value; + m_PlanIsSet = true; +} + +bool ExplainTableQueryPlanResponse::planIsSet() const +{ + return m_PlanIsSet; +} + +void ExplainTableQueryPlanResponse::unsetPlan() +{ + m_PlanIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/FragmentStats.cpp b/cpp/lance_namespace_rest_client/src/model/FragmentStats.cpp new file mode 100644 index 000000000..e58ee76f6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/FragmentStats.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/FragmentStats.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +FragmentStats::FragmentStats() +{ + m_Num_fragments = 0L; + m_Num_fragmentsIsSet = false; + m_Num_small_fragments = 0L; + m_Num_small_fragmentsIsSet = false; + m_LengthsIsSet = false; +} + +FragmentStats::~FragmentStats() +{ +} + +void FragmentStats::validate() +{ + // TODO: implement validation +} + +web::json::value FragmentStats::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Num_fragmentsIsSet) + { + + val[utility::conversions::to_string_t(U("num_fragments"))] = ModelBase::toJson(m_Num_fragments); + } + if(m_Num_small_fragmentsIsSet) + { + + val[utility::conversions::to_string_t(U("num_small_fragments"))] = ModelBase::toJson(m_Num_small_fragments); + } + if(m_LengthsIsSet) + { + + val[utility::conversions::to_string_t(U("lengths"))] = ModelBase::toJson(m_Lengths); + } + + return val; +} + +bool FragmentStats::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("num_fragments")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_fragments"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumFragments; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumFragments); + setNumFragments(refVal_setNumFragments); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_small_fragments")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_small_fragments"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumSmallFragments; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumSmallFragments); + setNumSmallFragments(refVal_setNumSmallFragments); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("lengths")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("lengths"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setLengths; + ok &= ModelBase::fromJson(fieldValue, refVal_setLengths); + setLengths(refVal_setLengths); + + } + } + return ok; +} + +void FragmentStats::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Num_fragmentsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_fragments")), m_Num_fragments)); + } + if(m_Num_small_fragmentsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_small_fragments")), m_Num_small_fragments)); + } + if(m_LengthsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lengths")), m_Lengths)); + } +} + +bool FragmentStats::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("num_fragments")))) + { + int64_t refVal_setNumFragments; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_fragments"))), refVal_setNumFragments ); + setNumFragments(refVal_setNumFragments); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_small_fragments")))) + { + int64_t refVal_setNumSmallFragments; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_small_fragments"))), refVal_setNumSmallFragments ); + setNumSmallFragments(refVal_setNumSmallFragments); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("lengths")))) + { + std::shared_ptr refVal_setLengths; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lengths"))), refVal_setLengths ); + setLengths(refVal_setLengths); + } + return ok; +} + + +int64_t FragmentStats::getNumFragments() const +{ + return m_Num_fragments; +} + +void FragmentStats::setNumFragments(int64_t value) +{ + m_Num_fragments = value; + m_Num_fragmentsIsSet = true; +} + +bool FragmentStats::numFragmentsIsSet() const +{ + return m_Num_fragmentsIsSet; +} + +void FragmentStats::unsetNum_fragments() +{ + m_Num_fragmentsIsSet = false; +} +int64_t FragmentStats::getNumSmallFragments() const +{ + return m_Num_small_fragments; +} + +void FragmentStats::setNumSmallFragments(int64_t value) +{ + m_Num_small_fragments = value; + m_Num_small_fragmentsIsSet = true; +} + +bool FragmentStats::numSmallFragmentsIsSet() const +{ + return m_Num_small_fragmentsIsSet; +} + +void FragmentStats::unsetNum_small_fragments() +{ + m_Num_small_fragmentsIsSet = false; +} +std::shared_ptr FragmentStats::getLengths() const +{ + return m_Lengths; +} + + +void FragmentStats::setLengths(const std::shared_ptr& value) +{ + m_Lengths = value; + m_LengthsIsSet = true; +} + +bool FragmentStats::lengthsIsSet() const +{ + return m_LengthsIsSet; +} + +void FragmentStats::unsetLengths() +{ + m_LengthsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/FragmentSummary.cpp b/cpp/lance_namespace_rest_client/src/model/FragmentSummary.cpp new file mode 100644 index 000000000..72ee0ef03 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/FragmentSummary.cpp @@ -0,0 +1,411 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/FragmentSummary.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +FragmentSummary::FragmentSummary() +{ + m_Min = 0L; + m_MinIsSet = false; + m_Max = 0L; + m_MaxIsSet = false; + m_Mean = 0L; + m_MeanIsSet = false; + m_P25 = 0L; + m_P25IsSet = false; + m_P50 = 0L; + m_P50IsSet = false; + m_P75 = 0L; + m_P75IsSet = false; + m_P99 = 0L; + m_P99IsSet = false; +} + +FragmentSummary::~FragmentSummary() +{ +} + +void FragmentSummary::validate() +{ + // TODO: implement validation +} + +web::json::value FragmentSummary::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_MinIsSet) + { + + val[utility::conversions::to_string_t(U("min"))] = ModelBase::toJson(m_Min); + } + if(m_MaxIsSet) + { + + val[utility::conversions::to_string_t(U("max"))] = ModelBase::toJson(m_Max); + } + if(m_MeanIsSet) + { + + val[utility::conversions::to_string_t(U("mean"))] = ModelBase::toJson(m_Mean); + } + if(m_P25IsSet) + { + + val[utility::conversions::to_string_t(U("p25"))] = ModelBase::toJson(m_P25); + } + if(m_P50IsSet) + { + + val[utility::conversions::to_string_t(U("p50"))] = ModelBase::toJson(m_P50); + } + if(m_P75IsSet) + { + + val[utility::conversions::to_string_t(U("p75"))] = ModelBase::toJson(m_P75); + } + if(m_P99IsSet) + { + + val[utility::conversions::to_string_t(U("p99"))] = ModelBase::toJson(m_P99); + } + + return val; +} + +bool FragmentSummary::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("min")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("min"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setMin; + ok &= ModelBase::fromJson(fieldValue, refVal_setMin); + setMin(refVal_setMin); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("max")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("max"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setMax; + ok &= ModelBase::fromJson(fieldValue, refVal_setMax); + setMax(refVal_setMax); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mean")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mean"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setMean; + ok &= ModelBase::fromJson(fieldValue, refVal_setMean); + setMean(refVal_setMean); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("p25")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("p25"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setP25; + ok &= ModelBase::fromJson(fieldValue, refVal_setP25); + setP25(refVal_setP25); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("p50")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("p50"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setP50; + ok &= ModelBase::fromJson(fieldValue, refVal_setP50); + setP50(refVal_setP50); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("p75")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("p75"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setP75; + ok &= ModelBase::fromJson(fieldValue, refVal_setP75); + setP75(refVal_setP75); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("p99")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("p99"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setP99; + ok &= ModelBase::fromJson(fieldValue, refVal_setP99); + setP99(refVal_setP99); + + } + } + return ok; +} + +void FragmentSummary::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_MinIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("min")), m_Min)); + } + if(m_MaxIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("max")), m_Max)); + } + if(m_MeanIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mean")), m_Mean)); + } + if(m_P25IsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("p25")), m_P25)); + } + if(m_P50IsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("p50")), m_P50)); + } + if(m_P75IsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("p75")), m_P75)); + } + if(m_P99IsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("p99")), m_P99)); + } +} + +bool FragmentSummary::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("min")))) + { + int64_t refVal_setMin; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("min"))), refVal_setMin ); + setMin(refVal_setMin); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("max")))) + { + int64_t refVal_setMax; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("max"))), refVal_setMax ); + setMax(refVal_setMax); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mean")))) + { + int64_t refVal_setMean; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mean"))), refVal_setMean ); + setMean(refVal_setMean); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("p25")))) + { + int64_t refVal_setP25; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("p25"))), refVal_setP25 ); + setP25(refVal_setP25); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("p50")))) + { + int64_t refVal_setP50; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("p50"))), refVal_setP50 ); + setP50(refVal_setP50); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("p75")))) + { + int64_t refVal_setP75; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("p75"))), refVal_setP75 ); + setP75(refVal_setP75); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("p99")))) + { + int64_t refVal_setP99; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("p99"))), refVal_setP99 ); + setP99(refVal_setP99); + } + return ok; +} + + +int64_t FragmentSummary::getMin() const +{ + return m_Min; +} + +void FragmentSummary::setMin(int64_t value) +{ + m_Min = value; + m_MinIsSet = true; +} + +bool FragmentSummary::minIsSet() const +{ + return m_MinIsSet; +} + +void FragmentSummary::unsetMin() +{ + m_MinIsSet = false; +} +int64_t FragmentSummary::getMax() const +{ + return m_Max; +} + +void FragmentSummary::setMax(int64_t value) +{ + m_Max = value; + m_MaxIsSet = true; +} + +bool FragmentSummary::maxIsSet() const +{ + return m_MaxIsSet; +} + +void FragmentSummary::unsetMax() +{ + m_MaxIsSet = false; +} +int64_t FragmentSummary::getMean() const +{ + return m_Mean; +} + +void FragmentSummary::setMean(int64_t value) +{ + m_Mean = value; + m_MeanIsSet = true; +} + +bool FragmentSummary::meanIsSet() const +{ + return m_MeanIsSet; +} + +void FragmentSummary::unsetMean() +{ + m_MeanIsSet = false; +} +int64_t FragmentSummary::getP25() const +{ + return m_P25; +} + +void FragmentSummary::setP25(int64_t value) +{ + m_P25 = value; + m_P25IsSet = true; +} + +bool FragmentSummary::p25IsSet() const +{ + return m_P25IsSet; +} + +void FragmentSummary::unsetP25() +{ + m_P25IsSet = false; +} +int64_t FragmentSummary::getP50() const +{ + return m_P50; +} + +void FragmentSummary::setP50(int64_t value) +{ + m_P50 = value; + m_P50IsSet = true; +} + +bool FragmentSummary::p50IsSet() const +{ + return m_P50IsSet; +} + +void FragmentSummary::unsetP50() +{ + m_P50IsSet = false; +} +int64_t FragmentSummary::getP75() const +{ + return m_P75; +} + +void FragmentSummary::setP75(int64_t value) +{ + m_P75 = value; + m_P75IsSet = true; +} + +bool FragmentSummary::p75IsSet() const +{ + return m_P75IsSet; +} + +void FragmentSummary::unsetP75() +{ + m_P75IsSet = false; +} +int64_t FragmentSummary::getP99() const +{ + return m_P99; +} + +void FragmentSummary::setP99(int64_t value) +{ + m_P99 = value; + m_P99IsSet = true; +} + +bool FragmentSummary::p99IsSet() const +{ + return m_P99IsSet; +} + +void FragmentSummary::unsetP99() +{ + m_P99IsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/FtsQuery.cpp b/cpp/lance_namespace_rest_client/src/model/FtsQuery.cpp new file mode 100644 index 000000000..ccea0eada --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/FtsQuery.cpp @@ -0,0 +1,315 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/FtsQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +FtsQuery::FtsQuery() +{ + m_MatchIsSet = false; + m_PhraseIsSet = false; + m_BoostIsSet = false; + m_Multi_matchIsSet = false; + m_booleanIsSet = false; +} + +FtsQuery::~FtsQuery() +{ +} + +void FtsQuery::validate() +{ + // TODO: implement validation +} + +web::json::value FtsQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_MatchIsSet) + { + + val[utility::conversions::to_string_t(U("match"))] = ModelBase::toJson(m_Match); + } + if(m_PhraseIsSet) + { + + val[utility::conversions::to_string_t(U("phrase"))] = ModelBase::toJson(m_Phrase); + } + if(m_BoostIsSet) + { + + val[utility::conversions::to_string_t(U("boost"))] = ModelBase::toJson(m_Boost); + } + if(m_Multi_matchIsSet) + { + + val[utility::conversions::to_string_t(U("multi_match"))] = ModelBase::toJson(m_Multi_match); + } + if(m_booleanIsSet) + { + + val[utility::conversions::to_string_t(U("boolean"))] = ModelBase::toJson(m_boolean); + } + + return val; +} + +bool FtsQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("match")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("match"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setMatch; + ok &= ModelBase::fromJson(fieldValue, refVal_setMatch); + setMatch(refVal_setMatch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("phrase")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("phrase"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setPhrase; + ok &= ModelBase::fromJson(fieldValue, refVal_setPhrase); + setPhrase(refVal_setPhrase); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("boost")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("boost"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setBoost; + ok &= ModelBase::fromJson(fieldValue, refVal_setBoost); + setBoost(refVal_setBoost); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("multi_match")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("multi_match"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setMultiMatch; + ok &= ModelBase::fromJson(fieldValue, refVal_setMultiMatch); + setMultiMatch(refVal_setMultiMatch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("boolean")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("boolean"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setBoolean; + ok &= ModelBase::fromJson(fieldValue, refVal_setBoolean); + setBoolean(refVal_setBoolean); + + } + } + return ok; +} + +void FtsQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_MatchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("match")), m_Match)); + } + if(m_PhraseIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("phrase")), m_Phrase)); + } + if(m_BoostIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boost")), m_Boost)); + } + if(m_Multi_matchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("multi_match")), m_Multi_match)); + } + if(m_booleanIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boolean")), m_boolean)); + } +} + +bool FtsQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("match")))) + { + std::shared_ptr refVal_setMatch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("match"))), refVal_setMatch ); + setMatch(refVal_setMatch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("phrase")))) + { + std::shared_ptr refVal_setPhrase; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phrase"))), refVal_setPhrase ); + setPhrase(refVal_setPhrase); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("boost")))) + { + std::shared_ptr refVal_setBoost; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boost"))), refVal_setBoost ); + setBoost(refVal_setBoost); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("multi_match")))) + { + std::shared_ptr refVal_setMultiMatch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("multi_match"))), refVal_setMultiMatch ); + setMultiMatch(refVal_setMultiMatch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("boolean")))) + { + std::shared_ptr refVal_setBoolean; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boolean"))), refVal_setBoolean ); + setBoolean(refVal_setBoolean); + } + return ok; +} + + +std::shared_ptr FtsQuery::getMatch() const +{ + return m_Match; +} + + +void FtsQuery::setMatch(const std::shared_ptr& value) +{ + m_Match = value; + m_MatchIsSet = true; +} + +bool FtsQuery::matchIsSet() const +{ + return m_MatchIsSet; +} + +void FtsQuery::unsetMatch() +{ + m_MatchIsSet = false; +} +std::shared_ptr FtsQuery::getPhrase() const +{ + return m_Phrase; +} + + +void FtsQuery::setPhrase(const std::shared_ptr& value) +{ + m_Phrase = value; + m_PhraseIsSet = true; +} + +bool FtsQuery::phraseIsSet() const +{ + return m_PhraseIsSet; +} + +void FtsQuery::unsetPhrase() +{ + m_PhraseIsSet = false; +} +std::shared_ptr FtsQuery::getBoost() const +{ + return m_Boost; +} + + +void FtsQuery::setBoost(const std::shared_ptr& value) +{ + m_Boost = value; + m_BoostIsSet = true; +} + +bool FtsQuery::boostIsSet() const +{ + return m_BoostIsSet; +} + +void FtsQuery::unsetBoost() +{ + m_BoostIsSet = false; +} +std::shared_ptr FtsQuery::getMultiMatch() const +{ + return m_Multi_match; +} + + +void FtsQuery::setMultiMatch(const std::shared_ptr& value) +{ + m_Multi_match = value; + m_Multi_matchIsSet = true; +} + +bool FtsQuery::multiMatchIsSet() const +{ + return m_Multi_matchIsSet; +} + +void FtsQuery::unsetMulti_match() +{ + m_Multi_matchIsSet = false; +} +std::shared_ptr FtsQuery::getBoolean() const +{ + return m_boolean; +} + + +void FtsQuery::setBoolean(const std::shared_ptr& value) +{ + m_boolean = value; + m_booleanIsSet = true; +} + +bool FtsQuery::booleanIsSet() const +{ + return m_booleanIsSet; +} + +void FtsQuery::unsetboolean() +{ + m_booleanIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/GetTableStatsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/GetTableStatsRequest.cpp new file mode 100644 index 000000000..a00224a30 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/GetTableStatsRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/GetTableStatsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +GetTableStatsRequest::GetTableStatsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; +} + +GetTableStatsRequest::~GetTableStatsRequest() +{ +} + +void GetTableStatsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value GetTableStatsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + + return val; +} + +bool GetTableStatsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + return ok; +} + +void GetTableStatsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } +} + +bool GetTableStatsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + return ok; +} + + +std::shared_ptr GetTableStatsRequest::getIdentity() const +{ + return m_Identity; +} + + +void GetTableStatsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool GetTableStatsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void GetTableStatsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map GetTableStatsRequest::getContext() const +{ + return m_Context; +} + + +void GetTableStatsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool GetTableStatsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void GetTableStatsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector GetTableStatsRequest::getId() const +{ + return m_Id; +} + + +void GetTableStatsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool GetTableStatsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void GetTableStatsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t GetTableStatsRequest::getBranch() const +{ + return m_Branch; +} + + +void GetTableStatsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool GetTableStatsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void GetTableStatsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/GetTableStatsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/GetTableStatsResponse.cpp new file mode 100644 index 000000000..4017da3af --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/GetTableStatsResponse.cpp @@ -0,0 +1,267 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/GetTableStatsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +GetTableStatsResponse::GetTableStatsResponse() +{ + m_Total_bytes = 0L; + m_Total_bytesIsSet = false; + m_Num_rows = 0L; + m_Num_rowsIsSet = false; + m_Num_indices = 0L; + m_Num_indicesIsSet = false; + m_Fragment_statsIsSet = false; +} + +GetTableStatsResponse::~GetTableStatsResponse() +{ +} + +void GetTableStatsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value GetTableStatsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Total_bytesIsSet) + { + + val[utility::conversions::to_string_t(U("total_bytes"))] = ModelBase::toJson(m_Total_bytes); + } + if(m_Num_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_rows"))] = ModelBase::toJson(m_Num_rows); + } + if(m_Num_indicesIsSet) + { + + val[utility::conversions::to_string_t(U("num_indices"))] = ModelBase::toJson(m_Num_indices); + } + if(m_Fragment_statsIsSet) + { + + val[utility::conversions::to_string_t(U("fragment_stats"))] = ModelBase::toJson(m_Fragment_stats); + } + + return val; +} + +bool GetTableStatsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("total_bytes")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("total_bytes"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setTotalBytes; + ok &= ModelBase::fromJson(fieldValue, refVal_setTotalBytes); + setTotalBytes(refVal_setTotalBytes); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumRows); + setNumRows(refVal_setNumRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_indices")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_indices"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumIndices; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumIndices); + setNumIndices(refVal_setNumIndices); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("fragment_stats")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fragment_stats"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setFragmentStats; + ok &= ModelBase::fromJson(fieldValue, refVal_setFragmentStats); + setFragmentStats(refVal_setFragmentStats); + + } + } + return ok; +} + +void GetTableStatsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Total_bytesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("total_bytes")), m_Total_bytes)); + } + if(m_Num_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_rows")), m_Num_rows)); + } + if(m_Num_indicesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_indices")), m_Num_indices)); + } + if(m_Fragment_statsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fragment_stats")), m_Fragment_stats)); + } +} + +bool GetTableStatsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("total_bytes")))) + { + int64_t refVal_setTotalBytes; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("total_bytes"))), refVal_setTotalBytes ); + setTotalBytes(refVal_setTotalBytes); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_rows")))) + { + int64_t refVal_setNumRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_rows"))), refVal_setNumRows ); + setNumRows(refVal_setNumRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_indices")))) + { + int64_t refVal_setNumIndices; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_indices"))), refVal_setNumIndices ); + setNumIndices(refVal_setNumIndices); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("fragment_stats")))) + { + std::shared_ptr refVal_setFragmentStats; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fragment_stats"))), refVal_setFragmentStats ); + setFragmentStats(refVal_setFragmentStats); + } + return ok; +} + + +int64_t GetTableStatsResponse::getTotalBytes() const +{ + return m_Total_bytes; +} + +void GetTableStatsResponse::setTotalBytes(int64_t value) +{ + m_Total_bytes = value; + m_Total_bytesIsSet = true; +} + +bool GetTableStatsResponse::totalBytesIsSet() const +{ + return m_Total_bytesIsSet; +} + +void GetTableStatsResponse::unsetTotal_bytes() +{ + m_Total_bytesIsSet = false; +} +int64_t GetTableStatsResponse::getNumRows() const +{ + return m_Num_rows; +} + +void GetTableStatsResponse::setNumRows(int64_t value) +{ + m_Num_rows = value; + m_Num_rowsIsSet = true; +} + +bool GetTableStatsResponse::numRowsIsSet() const +{ + return m_Num_rowsIsSet; +} + +void GetTableStatsResponse::unsetNum_rows() +{ + m_Num_rowsIsSet = false; +} +int64_t GetTableStatsResponse::getNumIndices() const +{ + return m_Num_indices; +} + +void GetTableStatsResponse::setNumIndices(int64_t value) +{ + m_Num_indices = value; + m_Num_indicesIsSet = true; +} + +bool GetTableStatsResponse::numIndicesIsSet() const +{ + return m_Num_indicesIsSet; +} + +void GetTableStatsResponse::unsetNum_indices() +{ + m_Num_indicesIsSet = false; +} +std::shared_ptr GetTableStatsResponse::getFragmentStats() const +{ + return m_Fragment_stats; +} + + +void GetTableStatsResponse::setFragmentStats(const std::shared_ptr& value) +{ + m_Fragment_stats = value; + m_Fragment_statsIsSet = true; +} + +bool GetTableStatsResponse::fragmentStatsIsSet() const +{ + return m_Fragment_statsIsSet; +} + +void GetTableStatsResponse::unsetFragment_stats() +{ + m_Fragment_statsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/GetTableTagVersionRequest.cpp b/cpp/lance_namespace_rest_client/src/model/GetTableTagVersionRequest.cpp new file mode 100644 index 000000000..3a02ab5c3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/GetTableTagVersionRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/GetTableTagVersionRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +GetTableTagVersionRequest::GetTableTagVersionRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Tag = utility::conversions::to_string_t(""); + m_TagIsSet = false; +} + +GetTableTagVersionRequest::~GetTableTagVersionRequest() +{ +} + +void GetTableTagVersionRequest::validate() +{ + // TODO: implement validation +} + +web::json::value GetTableTagVersionRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_TagIsSet) + { + + val[utility::conversions::to_string_t(U("tag"))] = ModelBase::toJson(m_Tag); + } + + return val; +} + +bool GetTableTagVersionRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromJson(fieldValue, refVal_setTag); + setTag(refVal_setTag); + + } + } + return ok; +} + +void GetTableTagVersionRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_TagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tag")), m_Tag)); + } +} + +bool GetTableTagVersionRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("tag")))) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tag"))), refVal_setTag ); + setTag(refVal_setTag); + } + return ok; +} + + +std::shared_ptr GetTableTagVersionRequest::getIdentity() const +{ + return m_Identity; +} + + +void GetTableTagVersionRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool GetTableTagVersionRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void GetTableTagVersionRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map GetTableTagVersionRequest::getContext() const +{ + return m_Context; +} + + +void GetTableTagVersionRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool GetTableTagVersionRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void GetTableTagVersionRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector GetTableTagVersionRequest::getId() const +{ + return m_Id; +} + + +void GetTableTagVersionRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool GetTableTagVersionRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void GetTableTagVersionRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t GetTableTagVersionRequest::getTag() const +{ + return m_Tag; +} + + +void GetTableTagVersionRequest::setTag(const utility::string_t& value) +{ + m_Tag = value; + m_TagIsSet = true; +} + +bool GetTableTagVersionRequest::tagIsSet() const +{ + return m_TagIsSet; +} + +void GetTableTagVersionRequest::unsetTag() +{ + m_TagIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/GetTableTagVersionResponse.cpp b/cpp/lance_namespace_rest_client/src/model/GetTableTagVersionResponse.cpp new file mode 100644 index 000000000..9500b7be3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/GetTableTagVersionResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/GetTableTagVersionResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +GetTableTagVersionResponse::GetTableTagVersionResponse() +{ + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; +} + +GetTableTagVersionResponse::~GetTableTagVersionResponse() +{ +} + +void GetTableTagVersionResponse::validate() +{ + // TODO: implement validation +} + +web::json::value GetTableTagVersionResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + + return val; +} + +bool GetTableTagVersionResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + return ok; +} + +void GetTableTagVersionResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } +} + +bool GetTableTagVersionResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + return ok; +} + + +int64_t GetTableTagVersionResponse::getVersion() const +{ + return m_Version; +} + +void GetTableTagVersionResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool GetTableTagVersionResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void GetTableTagVersionResponse::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t GetTableTagVersionResponse::getBranch() const +{ + return m_Branch; +} + + +void GetTableTagVersionResponse::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool GetTableTagVersionResponse::branchIsSet() const +{ + return m_BranchIsSet; +} + +void GetTableTagVersionResponse::unsetBranch() +{ + m_BranchIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/Identity.cpp b/cpp/lance_namespace_rest_client/src/model/Identity.cpp new file mode 100644 index 000000000..80d369ff6 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/Identity.cpp @@ -0,0 +1,173 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/Identity.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +Identity::Identity() +{ + m_Api_key = utility::conversions::to_string_t(""); + m_Api_keyIsSet = false; + m_Auth_token = utility::conversions::to_string_t(""); + m_Auth_tokenIsSet = false; +} + +Identity::~Identity() +{ +} + +void Identity::validate() +{ + // TODO: implement validation +} + +web::json::value Identity::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Api_keyIsSet) + { + + val[utility::conversions::to_string_t(U("api_key"))] = ModelBase::toJson(m_Api_key); + } + if(m_Auth_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("auth_token"))] = ModelBase::toJson(m_Auth_token); + } + + return val; +} + +bool Identity::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("api_key")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("api_key"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setApiKey; + ok &= ModelBase::fromJson(fieldValue, refVal_setApiKey); + setApiKey(refVal_setApiKey); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("auth_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("auth_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setAuthToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setAuthToken); + setAuthToken(refVal_setAuthToken); + + } + } + return ok; +} + +void Identity::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Api_keyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("api_key")), m_Api_key)); + } + if(m_Auth_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("auth_token")), m_Auth_token)); + } +} + +bool Identity::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("api_key")))) + { + utility::string_t refVal_setApiKey; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("api_key"))), refVal_setApiKey ); + setApiKey(refVal_setApiKey); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("auth_token")))) + { + utility::string_t refVal_setAuthToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("auth_token"))), refVal_setAuthToken ); + setAuthToken(refVal_setAuthToken); + } + return ok; +} + + +utility::string_t Identity::getApiKey() const +{ + return m_Api_key; +} + + +void Identity::setApiKey(const utility::string_t& value) +{ + m_Api_key = value; + m_Api_keyIsSet = true; +} + +bool Identity::apiKeyIsSet() const +{ + return m_Api_keyIsSet; +} + +void Identity::unsetApi_key() +{ + m_Api_keyIsSet = false; +} +utility::string_t Identity::getAuthToken() const +{ + return m_Auth_token; +} + + +void Identity::setAuthToken(const utility::string_t& value) +{ + m_Auth_token = value; + m_Auth_tokenIsSet = true; +} + +bool Identity::authTokenIsSet() const +{ + return m_Auth_tokenIsSet; +} + +void Identity::unsetAuth_token() +{ + m_Auth_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/IndexContent.cpp b/cpp/lance_namespace_rest_client/src/model/IndexContent.cpp new file mode 100644 index 000000000..d97f86064 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/IndexContent.cpp @@ -0,0 +1,706 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/IndexContent.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +IndexContent::IndexContent() +{ + m_Index_name = utility::conversions::to_string_t(""); + m_Index_nameIsSet = false; + m_Index_uuid = utility::conversions::to_string_t(""); + m_Index_uuidIsSet = false; + m_ColumnsIsSet = false; + m_Status = utility::conversions::to_string_t(""); + m_StatusIsSet = false; + m_Index_type = utility::conversions::to_string_t(""); + m_Index_typeIsSet = false; + m_Type_url = utility::conversions::to_string_t(""); + m_Type_urlIsSet = false; + m_Num_indexed_rows = 0L; + m_Num_indexed_rowsIsSet = false; + m_Num_unindexed_rows = 0L; + m_Num_unindexed_rowsIsSet = false; + m_Size_bytes = 0L; + m_Size_bytesIsSet = false; + m_Num_segments = 0; + m_Num_segmentsIsSet = false; + m_Created_at = utility::datetime(); + m_Created_atIsSet = false; + m_Index_version = 0; + m_Index_versionIsSet = false; + m_Index_details = utility::conversions::to_string_t(""); + m_Index_detailsIsSet = false; +} + +IndexContent::~IndexContent() +{ +} + +void IndexContent::validate() +{ + // TODO: implement validation +} + +web::json::value IndexContent::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Index_nameIsSet) + { + + val[utility::conversions::to_string_t(U("index_name"))] = ModelBase::toJson(m_Index_name); + } + if(m_Index_uuidIsSet) + { + + val[utility::conversions::to_string_t(U("index_uuid"))] = ModelBase::toJson(m_Index_uuid); + } + if(m_ColumnsIsSet) + { + + val[utility::conversions::to_string_t(U("columns"))] = ModelBase::toJson(m_Columns); + } + if(m_StatusIsSet) + { + + val[utility::conversions::to_string_t(U("status"))] = ModelBase::toJson(m_Status); + } + if(m_Index_typeIsSet) + { + + val[utility::conversions::to_string_t(U("index_type"))] = ModelBase::toJson(m_Index_type); + } + if(m_Type_urlIsSet) + { + + val[utility::conversions::to_string_t(U("type_url"))] = ModelBase::toJson(m_Type_url); + } + if(m_Num_indexed_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_indexed_rows"))] = ModelBase::toJson(m_Num_indexed_rows); + } + if(m_Num_unindexed_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_unindexed_rows"))] = ModelBase::toJson(m_Num_unindexed_rows); + } + if(m_Size_bytesIsSet) + { + + val[utility::conversions::to_string_t(U("size_bytes"))] = ModelBase::toJson(m_Size_bytes); + } + if(m_Num_segmentsIsSet) + { + + val[utility::conversions::to_string_t(U("num_segments"))] = ModelBase::toJson(m_Num_segments); + } + if(m_Created_atIsSet) + { + + val[utility::conversions::to_string_t(U("created_at"))] = ModelBase::toJson(m_Created_at); + } + if(m_Index_versionIsSet) + { + + val[utility::conversions::to_string_t(U("index_version"))] = ModelBase::toJson(m_Index_version); + } + if(m_Index_detailsIsSet) + { + + val[utility::conversions::to_string_t(U("index_details"))] = ModelBase::toJson(m_Index_details); + } + + return val; +} + +bool IndexContent::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("index_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexName; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexName); + setIndexName(refVal_setIndexName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_uuid")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_uuid"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexUuid; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexUuid); + setIndexUuid(refVal_setIndexUuid); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("columns"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumns); + setColumns(refVal_setColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("status")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromJson(fieldValue, refVal_setStatus); + setStatus(refVal_setStatus); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexType; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexType); + setIndexType(refVal_setIndexType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("type_url")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type_url"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTypeUrl; + ok &= ModelBase::fromJson(fieldValue, refVal_setTypeUrl); + setTypeUrl(refVal_setTypeUrl); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_indexed_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_indexed_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumIndexedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumIndexedRows); + setNumIndexedRows(refVal_setNumIndexedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_unindexed_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_unindexed_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumUnindexedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumUnindexedRows); + setNumUnindexedRows(refVal_setNumUnindexedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("size_bytes")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("size_bytes"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setSizeBytes; + ok &= ModelBase::fromJson(fieldValue, refVal_setSizeBytes); + setSizeBytes(refVal_setSizeBytes); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_segments")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_segments"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNumSegments; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumSegments); + setNumSegments(refVal_setNumSegments); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("created_at")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("created_at"))); + if(!fieldValue.is_null()) + { + utility::datetime refVal_setCreatedAt; + ok &= ModelBase::fromJson(fieldValue, refVal_setCreatedAt); + setCreatedAt(refVal_setCreatedAt); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_version"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setIndexVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexVersion); + setIndexVersion(refVal_setIndexVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("index_details")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("index_details"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setIndexDetails; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexDetails); + setIndexDetails(refVal_setIndexDetails); + + } + } + return ok; +} + +void IndexContent::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Index_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_name")), m_Index_name)); + } + if(m_Index_uuidIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_uuid")), m_Index_uuid)); + } + if(m_ColumnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("columns")), m_Columns)); + } + if(m_StatusIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("status")), m_Status)); + } + if(m_Index_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_type")), m_Index_type)); + } + if(m_Type_urlIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type_url")), m_Type_url)); + } + if(m_Num_indexed_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_indexed_rows")), m_Num_indexed_rows)); + } + if(m_Num_unindexed_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_unindexed_rows")), m_Num_unindexed_rows)); + } + if(m_Size_bytesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("size_bytes")), m_Size_bytes)); + } + if(m_Num_segmentsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_segments")), m_Num_segments)); + } + if(m_Created_atIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("created_at")), m_Created_at)); + } + if(m_Index_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_version")), m_Index_version)); + } + if(m_Index_detailsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("index_details")), m_Index_details)); + } +} + +bool IndexContent::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("index_name")))) + { + utility::string_t refVal_setIndexName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_name"))), refVal_setIndexName ); + setIndexName(refVal_setIndexName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_uuid")))) + { + utility::string_t refVal_setIndexUuid; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_uuid"))), refVal_setIndexUuid ); + setIndexUuid(refVal_setIndexUuid); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("columns")))) + { + std::vector refVal_setColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("columns"))), refVal_setColumns ); + setColumns(refVal_setColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) + { + utility::string_t refVal_setStatus; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus ); + setStatus(refVal_setStatus); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_type")))) + { + utility::string_t refVal_setIndexType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_type"))), refVal_setIndexType ); + setIndexType(refVal_setIndexType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("type_url")))) + { + utility::string_t refVal_setTypeUrl; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type_url"))), refVal_setTypeUrl ); + setTypeUrl(refVal_setTypeUrl); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_indexed_rows")))) + { + int64_t refVal_setNumIndexedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_indexed_rows"))), refVal_setNumIndexedRows ); + setNumIndexedRows(refVal_setNumIndexedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_unindexed_rows")))) + { + int64_t refVal_setNumUnindexedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_unindexed_rows"))), refVal_setNumUnindexedRows ); + setNumUnindexedRows(refVal_setNumUnindexedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("size_bytes")))) + { + int64_t refVal_setSizeBytes; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("size_bytes"))), refVal_setSizeBytes ); + setSizeBytes(refVal_setSizeBytes); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_segments")))) + { + int32_t refVal_setNumSegments; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_segments"))), refVal_setNumSegments ); + setNumSegments(refVal_setNumSegments); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("created_at")))) + { + utility::datetime refVal_setCreatedAt; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("created_at"))), refVal_setCreatedAt ); + setCreatedAt(refVal_setCreatedAt); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_version")))) + { + int32_t refVal_setIndexVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_version"))), refVal_setIndexVersion ); + setIndexVersion(refVal_setIndexVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("index_details")))) + { + utility::string_t refVal_setIndexDetails; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("index_details"))), refVal_setIndexDetails ); + setIndexDetails(refVal_setIndexDetails); + } + return ok; +} + + +utility::string_t IndexContent::getIndexName() const +{ + return m_Index_name; +} + + +void IndexContent::setIndexName(const utility::string_t& value) +{ + m_Index_name = value; + m_Index_nameIsSet = true; +} + +bool IndexContent::indexNameIsSet() const +{ + return m_Index_nameIsSet; +} + +void IndexContent::unsetIndex_name() +{ + m_Index_nameIsSet = false; +} +utility::string_t IndexContent::getIndexUuid() const +{ + return m_Index_uuid; +} + + +void IndexContent::setIndexUuid(const utility::string_t& value) +{ + m_Index_uuid = value; + m_Index_uuidIsSet = true; +} + +bool IndexContent::indexUuidIsSet() const +{ + return m_Index_uuidIsSet; +} + +void IndexContent::unsetIndex_uuid() +{ + m_Index_uuidIsSet = false; +} +std::vector IndexContent::getColumns() const +{ + return m_Columns; +} + + +void IndexContent::setColumns(const std::vector& value) +{ + m_Columns = value; + m_ColumnsIsSet = true; +} + +bool IndexContent::columnsIsSet() const +{ + return m_ColumnsIsSet; +} + +void IndexContent::unsetColumns() +{ + m_ColumnsIsSet = false; +} +utility::string_t IndexContent::getStatus() const +{ + return m_Status; +} + + +void IndexContent::setStatus(const utility::string_t& value) +{ + m_Status = value; + m_StatusIsSet = true; +} + +bool IndexContent::statusIsSet() const +{ + return m_StatusIsSet; +} + +void IndexContent::unsetStatus() +{ + m_StatusIsSet = false; +} +utility::string_t IndexContent::getIndexType() const +{ + return m_Index_type; +} + + +void IndexContent::setIndexType(const utility::string_t& value) +{ + m_Index_type = value; + m_Index_typeIsSet = true; +} + +bool IndexContent::indexTypeIsSet() const +{ + return m_Index_typeIsSet; +} + +void IndexContent::unsetIndex_type() +{ + m_Index_typeIsSet = false; +} +utility::string_t IndexContent::getTypeUrl() const +{ + return m_Type_url; +} + + +void IndexContent::setTypeUrl(const utility::string_t& value) +{ + m_Type_url = value; + m_Type_urlIsSet = true; +} + +bool IndexContent::typeUrlIsSet() const +{ + return m_Type_urlIsSet; +} + +void IndexContent::unsetType_url() +{ + m_Type_urlIsSet = false; +} +int64_t IndexContent::getNumIndexedRows() const +{ + return m_Num_indexed_rows; +} + +void IndexContent::setNumIndexedRows(int64_t value) +{ + m_Num_indexed_rows = value; + m_Num_indexed_rowsIsSet = true; +} + +bool IndexContent::numIndexedRowsIsSet() const +{ + return m_Num_indexed_rowsIsSet; +} + +void IndexContent::unsetNum_indexed_rows() +{ + m_Num_indexed_rowsIsSet = false; +} +int64_t IndexContent::getNumUnindexedRows() const +{ + return m_Num_unindexed_rows; +} + +void IndexContent::setNumUnindexedRows(int64_t value) +{ + m_Num_unindexed_rows = value; + m_Num_unindexed_rowsIsSet = true; +} + +bool IndexContent::numUnindexedRowsIsSet() const +{ + return m_Num_unindexed_rowsIsSet; +} + +void IndexContent::unsetNum_unindexed_rows() +{ + m_Num_unindexed_rowsIsSet = false; +} +int64_t IndexContent::getSizeBytes() const +{ + return m_Size_bytes; +} + +void IndexContent::setSizeBytes(int64_t value) +{ + m_Size_bytes = value; + m_Size_bytesIsSet = true; +} + +bool IndexContent::sizeBytesIsSet() const +{ + return m_Size_bytesIsSet; +} + +void IndexContent::unsetSize_bytes() +{ + m_Size_bytesIsSet = false; +} +int32_t IndexContent::getNumSegments() const +{ + return m_Num_segments; +} + +void IndexContent::setNumSegments(int32_t value) +{ + m_Num_segments = value; + m_Num_segmentsIsSet = true; +} + +bool IndexContent::numSegmentsIsSet() const +{ + return m_Num_segmentsIsSet; +} + +void IndexContent::unsetNum_segments() +{ + m_Num_segmentsIsSet = false; +} +utility::datetime IndexContent::getCreatedAt() const +{ + return m_Created_at; +} + + +void IndexContent::setCreatedAt(const utility::datetime& value) +{ + m_Created_at = value; + m_Created_atIsSet = true; +} + +bool IndexContent::createdAtIsSet() const +{ + return m_Created_atIsSet; +} + +void IndexContent::unsetCreated_at() +{ + m_Created_atIsSet = false; +} +int32_t IndexContent::getIndexVersion() const +{ + return m_Index_version; +} + +void IndexContent::setIndexVersion(int32_t value) +{ + m_Index_version = value; + m_Index_versionIsSet = true; +} + +bool IndexContent::indexVersionIsSet() const +{ + return m_Index_versionIsSet; +} + +void IndexContent::unsetIndex_version() +{ + m_Index_versionIsSet = false; +} +utility::string_t IndexContent::getIndexDetails() const +{ + return m_Index_details; +} + + +void IndexContent::setIndexDetails(const utility::string_t& value) +{ + m_Index_details = value; + m_Index_detailsIsSet = true; +} + +bool IndexContent::indexDetailsIsSet() const +{ + return m_Index_detailsIsSet; +} + +void IndexContent::unsetIndex_details() +{ + m_Index_detailsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/InsertIntoTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/InsertIntoTableRequest.cpp new file mode 100644 index 000000000..07d68bccf --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/InsertIntoTableRequest.cpp @@ -0,0 +1,317 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/InsertIntoTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +InsertIntoTableRequest::InsertIntoTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; +} + +InsertIntoTableRequest::~InsertIntoTableRequest() +{ +} + +void InsertIntoTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value InsertIntoTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + + return val; +} + +bool InsertIntoTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + return ok; +} + +void InsertIntoTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } +} + +bool InsertIntoTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + return ok; +} + + +std::shared_ptr InsertIntoTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void InsertIntoTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool InsertIntoTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void InsertIntoTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map InsertIntoTableRequest::getContext() const +{ + return m_Context; +} + + +void InsertIntoTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool InsertIntoTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void InsertIntoTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector InsertIntoTableRequest::getId() const +{ + return m_Id; +} + + +void InsertIntoTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool InsertIntoTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void InsertIntoTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t InsertIntoTableRequest::getBranch() const +{ + return m_Branch; +} + + +void InsertIntoTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool InsertIntoTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void InsertIntoTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t InsertIntoTableRequest::getMode() const +{ + return m_Mode; +} + + +void InsertIntoTableRequest::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool InsertIntoTableRequest::modeIsSet() const +{ + return m_ModeIsSet; +} + +void InsertIntoTableRequest::unsetMode() +{ + m_ModeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/InsertIntoTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/InsertIntoTableResponse.cpp new file mode 100644 index 000000000..1c67b2795 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/InsertIntoTableResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/InsertIntoTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +InsertIntoTableResponse::InsertIntoTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +InsertIntoTableResponse::~InsertIntoTableResponse() +{ +} + +void InsertIntoTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value InsertIntoTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool InsertIntoTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void InsertIntoTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool InsertIntoTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t InsertIntoTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void InsertIntoTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool InsertIntoTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void InsertIntoTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/JsonArrowDataType.cpp b/cpp/lance_namespace_rest_client/src/model/JsonArrowDataType.cpp new file mode 100644 index 000000000..467858de7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/JsonArrowDataType.cpp @@ -0,0 +1,220 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/JsonArrowDataType.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +JsonArrowDataType::JsonArrowDataType() +{ + m_FieldsIsSet = false; + m_Length = 0L; + m_LengthIsSet = false; + m_Type = utility::conversions::to_string_t(""); + m_TypeIsSet = false; +} + +JsonArrowDataType::~JsonArrowDataType() +{ +} + +void JsonArrowDataType::validate() +{ + // TODO: implement validation +} + +web::json::value JsonArrowDataType::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_FieldsIsSet) + { + + val[utility::conversions::to_string_t(U("fields"))] = ModelBase::toJson(m_Fields); + } + if(m_LengthIsSet) + { + + val[utility::conversions::to_string_t(U("length"))] = ModelBase::toJson(m_Length); + } + if(m_TypeIsSet) + { + + val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type); + } + + return val; +} + +bool JsonArrowDataType::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("fields")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fields"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setFields; + ok &= ModelBase::fromJson(fieldValue, refVal_setFields); + setFields(refVal_setFields); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("length")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("length"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setLength; + ok &= ModelBase::fromJson(fieldValue, refVal_setLength); + setLength(refVal_setLength); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setType; + ok &= ModelBase::fromJson(fieldValue, refVal_setType); + setType(refVal_setType); + + } + } + return ok; +} + +void JsonArrowDataType::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_FieldsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fields")), m_Fields)); + } + if(m_LengthIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("length")), m_Length)); + } + if(m_TypeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type)); + } +} + +bool JsonArrowDataType::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("fields")))) + { + std::vector> refVal_setFields; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fields"))), refVal_setFields ); + setFields(refVal_setFields); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("length")))) + { + int64_t refVal_setLength; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("length"))), refVal_setLength ); + setLength(refVal_setLength); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) + { + utility::string_t refVal_setType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType ); + setType(refVal_setType); + } + return ok; +} + + +std::vector> JsonArrowDataType::getFields() const +{ + return m_Fields; +} + + +void JsonArrowDataType::setFields(const std::vector>& value) +{ + m_Fields = value; + m_FieldsIsSet = true; +} + +bool JsonArrowDataType::fieldsIsSet() const +{ + return m_FieldsIsSet; +} + +void JsonArrowDataType::unsetFields() +{ + m_FieldsIsSet = false; +} +int64_t JsonArrowDataType::getLength() const +{ + return m_Length; +} + +void JsonArrowDataType::setLength(int64_t value) +{ + m_Length = value; + m_LengthIsSet = true; +} + +bool JsonArrowDataType::lengthIsSet() const +{ + return m_LengthIsSet; +} + +void JsonArrowDataType::unsetLength() +{ + m_LengthIsSet = false; +} +utility::string_t JsonArrowDataType::getType() const +{ + return m_Type; +} + + +void JsonArrowDataType::setType(const utility::string_t& value) +{ + m_Type = value; + m_TypeIsSet = true; +} + +bool JsonArrowDataType::typeIsSet() const +{ + return m_TypeIsSet; +} + +void JsonArrowDataType::unsetType() +{ + m_TypeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/JsonArrowField.cpp b/cpp/lance_namespace_rest_client/src/model/JsonArrowField.cpp new file mode 100644 index 000000000..9b0a3750f --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/JsonArrowField.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/JsonArrowField.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +JsonArrowField::JsonArrowField() +{ + m_MetadataIsSet = false; + m_Name = utility::conversions::to_string_t(""); + m_NameIsSet = false; + m_Nullable = false; + m_NullableIsSet = false; + m_TypeIsSet = false; +} + +JsonArrowField::~JsonArrowField() +{ +} + +void JsonArrowField::validate() +{ + // TODO: implement validation +} + +web::json::value JsonArrowField::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + if(m_NameIsSet) + { + + val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name); + } + if(m_NullableIsSet) + { + + val[utility::conversions::to_string_t(U("nullable"))] = ModelBase::toJson(m_Nullable); + } + if(m_TypeIsSet) + { + + val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type); + } + + return val; +} + +bool JsonArrowField::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromJson(fieldValue, refVal_setName); + setName(refVal_setName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("nullable")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("nullable"))); + if(!fieldValue.is_null()) + { + bool refVal_setNullable; + ok &= ModelBase::fromJson(fieldValue, refVal_setNullable); + setNullable(refVal_setNullable); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setType; + ok &= ModelBase::fromJson(fieldValue, refVal_setType); + setType(refVal_setType); + + } + } + return ok; +} + +void JsonArrowField::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } + if(m_NameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name)); + } + if(m_NullableIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("nullable")), m_Nullable)); + } + if(m_TypeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type)); + } +} + +bool JsonArrowField::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) + { + utility::string_t refVal_setName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName ); + setName(refVal_setName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("nullable")))) + { + bool refVal_setNullable; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("nullable"))), refVal_setNullable ); + setNullable(refVal_setNullable); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) + { + std::shared_ptr refVal_setType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType ); + setType(refVal_setType); + } + return ok; +} + + +std::map JsonArrowField::getMetadata() const +{ + return m_Metadata; +} + + +void JsonArrowField::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool JsonArrowField::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void JsonArrowField::unsetMetadata() +{ + m_MetadataIsSet = false; +} +utility::string_t JsonArrowField::getName() const +{ + return m_Name; +} + + +void JsonArrowField::setName(const utility::string_t& value) +{ + m_Name = value; + m_NameIsSet = true; +} + +bool JsonArrowField::nameIsSet() const +{ + return m_NameIsSet; +} + +void JsonArrowField::unsetName() +{ + m_NameIsSet = false; +} +bool JsonArrowField::isNullable() const +{ + return m_Nullable; +} + +void JsonArrowField::setNullable(bool value) +{ + m_Nullable = value; + m_NullableIsSet = true; +} + +bool JsonArrowField::nullableIsSet() const +{ + return m_NullableIsSet; +} + +void JsonArrowField::unsetNullable() +{ + m_NullableIsSet = false; +} +std::shared_ptr JsonArrowField::getType() const +{ + return m_Type; +} + + +void JsonArrowField::setType(const std::shared_ptr& value) +{ + m_Type = value; + m_TypeIsSet = true; +} + +bool JsonArrowField::typeIsSet() const +{ + return m_TypeIsSet; +} + +void JsonArrowField::unsetType() +{ + m_TypeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/JsonArrowSchema.cpp b/cpp/lance_namespace_rest_client/src/model/JsonArrowSchema.cpp new file mode 100644 index 000000000..d20a4a19b --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/JsonArrowSchema.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/JsonArrowSchema.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +JsonArrowSchema::JsonArrowSchema() +{ + m_FieldsIsSet = false; + m_MetadataIsSet = false; +} + +JsonArrowSchema::~JsonArrowSchema() +{ +} + +void JsonArrowSchema::validate() +{ + // TODO: implement validation +} + +web::json::value JsonArrowSchema::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_FieldsIsSet) + { + + val[utility::conversions::to_string_t(U("fields"))] = ModelBase::toJson(m_Fields); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + + return val; +} + +bool JsonArrowSchema::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("fields")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fields"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setFields; + ok &= ModelBase::fromJson(fieldValue, refVal_setFields); + setFields(refVal_setFields); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + return ok; +} + +void JsonArrowSchema::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_FieldsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fields")), m_Fields)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } +} + +bool JsonArrowSchema::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("fields")))) + { + std::vector> refVal_setFields; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fields"))), refVal_setFields ); + setFields(refVal_setFields); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + return ok; +} + + +std::vector> JsonArrowSchema::getFields() const +{ + return m_Fields; +} + + +void JsonArrowSchema::setFields(const std::vector>& value) +{ + m_Fields = value; + m_FieldsIsSet = true; +} + +bool JsonArrowSchema::fieldsIsSet() const +{ + return m_FieldsIsSet; +} + +void JsonArrowSchema::unsetFields() +{ + m_FieldsIsSet = false; +} +std::map JsonArrowSchema::getMetadata() const +{ + return m_Metadata; +} + + +void JsonArrowSchema::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool JsonArrowSchema::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void JsonArrowSchema::unsetMetadata() +{ + m_MetadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListNamespacesRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ListNamespacesRequest.cpp new file mode 100644 index 000000000..71c2858ba --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListNamespacesRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListNamespacesRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListNamespacesRequest::ListNamespacesRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; + m_Limit = 0; + m_LimitIsSet = false; +} + +ListNamespacesRequest::~ListNamespacesRequest() +{ +} + +void ListNamespacesRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ListNamespacesRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + if(m_LimitIsSet) + { + + val[utility::conversions::to_string_t(U("limit"))] = ModelBase::toJson(m_Limit); + } + + return val; +} + +bool ListNamespacesRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setLimit); + setLimit(refVal_setLimit); + + } + } + return ok; +} + +void ListNamespacesRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } + if(m_LimitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("limit")), m_Limit)); + } +} + +bool ListNamespacesRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("limit")))) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("limit"))), refVal_setLimit ); + setLimit(refVal_setLimit); + } + return ok; +} + + +std::shared_ptr ListNamespacesRequest::getIdentity() const +{ + return m_Identity; +} + + +void ListNamespacesRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ListNamespacesRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ListNamespacesRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ListNamespacesRequest::getContext() const +{ + return m_Context; +} + + +void ListNamespacesRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ListNamespacesRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ListNamespacesRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ListNamespacesRequest::getId() const +{ + return m_Id; +} + + +void ListNamespacesRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ListNamespacesRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ListNamespacesRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t ListNamespacesRequest::getPageToken() const +{ + return m_Page_token; +} + + +void ListNamespacesRequest::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListNamespacesRequest::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListNamespacesRequest::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} +int32_t ListNamespacesRequest::getLimit() const +{ + return m_Limit; +} + +void ListNamespacesRequest::setLimit(int32_t value) +{ + m_Limit = value; + m_LimitIsSet = true; +} + +bool ListNamespacesRequest::limitIsSet() const +{ + return m_LimitIsSet; +} + +void ListNamespacesRequest::unsetLimit() +{ + m_LimitIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListNamespacesResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ListNamespacesResponse.cpp new file mode 100644 index 000000000..f82824593 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListNamespacesResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListNamespacesResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListNamespacesResponse::ListNamespacesResponse() +{ + m_NamespacesIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; +} + +ListNamespacesResponse::~ListNamespacesResponse() +{ +} + +void ListNamespacesResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ListNamespacesResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_NamespacesIsSet) + { + + val[utility::conversions::to_string_t(U("namespaces"))] = ModelBase::toJson(m_Namespaces); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + + return val; +} + +bool ListNamespacesResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("namespaces")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("namespaces"))); + if(!fieldValue.is_null()) + { + std::set refVal_setNamespaces; + ok &= ModelBase::fromJson(fieldValue, refVal_setNamespaces); + setNamespaces(refVal_setNamespaces); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + return ok; +} + +void ListNamespacesResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_NamespacesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("namespaces")), m_Namespaces)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } +} + +bool ListNamespacesResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("namespaces")))) + { + std::set refVal_setNamespaces; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("namespaces"))), refVal_setNamespaces ); + setNamespaces(refVal_setNamespaces); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + return ok; +} + + +std::set ListNamespacesResponse::getNamespaces() const +{ + return m_Namespaces; +} + + +void ListNamespacesResponse::setNamespaces(const std::set& value) +{ + m_Namespaces = value; + m_NamespacesIsSet = true; +} + +bool ListNamespacesResponse::namespacesIsSet() const +{ + return m_NamespacesIsSet; +} + +void ListNamespacesResponse::unsetNamespaces() +{ + m_NamespacesIsSet = false; +} +utility::string_t ListNamespacesResponse::getPageToken() const +{ + return m_Page_token; +} + + +void ListNamespacesResponse::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListNamespacesResponse::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListNamespacesResponse::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableBranchesRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableBranchesRequest.cpp new file mode 100644 index 000000000..1da7fb0fb --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableBranchesRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableBranchesRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableBranchesRequest::ListTableBranchesRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; + m_Limit = 0; + m_LimitIsSet = false; +} + +ListTableBranchesRequest::~ListTableBranchesRequest() +{ +} + +void ListTableBranchesRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableBranchesRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + if(m_LimitIsSet) + { + + val[utility::conversions::to_string_t(U("limit"))] = ModelBase::toJson(m_Limit); + } + + return val; +} + +bool ListTableBranchesRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setLimit); + setLimit(refVal_setLimit); + + } + } + return ok; +} + +void ListTableBranchesRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } + if(m_LimitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("limit")), m_Limit)); + } +} + +bool ListTableBranchesRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("limit")))) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("limit"))), refVal_setLimit ); + setLimit(refVal_setLimit); + } + return ok; +} + + +std::shared_ptr ListTableBranchesRequest::getIdentity() const +{ + return m_Identity; +} + + +void ListTableBranchesRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ListTableBranchesRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ListTableBranchesRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ListTableBranchesRequest::getContext() const +{ + return m_Context; +} + + +void ListTableBranchesRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ListTableBranchesRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ListTableBranchesRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ListTableBranchesRequest::getId() const +{ + return m_Id; +} + + +void ListTableBranchesRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ListTableBranchesRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ListTableBranchesRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t ListTableBranchesRequest::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableBranchesRequest::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableBranchesRequest::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableBranchesRequest::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} +int32_t ListTableBranchesRequest::getLimit() const +{ + return m_Limit; +} + +void ListTableBranchesRequest::setLimit(int32_t value) +{ + m_Limit = value; + m_LimitIsSet = true; +} + +bool ListTableBranchesRequest::limitIsSet() const +{ + return m_LimitIsSet; +} + +void ListTableBranchesRequest::unsetLimit() +{ + m_LimitIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableBranchesResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableBranchesResponse.cpp new file mode 100644 index 000000000..570095fe7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableBranchesResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableBranchesResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableBranchesResponse::ListTableBranchesResponse() +{ + m_BranchesIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; +} + +ListTableBranchesResponse::~ListTableBranchesResponse() +{ +} + +void ListTableBranchesResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableBranchesResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_BranchesIsSet) + { + + val[utility::conversions::to_string_t(U("branches"))] = ModelBase::toJson(m_Branches); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + + return val; +} + +bool ListTableBranchesResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("branches")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branches"))); + if(!fieldValue.is_null()) + { + std::map> refVal_setBranches; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranches); + setBranches(refVal_setBranches); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + return ok; +} + +void ListTableBranchesResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_BranchesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branches")), m_Branches)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } +} + +bool ListTableBranchesResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("branches")))) + { + std::map> refVal_setBranches; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branches"))), refVal_setBranches ); + setBranches(refVal_setBranches); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + return ok; +} + + +std::map> ListTableBranchesResponse::getBranches() const +{ + return m_Branches; +} + + +void ListTableBranchesResponse::setBranches(const std::map>& value) +{ + m_Branches = value; + m_BranchesIsSet = true; +} + +bool ListTableBranchesResponse::branchesIsSet() const +{ + return m_BranchesIsSet; +} + +void ListTableBranchesResponse::unsetBranches() +{ + m_BranchesIsSet = false; +} +utility::string_t ListTableBranchesResponse::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableBranchesResponse::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableBranchesResponse::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableBranchesResponse::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableIndicesRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableIndicesRequest.cpp new file mode 100644 index 000000000..5e2c4dc98 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableIndicesRequest.cpp @@ -0,0 +1,413 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableIndicesRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableIndicesRequest::ListTableIndicesRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; + m_Limit = 0; + m_LimitIsSet = false; +} + +ListTableIndicesRequest::~ListTableIndicesRequest() +{ +} + +void ListTableIndicesRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableIndicesRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + if(m_LimitIsSet) + { + + val[utility::conversions::to_string_t(U("limit"))] = ModelBase::toJson(m_Limit); + } + + return val; +} + +bool ListTableIndicesRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setLimit); + setLimit(refVal_setLimit); + + } + } + return ok; +} + +void ListTableIndicesRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } + if(m_LimitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("limit")), m_Limit)); + } +} + +bool ListTableIndicesRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("limit")))) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("limit"))), refVal_setLimit ); + setLimit(refVal_setLimit); + } + return ok; +} + + +std::shared_ptr ListTableIndicesRequest::getIdentity() const +{ + return m_Identity; +} + + +void ListTableIndicesRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ListTableIndicesRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ListTableIndicesRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ListTableIndicesRequest::getContext() const +{ + return m_Context; +} + + +void ListTableIndicesRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ListTableIndicesRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ListTableIndicesRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ListTableIndicesRequest::getId() const +{ + return m_Id; +} + + +void ListTableIndicesRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ListTableIndicesRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ListTableIndicesRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t ListTableIndicesRequest::getVersion() const +{ + return m_Version; +} + +void ListTableIndicesRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool ListTableIndicesRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void ListTableIndicesRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t ListTableIndicesRequest::getBranch() const +{ + return m_Branch; +} + + +void ListTableIndicesRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool ListTableIndicesRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void ListTableIndicesRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t ListTableIndicesRequest::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableIndicesRequest::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableIndicesRequest::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableIndicesRequest::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} +int32_t ListTableIndicesRequest::getLimit() const +{ + return m_Limit; +} + +void ListTableIndicesRequest::setLimit(int32_t value) +{ + m_Limit = value; + m_LimitIsSet = true; +} + +bool ListTableIndicesRequest::limitIsSet() const +{ + return m_LimitIsSet; +} + +void ListTableIndicesRequest::unsetLimit() +{ + m_LimitIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableIndicesResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableIndicesResponse.cpp new file mode 100644 index 000000000..b3655d533 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableIndicesResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableIndicesResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableIndicesResponse::ListTableIndicesResponse() +{ + m_IndexesIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; +} + +ListTableIndicesResponse::~ListTableIndicesResponse() +{ +} + +void ListTableIndicesResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableIndicesResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IndexesIsSet) + { + + val[utility::conversions::to_string_t(U("indexes"))] = ModelBase::toJson(m_Indexes); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + + return val; +} + +bool ListTableIndicesResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("indexes")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("indexes"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setIndexes; + ok &= ModelBase::fromJson(fieldValue, refVal_setIndexes); + setIndexes(refVal_setIndexes); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + return ok; +} + +void ListTableIndicesResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IndexesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("indexes")), m_Indexes)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } +} + +bool ListTableIndicesResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("indexes")))) + { + std::vector> refVal_setIndexes; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("indexes"))), refVal_setIndexes ); + setIndexes(refVal_setIndexes); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + return ok; +} + + +std::vector> ListTableIndicesResponse::getIndexes() const +{ + return m_Indexes; +} + + +void ListTableIndicesResponse::setIndexes(const std::vector>& value) +{ + m_Indexes = value; + m_IndexesIsSet = true; +} + +bool ListTableIndicesResponse::indexesIsSet() const +{ + return m_IndexesIsSet; +} + +void ListTableIndicesResponse::unsetIndexes() +{ + m_IndexesIsSet = false; +} +utility::string_t ListTableIndicesResponse::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableIndicesResponse::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableIndicesResponse::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableIndicesResponse::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableTagsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableTagsRequest.cpp new file mode 100644 index 000000000..02b65d4e3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableTagsRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableTagsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableTagsRequest::ListTableTagsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; + m_Limit = 0; + m_LimitIsSet = false; +} + +ListTableTagsRequest::~ListTableTagsRequest() +{ +} + +void ListTableTagsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableTagsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + if(m_LimitIsSet) + { + + val[utility::conversions::to_string_t(U("limit"))] = ModelBase::toJson(m_Limit); + } + + return val; +} + +bool ListTableTagsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setLimit); + setLimit(refVal_setLimit); + + } + } + return ok; +} + +void ListTableTagsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } + if(m_LimitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("limit")), m_Limit)); + } +} + +bool ListTableTagsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("limit")))) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("limit"))), refVal_setLimit ); + setLimit(refVal_setLimit); + } + return ok; +} + + +std::shared_ptr ListTableTagsRequest::getIdentity() const +{ + return m_Identity; +} + + +void ListTableTagsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ListTableTagsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ListTableTagsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ListTableTagsRequest::getContext() const +{ + return m_Context; +} + + +void ListTableTagsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ListTableTagsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ListTableTagsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ListTableTagsRequest::getId() const +{ + return m_Id; +} + + +void ListTableTagsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ListTableTagsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ListTableTagsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t ListTableTagsRequest::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableTagsRequest::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableTagsRequest::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableTagsRequest::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} +int32_t ListTableTagsRequest::getLimit() const +{ + return m_Limit; +} + +void ListTableTagsRequest::setLimit(int32_t value) +{ + m_Limit = value; + m_LimitIsSet = true; +} + +bool ListTableTagsRequest::limitIsSet() const +{ + return m_LimitIsSet; +} + +void ListTableTagsRequest::unsetLimit() +{ + m_LimitIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableTagsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableTagsResponse.cpp new file mode 100644 index 000000000..b582821ac --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableTagsResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableTagsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableTagsResponse::ListTableTagsResponse() +{ + m_TagsIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; +} + +ListTableTagsResponse::~ListTableTagsResponse() +{ +} + +void ListTableTagsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableTagsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_TagsIsSet) + { + + val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + + return val; +} + +bool ListTableTagsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("tags")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tags"))); + if(!fieldValue.is_null()) + { + std::map> refVal_setTags; + ok &= ModelBase::fromJson(fieldValue, refVal_setTags); + setTags(refVal_setTags); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + return ok; +} + +void ListTableTagsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_TagsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } +} + +bool ListTableTagsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("tags")))) + { + std::map> refVal_setTags; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags ); + setTags(refVal_setTags); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + return ok; +} + + +std::map> ListTableTagsResponse::getTags() const +{ + return m_Tags; +} + + +void ListTableTagsResponse::setTags(const std::map>& value) +{ + m_Tags = value; + m_TagsIsSet = true; +} + +bool ListTableTagsResponse::tagsIsSet() const +{ + return m_TagsIsSet; +} + +void ListTableTagsResponse::unsetTags() +{ + m_TagsIsSet = false; +} +utility::string_t ListTableTagsResponse::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableTagsResponse::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableTagsResponse::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableTagsResponse::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableVersionsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableVersionsRequest.cpp new file mode 100644 index 000000000..2bb98d04c --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableVersionsRequest.cpp @@ -0,0 +1,413 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableVersionsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableVersionsRequest::ListTableVersionsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; + m_Limit = 0; + m_LimitIsSet = false; + m_Descending = false; + m_DescendingIsSet = false; +} + +ListTableVersionsRequest::~ListTableVersionsRequest() +{ +} + +void ListTableVersionsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableVersionsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + if(m_LimitIsSet) + { + + val[utility::conversions::to_string_t(U("limit"))] = ModelBase::toJson(m_Limit); + } + if(m_DescendingIsSet) + { + + val[utility::conversions::to_string_t(U("descending"))] = ModelBase::toJson(m_Descending); + } + + return val; +} + +bool ListTableVersionsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setLimit); + setLimit(refVal_setLimit); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("descending")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("descending"))); + if(!fieldValue.is_null()) + { + bool refVal_setDescending; + ok &= ModelBase::fromJson(fieldValue, refVal_setDescending); + setDescending(refVal_setDescending); + + } + } + return ok; +} + +void ListTableVersionsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } + if(m_LimitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("limit")), m_Limit)); + } + if(m_DescendingIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("descending")), m_Descending)); + } +} + +bool ListTableVersionsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("limit")))) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("limit"))), refVal_setLimit ); + setLimit(refVal_setLimit); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("descending")))) + { + bool refVal_setDescending; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("descending"))), refVal_setDescending ); + setDescending(refVal_setDescending); + } + return ok; +} + + +std::shared_ptr ListTableVersionsRequest::getIdentity() const +{ + return m_Identity; +} + + +void ListTableVersionsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ListTableVersionsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ListTableVersionsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ListTableVersionsRequest::getContext() const +{ + return m_Context; +} + + +void ListTableVersionsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ListTableVersionsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ListTableVersionsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ListTableVersionsRequest::getId() const +{ + return m_Id; +} + + +void ListTableVersionsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ListTableVersionsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ListTableVersionsRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t ListTableVersionsRequest::getBranch() const +{ + return m_Branch; +} + + +void ListTableVersionsRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool ListTableVersionsRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void ListTableVersionsRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t ListTableVersionsRequest::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableVersionsRequest::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableVersionsRequest::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableVersionsRequest::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} +int32_t ListTableVersionsRequest::getLimit() const +{ + return m_Limit; +} + +void ListTableVersionsRequest::setLimit(int32_t value) +{ + m_Limit = value; + m_LimitIsSet = true; +} + +bool ListTableVersionsRequest::limitIsSet() const +{ + return m_LimitIsSet; +} + +void ListTableVersionsRequest::unsetLimit() +{ + m_LimitIsSet = false; +} +bool ListTableVersionsRequest::isDescending() const +{ + return m_Descending; +} + +void ListTableVersionsRequest::setDescending(bool value) +{ + m_Descending = value; + m_DescendingIsSet = true; +} + +bool ListTableVersionsRequest::descendingIsSet() const +{ + return m_DescendingIsSet; +} + +void ListTableVersionsRequest::unsetDescending() +{ + m_DescendingIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTableVersionsResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ListTableVersionsResponse.cpp new file mode 100644 index 000000000..ee5ed9e88 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTableVersionsResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTableVersionsResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTableVersionsResponse::ListTableVersionsResponse() +{ + m_VersionsIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; +} + +ListTableVersionsResponse::~ListTableVersionsResponse() +{ +} + +void ListTableVersionsResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ListTableVersionsResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionsIsSet) + { + + val[utility::conversions::to_string_t(U("versions"))] = ModelBase::toJson(m_Versions); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + + return val; +} + +bool ListTableVersionsResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("versions")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("versions"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setVersions; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersions); + setVersions(refVal_setVersions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + return ok; +} + +void ListTableVersionsResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("versions")), m_Versions)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } +} + +bool ListTableVersionsResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("versions")))) + { + std::vector> refVal_setVersions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("versions"))), refVal_setVersions ); + setVersions(refVal_setVersions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + return ok; +} + + +std::vector> ListTableVersionsResponse::getVersions() const +{ + return m_Versions; +} + + +void ListTableVersionsResponse::setVersions(const std::vector>& value) +{ + m_Versions = value; + m_VersionsIsSet = true; +} + +bool ListTableVersionsResponse::versionsIsSet() const +{ + return m_VersionsIsSet; +} + +void ListTableVersionsResponse::unsetVersions() +{ + m_VersionsIsSet = false; +} +utility::string_t ListTableVersionsResponse::getPageToken() const +{ + return m_Page_token; +} + + +void ListTableVersionsResponse::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTableVersionsResponse::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTableVersionsResponse::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTablesRequest.cpp b/cpp/lance_namespace_rest_client/src/model/ListTablesRequest.cpp new file mode 100644 index 000000000..341203c21 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTablesRequest.cpp @@ -0,0 +1,364 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTablesRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTablesRequest::ListTablesRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; + m_Limit = 0; + m_LimitIsSet = false; + m_Include_declared = false; + m_Include_declaredIsSet = false; +} + +ListTablesRequest::~ListTablesRequest() +{ +} + +void ListTablesRequest::validate() +{ + // TODO: implement validation +} + +web::json::value ListTablesRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + if(m_LimitIsSet) + { + + val[utility::conversions::to_string_t(U("limit"))] = ModelBase::toJson(m_Limit); + } + if(m_Include_declaredIsSet) + { + + val[utility::conversions::to_string_t(U("include_declared"))] = ModelBase::toJson(m_Include_declared); + } + + return val; +} + +bool ListTablesRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setLimit); + setLimit(refVal_setLimit); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("include_declared")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("include_declared"))); + if(!fieldValue.is_null()) + { + bool refVal_setIncludeDeclared; + ok &= ModelBase::fromJson(fieldValue, refVal_setIncludeDeclared); + setIncludeDeclared(refVal_setIncludeDeclared); + + } + } + return ok; +} + +void ListTablesRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } + if(m_LimitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("limit")), m_Limit)); + } + if(m_Include_declaredIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("include_declared")), m_Include_declared)); + } +} + +bool ListTablesRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("limit")))) + { + int32_t refVal_setLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("limit"))), refVal_setLimit ); + setLimit(refVal_setLimit); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("include_declared")))) + { + bool refVal_setIncludeDeclared; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("include_declared"))), refVal_setIncludeDeclared ); + setIncludeDeclared(refVal_setIncludeDeclared); + } + return ok; +} + + +std::shared_ptr ListTablesRequest::getIdentity() const +{ + return m_Identity; +} + + +void ListTablesRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool ListTablesRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void ListTablesRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map ListTablesRequest::getContext() const +{ + return m_Context; +} + + +void ListTablesRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool ListTablesRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void ListTablesRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector ListTablesRequest::getId() const +{ + return m_Id; +} + + +void ListTablesRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool ListTablesRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void ListTablesRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t ListTablesRequest::getPageToken() const +{ + return m_Page_token; +} + + +void ListTablesRequest::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTablesRequest::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTablesRequest::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} +int32_t ListTablesRequest::getLimit() const +{ + return m_Limit; +} + +void ListTablesRequest::setLimit(int32_t value) +{ + m_Limit = value; + m_LimitIsSet = true; +} + +bool ListTablesRequest::limitIsSet() const +{ + return m_LimitIsSet; +} + +void ListTablesRequest::unsetLimit() +{ + m_LimitIsSet = false; +} +bool ListTablesRequest::isIncludeDeclared() const +{ + return m_Include_declared; +} + +void ListTablesRequest::setIncludeDeclared(bool value) +{ + m_Include_declared = value; + m_Include_declaredIsSet = true; +} + +bool ListTablesRequest::includeDeclaredIsSet() const +{ + return m_Include_declaredIsSet; +} + +void ListTablesRequest::unsetInclude_declared() +{ + m_Include_declaredIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/ListTablesResponse.cpp b/cpp/lance_namespace_rest_client/src/model/ListTablesResponse.cpp new file mode 100644 index 000000000..2c1b21a01 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/ListTablesResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/ListTablesResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +ListTablesResponse::ListTablesResponse() +{ + m_TablesIsSet = false; + m_Page_token = utility::conversions::to_string_t(""); + m_Page_tokenIsSet = false; +} + +ListTablesResponse::~ListTablesResponse() +{ +} + +void ListTablesResponse::validate() +{ + // TODO: implement validation +} + +web::json::value ListTablesResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_TablesIsSet) + { + + val[utility::conversions::to_string_t(U("tables"))] = ModelBase::toJson(m_Tables); + } + if(m_Page_tokenIsSet) + { + + val[utility::conversions::to_string_t(U("page_token"))] = ModelBase::toJson(m_Page_token); + } + + return val; +} + +bool ListTablesResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("tables")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tables"))); + if(!fieldValue.is_null()) + { + std::set refVal_setTables; + ok &= ModelBase::fromJson(fieldValue, refVal_setTables); + setTables(refVal_setTables); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("page_token")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page_token"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromJson(fieldValue, refVal_setPageToken); + setPageToken(refVal_setPageToken); + + } + } + return ok; +} + +void ListTablesResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_TablesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tables")), m_Tables)); + } + if(m_Page_tokenIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page_token")), m_Page_token)); + } +} + +bool ListTablesResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("tables")))) + { + std::set refVal_setTables; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tables"))), refVal_setTables ); + setTables(refVal_setTables); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("page_token")))) + { + utility::string_t refVal_setPageToken; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page_token"))), refVal_setPageToken ); + setPageToken(refVal_setPageToken); + } + return ok; +} + + +std::set ListTablesResponse::getTables() const +{ + return m_Tables; +} + + +void ListTablesResponse::setTables(const std::set& value) +{ + m_Tables = value; + m_TablesIsSet = true; +} + +bool ListTablesResponse::tablesIsSet() const +{ + return m_TablesIsSet; +} + +void ListTablesResponse::unsetTables() +{ + m_TablesIsSet = false; +} +utility::string_t ListTablesResponse::getPageToken() const +{ + return m_Page_token; +} + + +void ListTablesResponse::setPageToken(const utility::string_t& value) +{ + m_Page_token = value; + m_Page_tokenIsSet = true; +} + +bool ListTablesResponse::pageTokenIsSet() const +{ + return m_Page_tokenIsSet; +} + +void ListTablesResponse::unsetPage_token() +{ + m_Page_tokenIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/MatchQuery.cpp b/cpp/lance_namespace_rest_client/src/model/MatchQuery.cpp new file mode 100644 index 000000000..64421a7d0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/MatchQuery.cpp @@ -0,0 +1,414 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/MatchQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +MatchQuery::MatchQuery() +{ + m_Boost = 0.0f; + m_BoostIsSet = false; + m_Column = utility::conversions::to_string_t(""); + m_ColumnIsSet = false; + m_Fuzziness = 0; + m_FuzzinessIsSet = false; + m_Max_expansions = 0; + m_Max_expansionsIsSet = false; + m_r_operator = utility::conversions::to_string_t(""); + m_r_operatorIsSet = false; + m_Prefix_length = 0; + m_Prefix_lengthIsSet = false; + m_Terms = utility::conversions::to_string_t(""); + m_TermsIsSet = false; +} + +MatchQuery::~MatchQuery() +{ +} + +void MatchQuery::validate() +{ + // TODO: implement validation +} + +web::json::value MatchQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_BoostIsSet) + { + + val[utility::conversions::to_string_t(U("boost"))] = ModelBase::toJson(m_Boost); + } + if(m_ColumnIsSet) + { + + val[utility::conversions::to_string_t(U("column"))] = ModelBase::toJson(m_Column); + } + if(m_FuzzinessIsSet) + { + + val[utility::conversions::to_string_t(U("fuzziness"))] = ModelBase::toJson(m_Fuzziness); + } + if(m_Max_expansionsIsSet) + { + + val[utility::conversions::to_string_t(U("max_expansions"))] = ModelBase::toJson(m_Max_expansions); + } + if(m_r_operatorIsSet) + { + + val[utility::conversions::to_string_t(U("operator"))] = ModelBase::toJson(m_r_operator); + } + if(m_Prefix_lengthIsSet) + { + + val[utility::conversions::to_string_t(U("prefix_length"))] = ModelBase::toJson(m_Prefix_length); + } + if(m_TermsIsSet) + { + + val[utility::conversions::to_string_t(U("terms"))] = ModelBase::toJson(m_Terms); + } + + return val; +} + +bool MatchQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("boost")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("boost"))); + if(!fieldValue.is_null()) + { + float refVal_setBoost; + ok &= ModelBase::fromJson(fieldValue, refVal_setBoost); + setBoost(refVal_setBoost); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumn); + setColumn(refVal_setColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("fuzziness")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fuzziness"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setFuzziness; + ok &= ModelBase::fromJson(fieldValue, refVal_setFuzziness); + setFuzziness(refVal_setFuzziness); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("max_expansions")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("max_expansions"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setMaxExpansions; + ok &= ModelBase::fromJson(fieldValue, refVal_setMaxExpansions); + setMaxExpansions(refVal_setMaxExpansions); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("operator")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("operator"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setROperator; + ok &= ModelBase::fromJson(fieldValue, refVal_setROperator); + setROperator(refVal_setROperator); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("prefix_length")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("prefix_length"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setPrefixLength; + ok &= ModelBase::fromJson(fieldValue, refVal_setPrefixLength); + setPrefixLength(refVal_setPrefixLength); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("terms")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("terms"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTerms; + ok &= ModelBase::fromJson(fieldValue, refVal_setTerms); + setTerms(refVal_setTerms); + + } + } + return ok; +} + +void MatchQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_BoostIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boost")), m_Boost)); + } + if(m_ColumnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column")), m_Column)); + } + if(m_FuzzinessIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fuzziness")), m_Fuzziness)); + } + if(m_Max_expansionsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("max_expansions")), m_Max_expansions)); + } + if(m_r_operatorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("operator")), m_r_operator)); + } + if(m_Prefix_lengthIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("prefix_length")), m_Prefix_length)); + } + if(m_TermsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("terms")), m_Terms)); + } +} + +bool MatchQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("boost")))) + { + float refVal_setBoost; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boost"))), refVal_setBoost ); + setBoost(refVal_setBoost); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("column")))) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column"))), refVal_setColumn ); + setColumn(refVal_setColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("fuzziness")))) + { + int32_t refVal_setFuzziness; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fuzziness"))), refVal_setFuzziness ); + setFuzziness(refVal_setFuzziness); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("max_expansions")))) + { + int32_t refVal_setMaxExpansions; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("max_expansions"))), refVal_setMaxExpansions ); + setMaxExpansions(refVal_setMaxExpansions); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("operator")))) + { + utility::string_t refVal_setROperator; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("operator"))), refVal_setROperator ); + setROperator(refVal_setROperator); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("prefix_length")))) + { + int32_t refVal_setPrefixLength; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("prefix_length"))), refVal_setPrefixLength ); + setPrefixLength(refVal_setPrefixLength); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("terms")))) + { + utility::string_t refVal_setTerms; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("terms"))), refVal_setTerms ); + setTerms(refVal_setTerms); + } + return ok; +} + + +float MatchQuery::getBoost() const +{ + return m_Boost; +} + +void MatchQuery::setBoost(float value) +{ + m_Boost = value; + m_BoostIsSet = true; +} + +bool MatchQuery::boostIsSet() const +{ + return m_BoostIsSet; +} + +void MatchQuery::unsetBoost() +{ + m_BoostIsSet = false; +} +utility::string_t MatchQuery::getColumn() const +{ + return m_Column; +} + + +void MatchQuery::setColumn(const utility::string_t& value) +{ + m_Column = value; + m_ColumnIsSet = true; +} + +bool MatchQuery::columnIsSet() const +{ + return m_ColumnIsSet; +} + +void MatchQuery::unsetColumn() +{ + m_ColumnIsSet = false; +} +int32_t MatchQuery::getFuzziness() const +{ + return m_Fuzziness; +} + +void MatchQuery::setFuzziness(int32_t value) +{ + m_Fuzziness = value; + m_FuzzinessIsSet = true; +} + +bool MatchQuery::fuzzinessIsSet() const +{ + return m_FuzzinessIsSet; +} + +void MatchQuery::unsetFuzziness() +{ + m_FuzzinessIsSet = false; +} +int32_t MatchQuery::getMaxExpansions() const +{ + return m_Max_expansions; +} + +void MatchQuery::setMaxExpansions(int32_t value) +{ + m_Max_expansions = value; + m_Max_expansionsIsSet = true; +} + +bool MatchQuery::maxExpansionsIsSet() const +{ + return m_Max_expansionsIsSet; +} + +void MatchQuery::unsetMax_expansions() +{ + m_Max_expansionsIsSet = false; +} +utility::string_t MatchQuery::getROperator() const +{ + return m_r_operator; +} + + +void MatchQuery::setROperator(const utility::string_t& value) +{ + m_r_operator = value; + m_r_operatorIsSet = true; +} + +bool MatchQuery::rOperatorIsSet() const +{ + return m_r_operatorIsSet; +} + +void MatchQuery::unsetr_operator() +{ + m_r_operatorIsSet = false; +} +int32_t MatchQuery::getPrefixLength() const +{ + return m_Prefix_length; +} + +void MatchQuery::setPrefixLength(int32_t value) +{ + m_Prefix_length = value; + m_Prefix_lengthIsSet = true; +} + +bool MatchQuery::prefixLengthIsSet() const +{ + return m_Prefix_lengthIsSet; +} + +void MatchQuery::unsetPrefix_length() +{ + m_Prefix_lengthIsSet = false; +} +utility::string_t MatchQuery::getTerms() const +{ + return m_Terms; +} + + +void MatchQuery::setTerms(const utility::string_t& value) +{ + m_Terms = value; + m_TermsIsSet = true; +} + +bool MatchQuery::termsIsSet() const +{ + return m_TermsIsSet; +} + +void MatchQuery::unsetTerms() +{ + m_TermsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/MaterializedViewUdtfEntry.cpp b/cpp/lance_namespace_rest_client/src/model/MaterializedViewUdtfEntry.cpp new file mode 100644 index 000000000..b57415262 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/MaterializedViewUdtfEntry.cpp @@ -0,0 +1,833 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +MaterializedViewUdtfEntry::MaterializedViewUdtfEntry() +{ + m_KindIsSet = false; + m_Udtf = utility::conversions::to_string_t(""); + m_UdtfIsSet = false; + m_Udtf_sha = utility::conversions::to_string_t(""); + m_Udtf_shaIsSet = false; + m_Udtf_name = utility::conversions::to_string_t(""); + m_Udtf_nameIsSet = false; + m_Udtf_version = utility::conversions::to_string_t(""); + m_Udtf_versionIsSet = false; + m_Input_columnsIsSet = false; + m_Partition_by = utility::conversions::to_string_t(""); + m_Partition_byIsSet = false; + m_Partition_by_indexed_column = utility::conversions::to_string_t(""); + m_Partition_by_indexed_columnIsSet = false; + m_Num_cpus = 0.0; + m_Num_cpusIsSet = false; + m_Num_gpus = 0.0; + m_Num_gpusIsSet = false; + m_Memory = 0; + m_MemoryIsSet = false; + m_Error_handlingIsSet = false; + m_Batch = false; + m_BatchIsSet = false; + m_Manifest = utility::conversions::to_string_t(""); + m_ManifestIsSet = false; + m_Manifest_checksum = utility::conversions::to_string_t(""); + m_Manifest_checksumIsSet = false; +} + +MaterializedViewUdtfEntry::~MaterializedViewUdtfEntry() +{ +} + +void MaterializedViewUdtfEntry::validate() +{ + // TODO: implement validation +} + +web::json::value MaterializedViewUdtfEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_KindIsSet) + { + + utility::string_t refVal = fromKindEnum(m_Kind); + val[utility::conversions::to_string_t(U("kind"))] = ModelBase::toJson(refVal); + + } + if(m_UdtfIsSet) + { + + val[utility::conversions::to_string_t(U("udtf"))] = ModelBase::toJson(m_Udtf); + } + if(m_Udtf_shaIsSet) + { + + val[utility::conversions::to_string_t(U("udtf_sha"))] = ModelBase::toJson(m_Udtf_sha); + } + if(m_Udtf_nameIsSet) + { + + val[utility::conversions::to_string_t(U("udtf_name"))] = ModelBase::toJson(m_Udtf_name); + } + if(m_Udtf_versionIsSet) + { + + val[utility::conversions::to_string_t(U("udtf_version"))] = ModelBase::toJson(m_Udtf_version); + } + if(m_Input_columnsIsSet) + { + + val[utility::conversions::to_string_t(U("input_columns"))] = ModelBase::toJson(m_Input_columns); + } + if(m_Partition_byIsSet) + { + + val[utility::conversions::to_string_t(U("partition_by"))] = ModelBase::toJson(m_Partition_by); + } + if(m_Partition_by_indexed_columnIsSet) + { + + val[utility::conversions::to_string_t(U("partition_by_indexed_column"))] = ModelBase::toJson(m_Partition_by_indexed_column); + } + if(m_Num_cpusIsSet) + { + + val[utility::conversions::to_string_t(U("num_cpus"))] = ModelBase::toJson(m_Num_cpus); + } + if(m_Num_gpusIsSet) + { + + val[utility::conversions::to_string_t(U("num_gpus"))] = ModelBase::toJson(m_Num_gpus); + } + if(m_MemoryIsSet) + { + + val[utility::conversions::to_string_t(U("memory"))] = ModelBase::toJson(m_Memory); + } + if(m_Error_handlingIsSet) + { + + val[utility::conversions::to_string_t(U("error_handling"))] = ModelBase::toJson(m_Error_handling); + } + if(m_BatchIsSet) + { + + val[utility::conversions::to_string_t(U("batch"))] = ModelBase::toJson(m_Batch); + } + if(m_ManifestIsSet) + { + + val[utility::conversions::to_string_t(U("manifest"))] = ModelBase::toJson(m_Manifest); + } + if(m_Manifest_checksumIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_checksum"))] = ModelBase::toJson(m_Manifest_checksum); + } + + return val; +} + +bool MaterializedViewUdtfEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("kind")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("kind"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setKind; + ok &= ModelBase::fromJson(fieldValue, refVal_setKind); + + setKind(toKindEnum(refVal_setKind)); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udtf")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udtf"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdtf; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdtf); + setUdtf(refVal_setUdtf); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udtf_sha")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udtf_sha"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdtfSha; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdtfSha); + setUdtfSha(refVal_setUdtfSha); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udtf_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udtf_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdtfName; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdtfName); + setUdtfName(refVal_setUdtfName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("udtf_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("udtf_version"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setUdtfVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setUdtfVersion); + setUdtfVersion(refVal_setUdtfVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("input_columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("input_columns"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setInputColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setInputColumns); + setInputColumns(refVal_setInputColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("partition_by")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("partition_by"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPartitionBy; + ok &= ModelBase::fromJson(fieldValue, refVal_setPartitionBy); + setPartitionBy(refVal_setPartitionBy); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("partition_by_indexed_column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("partition_by_indexed_column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPartitionByIndexedColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setPartitionByIndexedColumn); + setPartitionByIndexedColumn(refVal_setPartitionByIndexedColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_cpus")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_cpus"))); + if(!fieldValue.is_null()) + { + double refVal_setNumCpus; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumCpus); + setNumCpus(refVal_setNumCpus); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_gpus")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_gpus"))); + if(!fieldValue.is_null()) + { + double refVal_setNumGpus; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumGpus); + setNumGpus(refVal_setNumGpus); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("memory")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("memory"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setMemory; + ok &= ModelBase::fromJson(fieldValue, refVal_setMemory); + setMemory(refVal_setMemory); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("error_handling")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("error_handling"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setErrorHandling; + ok &= ModelBase::fromJson(fieldValue, refVal_setErrorHandling); + setErrorHandling(refVal_setErrorHandling); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("batch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("batch"))); + if(!fieldValue.is_null()) + { + bool refVal_setBatch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBatch); + setBatch(refVal_setBatch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifest); + setManifest(refVal_setManifest); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_checksum")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_checksum"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifestChecksum; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestChecksum); + setManifestChecksum(refVal_setManifestChecksum); + + } + } + return ok; +} + +void MaterializedViewUdtfEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_KindIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("kind")), fromKindEnum(m_Kind))); + } + if(m_UdtfIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udtf")), m_Udtf)); + } + if(m_Udtf_shaIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udtf_sha")), m_Udtf_sha)); + } + if(m_Udtf_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udtf_name")), m_Udtf_name)); + } + if(m_Udtf_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("udtf_version")), m_Udtf_version)); + } + if(m_Input_columnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("input_columns")), m_Input_columns)); + } + if(m_Partition_byIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("partition_by")), m_Partition_by)); + } + if(m_Partition_by_indexed_columnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("partition_by_indexed_column")), m_Partition_by_indexed_column)); + } + if(m_Num_cpusIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_cpus")), m_Num_cpus)); + } + if(m_Num_gpusIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_gpus")), m_Num_gpus)); + } + if(m_MemoryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("memory")), m_Memory)); + } + if(m_Error_handlingIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("error_handling")), m_Error_handling)); + } + if(m_BatchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("batch")), m_Batch)); + } + if(m_ManifestIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest")), m_Manifest)); + } + if(m_Manifest_checksumIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_checksum")), m_Manifest_checksum)); + } +} + +bool MaterializedViewUdtfEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("kind")))) + { + utility::string_t refVal_setKind; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("kind"))), refVal_setKind ); + setKind(toKindEnum(refVal_setKind)); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udtf")))) + { + utility::string_t refVal_setUdtf; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udtf"))), refVal_setUdtf ); + setUdtf(refVal_setUdtf); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udtf_sha")))) + { + utility::string_t refVal_setUdtfSha; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udtf_sha"))), refVal_setUdtfSha ); + setUdtfSha(refVal_setUdtfSha); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udtf_name")))) + { + utility::string_t refVal_setUdtfName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udtf_name"))), refVal_setUdtfName ); + setUdtfName(refVal_setUdtfName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("udtf_version")))) + { + utility::string_t refVal_setUdtfVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("udtf_version"))), refVal_setUdtfVersion ); + setUdtfVersion(refVal_setUdtfVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("input_columns")))) + { + std::vector refVal_setInputColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("input_columns"))), refVal_setInputColumns ); + setInputColumns(refVal_setInputColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("partition_by")))) + { + utility::string_t refVal_setPartitionBy; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("partition_by"))), refVal_setPartitionBy ); + setPartitionBy(refVal_setPartitionBy); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("partition_by_indexed_column")))) + { + utility::string_t refVal_setPartitionByIndexedColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("partition_by_indexed_column"))), refVal_setPartitionByIndexedColumn ); + setPartitionByIndexedColumn(refVal_setPartitionByIndexedColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_cpus")))) + { + double refVal_setNumCpus; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_cpus"))), refVal_setNumCpus ); + setNumCpus(refVal_setNumCpus); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_gpus")))) + { + double refVal_setNumGpus; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_gpus"))), refVal_setNumGpus ); + setNumGpus(refVal_setNumGpus); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("memory")))) + { + int32_t refVal_setMemory; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("memory"))), refVal_setMemory ); + setMemory(refVal_setMemory); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("error_handling")))) + { + std::shared_ptr refVal_setErrorHandling; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("error_handling"))), refVal_setErrorHandling ); + setErrorHandling(refVal_setErrorHandling); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("batch")))) + { + bool refVal_setBatch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("batch"))), refVal_setBatch ); + setBatch(refVal_setBatch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest")))) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest"))), refVal_setManifest ); + setManifest(refVal_setManifest); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_checksum")))) + { + utility::string_t refVal_setManifestChecksum; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_checksum"))), refVal_setManifestChecksum ); + setManifestChecksum(refVal_setManifestChecksum); + } + return ok; +} + +MaterializedViewUdtfEntry::KindEnum MaterializedViewUdtfEntry::toKindEnum(const utility::string_t& value) const +{ + + if (value == utility::conversions::to_string_t("udtf")) { + return KindEnum::udtf; + } + + if (value == utility::conversions::to_string_t("chunker")) { + return KindEnum::chunker; + } + + throw std::invalid_argument("Invalid value for conversion to KindEnum"); +} + + +const utility::string_t MaterializedViewUdtfEntry::fromKindEnum(const KindEnum value) const +{ + switch(value) + { + + case KindEnum::udtf: return utility::conversions::to_string_t("udtf"); + + case KindEnum::chunker: return utility::conversions::to_string_t("chunker"); + + } +} + + +MaterializedViewUdtfEntry::KindEnum MaterializedViewUdtfEntry::getKind() const +{ + return m_Kind; +} + + +void MaterializedViewUdtfEntry::setKind(const KindEnum value) +{ + m_Kind = value; + m_KindIsSet = true; +} + +bool MaterializedViewUdtfEntry::kindIsSet() const +{ + return m_KindIsSet; +} + +void MaterializedViewUdtfEntry::unsetKind() +{ + m_KindIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getUdtf() const +{ + return m_Udtf; +} + + +void MaterializedViewUdtfEntry::setUdtf(const utility::string_t& value) +{ + m_Udtf = value; + m_UdtfIsSet = true; +} + +bool MaterializedViewUdtfEntry::udtfIsSet() const +{ + return m_UdtfIsSet; +} + +void MaterializedViewUdtfEntry::unsetUdtf() +{ + m_UdtfIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getUdtfSha() const +{ + return m_Udtf_sha; +} + + +void MaterializedViewUdtfEntry::setUdtfSha(const utility::string_t& value) +{ + m_Udtf_sha = value; + m_Udtf_shaIsSet = true; +} + +bool MaterializedViewUdtfEntry::udtfShaIsSet() const +{ + return m_Udtf_shaIsSet; +} + +void MaterializedViewUdtfEntry::unsetUdtf_sha() +{ + m_Udtf_shaIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getUdtfName() const +{ + return m_Udtf_name; +} + + +void MaterializedViewUdtfEntry::setUdtfName(const utility::string_t& value) +{ + m_Udtf_name = value; + m_Udtf_nameIsSet = true; +} + +bool MaterializedViewUdtfEntry::udtfNameIsSet() const +{ + return m_Udtf_nameIsSet; +} + +void MaterializedViewUdtfEntry::unsetUdtf_name() +{ + m_Udtf_nameIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getUdtfVersion() const +{ + return m_Udtf_version; +} + + +void MaterializedViewUdtfEntry::setUdtfVersion(const utility::string_t& value) +{ + m_Udtf_version = value; + m_Udtf_versionIsSet = true; +} + +bool MaterializedViewUdtfEntry::udtfVersionIsSet() const +{ + return m_Udtf_versionIsSet; +} + +void MaterializedViewUdtfEntry::unsetUdtf_version() +{ + m_Udtf_versionIsSet = false; +} +std::vector MaterializedViewUdtfEntry::getInputColumns() const +{ + return m_Input_columns; +} + + +void MaterializedViewUdtfEntry::setInputColumns(const std::vector& value) +{ + m_Input_columns = value; + m_Input_columnsIsSet = true; +} + +bool MaterializedViewUdtfEntry::inputColumnsIsSet() const +{ + return m_Input_columnsIsSet; +} + +void MaterializedViewUdtfEntry::unsetInput_columns() +{ + m_Input_columnsIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getPartitionBy() const +{ + return m_Partition_by; +} + + +void MaterializedViewUdtfEntry::setPartitionBy(const utility::string_t& value) +{ + m_Partition_by = value; + m_Partition_byIsSet = true; +} + +bool MaterializedViewUdtfEntry::partitionByIsSet() const +{ + return m_Partition_byIsSet; +} + +void MaterializedViewUdtfEntry::unsetPartition_by() +{ + m_Partition_byIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getPartitionByIndexedColumn() const +{ + return m_Partition_by_indexed_column; +} + + +void MaterializedViewUdtfEntry::setPartitionByIndexedColumn(const utility::string_t& value) +{ + m_Partition_by_indexed_column = value; + m_Partition_by_indexed_columnIsSet = true; +} + +bool MaterializedViewUdtfEntry::partitionByIndexedColumnIsSet() const +{ + return m_Partition_by_indexed_columnIsSet; +} + +void MaterializedViewUdtfEntry::unsetPartition_by_indexed_column() +{ + m_Partition_by_indexed_columnIsSet = false; +} +double MaterializedViewUdtfEntry::getNumCpus() const +{ + return m_Num_cpus; +} + +void MaterializedViewUdtfEntry::setNumCpus(double value) +{ + m_Num_cpus = value; + m_Num_cpusIsSet = true; +} + +bool MaterializedViewUdtfEntry::numCpusIsSet() const +{ + return m_Num_cpusIsSet; +} + +void MaterializedViewUdtfEntry::unsetNum_cpus() +{ + m_Num_cpusIsSet = false; +} +double MaterializedViewUdtfEntry::getNumGpus() const +{ + return m_Num_gpus; +} + +void MaterializedViewUdtfEntry::setNumGpus(double value) +{ + m_Num_gpus = value; + m_Num_gpusIsSet = true; +} + +bool MaterializedViewUdtfEntry::numGpusIsSet() const +{ + return m_Num_gpusIsSet; +} + +void MaterializedViewUdtfEntry::unsetNum_gpus() +{ + m_Num_gpusIsSet = false; +} +int32_t MaterializedViewUdtfEntry::getMemory() const +{ + return m_Memory; +} + +void MaterializedViewUdtfEntry::setMemory(int32_t value) +{ + m_Memory = value; + m_MemoryIsSet = true; +} + +bool MaterializedViewUdtfEntry::memoryIsSet() const +{ + return m_MemoryIsSet; +} + +void MaterializedViewUdtfEntry::unsetMemory() +{ + m_MemoryIsSet = false; +} +std::shared_ptr MaterializedViewUdtfEntry::getErrorHandling() const +{ + return m_Error_handling; +} + + +void MaterializedViewUdtfEntry::setErrorHandling(const std::shared_ptr& value) +{ + m_Error_handling = value; + m_Error_handlingIsSet = true; +} + +bool MaterializedViewUdtfEntry::errorHandlingIsSet() const +{ + return m_Error_handlingIsSet; +} + +void MaterializedViewUdtfEntry::unsetError_handling() +{ + m_Error_handlingIsSet = false; +} +bool MaterializedViewUdtfEntry::isBatch() const +{ + return m_Batch; +} + +void MaterializedViewUdtfEntry::setBatch(bool value) +{ + m_Batch = value; + m_BatchIsSet = true; +} + +bool MaterializedViewUdtfEntry::batchIsSet() const +{ + return m_BatchIsSet; +} + +void MaterializedViewUdtfEntry::unsetBatch() +{ + m_BatchIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getManifest() const +{ + return m_Manifest; +} + + +void MaterializedViewUdtfEntry::setManifest(const utility::string_t& value) +{ + m_Manifest = value; + m_ManifestIsSet = true; +} + +bool MaterializedViewUdtfEntry::manifestIsSet() const +{ + return m_ManifestIsSet; +} + +void MaterializedViewUdtfEntry::unsetManifest() +{ + m_ManifestIsSet = false; +} +utility::string_t MaterializedViewUdtfEntry::getManifestChecksum() const +{ + return m_Manifest_checksum; +} + + +void MaterializedViewUdtfEntry::setManifestChecksum(const utility::string_t& value) +{ + m_Manifest_checksum = value; + m_Manifest_checksumIsSet = true; +} + +bool MaterializedViewUdtfEntry::manifestChecksumIsSet() const +{ + return m_Manifest_checksumIsSet; +} + +void MaterializedViewUdtfEntry::unsetManifest_checksum() +{ + m_Manifest_checksumIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableRequest.cpp new file mode 100644 index 000000000..c4ad1b6f2 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableRequest.cpp @@ -0,0 +1,656 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/MergeInsertIntoTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +MergeInsertIntoTableRequest::MergeInsertIntoTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_On = utility::conversions::to_string_t(""); + m_OnIsSet = false; + m_When_matched_update_all = false; + m_When_matched_update_allIsSet = false; + m_When_matched_update_all_filt = utility::conversions::to_string_t(""); + m_When_matched_update_all_filtIsSet = false; + m_When_not_matched_insert_all = false; + m_When_not_matched_insert_allIsSet = false; + m_When_not_matched_by_source_delete = false; + m_When_not_matched_by_source_deleteIsSet = false; + m_When_not_matched_by_source_delete_filt = utility::conversions::to_string_t(""); + m_When_not_matched_by_source_delete_filtIsSet = false; + m_Timeout = utility::conversions::to_string_t(""); + m_TimeoutIsSet = false; + m_Use_index = false; + m_Use_indexIsSet = false; +} + +MergeInsertIntoTableRequest::~MergeInsertIntoTableRequest() +{ +} + +void MergeInsertIntoTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value MergeInsertIntoTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_OnIsSet) + { + + val[utility::conversions::to_string_t(U("on"))] = ModelBase::toJson(m_On); + } + if(m_When_matched_update_allIsSet) + { + + val[utility::conversions::to_string_t(U("when_matched_update_all"))] = ModelBase::toJson(m_When_matched_update_all); + } + if(m_When_matched_update_all_filtIsSet) + { + + val[utility::conversions::to_string_t(U("when_matched_update_all_filt"))] = ModelBase::toJson(m_When_matched_update_all_filt); + } + if(m_When_not_matched_insert_allIsSet) + { + + val[utility::conversions::to_string_t(U("when_not_matched_insert_all"))] = ModelBase::toJson(m_When_not_matched_insert_all); + } + if(m_When_not_matched_by_source_deleteIsSet) + { + + val[utility::conversions::to_string_t(U("when_not_matched_by_source_delete"))] = ModelBase::toJson(m_When_not_matched_by_source_delete); + } + if(m_When_not_matched_by_source_delete_filtIsSet) + { + + val[utility::conversions::to_string_t(U("when_not_matched_by_source_delete_filt"))] = ModelBase::toJson(m_When_not_matched_by_source_delete_filt); + } + if(m_TimeoutIsSet) + { + + val[utility::conversions::to_string_t(U("timeout"))] = ModelBase::toJson(m_Timeout); + } + if(m_Use_indexIsSet) + { + + val[utility::conversions::to_string_t(U("use_index"))] = ModelBase::toJson(m_Use_index); + } + + return val; +} + +bool MergeInsertIntoTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("on")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("on"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setOn; + ok &= ModelBase::fromJson(fieldValue, refVal_setOn); + setOn(refVal_setOn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("when_matched_update_all")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("when_matched_update_all"))); + if(!fieldValue.is_null()) + { + bool refVal_setWhenMatchedUpdateAll; + ok &= ModelBase::fromJson(fieldValue, refVal_setWhenMatchedUpdateAll); + setWhenMatchedUpdateAll(refVal_setWhenMatchedUpdateAll); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("when_matched_update_all_filt")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("when_matched_update_all_filt"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setWhenMatchedUpdateAllFilt; + ok &= ModelBase::fromJson(fieldValue, refVal_setWhenMatchedUpdateAllFilt); + setWhenMatchedUpdateAllFilt(refVal_setWhenMatchedUpdateAllFilt); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("when_not_matched_insert_all")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("when_not_matched_insert_all"))); + if(!fieldValue.is_null()) + { + bool refVal_setWhenNotMatchedInsertAll; + ok &= ModelBase::fromJson(fieldValue, refVal_setWhenNotMatchedInsertAll); + setWhenNotMatchedInsertAll(refVal_setWhenNotMatchedInsertAll); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("when_not_matched_by_source_delete")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("when_not_matched_by_source_delete"))); + if(!fieldValue.is_null()) + { + bool refVal_setWhenNotMatchedBySourceDelete; + ok &= ModelBase::fromJson(fieldValue, refVal_setWhenNotMatchedBySourceDelete); + setWhenNotMatchedBySourceDelete(refVal_setWhenNotMatchedBySourceDelete); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("when_not_matched_by_source_delete_filt")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("when_not_matched_by_source_delete_filt"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setWhenNotMatchedBySourceDeleteFilt; + ok &= ModelBase::fromJson(fieldValue, refVal_setWhenNotMatchedBySourceDeleteFilt); + setWhenNotMatchedBySourceDeleteFilt(refVal_setWhenNotMatchedBySourceDeleteFilt); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("timeout")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("timeout"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTimeout; + ok &= ModelBase::fromJson(fieldValue, refVal_setTimeout); + setTimeout(refVal_setTimeout); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("use_index")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("use_index"))); + if(!fieldValue.is_null()) + { + bool refVal_setUseIndex; + ok &= ModelBase::fromJson(fieldValue, refVal_setUseIndex); + setUseIndex(refVal_setUseIndex); + + } + } + return ok; +} + +void MergeInsertIntoTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_OnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("on")), m_On)); + } + if(m_When_matched_update_allIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("when_matched_update_all")), m_When_matched_update_all)); + } + if(m_When_matched_update_all_filtIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("when_matched_update_all_filt")), m_When_matched_update_all_filt)); + } + if(m_When_not_matched_insert_allIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("when_not_matched_insert_all")), m_When_not_matched_insert_all)); + } + if(m_When_not_matched_by_source_deleteIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("when_not_matched_by_source_delete")), m_When_not_matched_by_source_delete)); + } + if(m_When_not_matched_by_source_delete_filtIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("when_not_matched_by_source_delete_filt")), m_When_not_matched_by_source_delete_filt)); + } + if(m_TimeoutIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("timeout")), m_Timeout)); + } + if(m_Use_indexIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("use_index")), m_Use_index)); + } +} + +bool MergeInsertIntoTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("on")))) + { + utility::string_t refVal_setOn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("on"))), refVal_setOn ); + setOn(refVal_setOn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("when_matched_update_all")))) + { + bool refVal_setWhenMatchedUpdateAll; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("when_matched_update_all"))), refVal_setWhenMatchedUpdateAll ); + setWhenMatchedUpdateAll(refVal_setWhenMatchedUpdateAll); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("when_matched_update_all_filt")))) + { + utility::string_t refVal_setWhenMatchedUpdateAllFilt; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("when_matched_update_all_filt"))), refVal_setWhenMatchedUpdateAllFilt ); + setWhenMatchedUpdateAllFilt(refVal_setWhenMatchedUpdateAllFilt); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("when_not_matched_insert_all")))) + { + bool refVal_setWhenNotMatchedInsertAll; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("when_not_matched_insert_all"))), refVal_setWhenNotMatchedInsertAll ); + setWhenNotMatchedInsertAll(refVal_setWhenNotMatchedInsertAll); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("when_not_matched_by_source_delete")))) + { + bool refVal_setWhenNotMatchedBySourceDelete; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("when_not_matched_by_source_delete"))), refVal_setWhenNotMatchedBySourceDelete ); + setWhenNotMatchedBySourceDelete(refVal_setWhenNotMatchedBySourceDelete); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("when_not_matched_by_source_delete_filt")))) + { + utility::string_t refVal_setWhenNotMatchedBySourceDeleteFilt; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("when_not_matched_by_source_delete_filt"))), refVal_setWhenNotMatchedBySourceDeleteFilt ); + setWhenNotMatchedBySourceDeleteFilt(refVal_setWhenNotMatchedBySourceDeleteFilt); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("timeout")))) + { + utility::string_t refVal_setTimeout; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("timeout"))), refVal_setTimeout ); + setTimeout(refVal_setTimeout); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("use_index")))) + { + bool refVal_setUseIndex; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("use_index"))), refVal_setUseIndex ); + setUseIndex(refVal_setUseIndex); + } + return ok; +} + + +std::shared_ptr MergeInsertIntoTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void MergeInsertIntoTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool MergeInsertIntoTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void MergeInsertIntoTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map MergeInsertIntoTableRequest::getContext() const +{ + return m_Context; +} + + +void MergeInsertIntoTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool MergeInsertIntoTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void MergeInsertIntoTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector MergeInsertIntoTableRequest::getId() const +{ + return m_Id; +} + + +void MergeInsertIntoTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool MergeInsertIntoTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void MergeInsertIntoTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t MergeInsertIntoTableRequest::getBranch() const +{ + return m_Branch; +} + + +void MergeInsertIntoTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool MergeInsertIntoTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void MergeInsertIntoTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t MergeInsertIntoTableRequest::getOn() const +{ + return m_On; +} + + +void MergeInsertIntoTableRequest::setOn(const utility::string_t& value) +{ + m_On = value; + m_OnIsSet = true; +} + +bool MergeInsertIntoTableRequest::onIsSet() const +{ + return m_OnIsSet; +} + +void MergeInsertIntoTableRequest::unsetOn() +{ + m_OnIsSet = false; +} +bool MergeInsertIntoTableRequest::isWhenMatchedUpdateAll() const +{ + return m_When_matched_update_all; +} + +void MergeInsertIntoTableRequest::setWhenMatchedUpdateAll(bool value) +{ + m_When_matched_update_all = value; + m_When_matched_update_allIsSet = true; +} + +bool MergeInsertIntoTableRequest::whenMatchedUpdateAllIsSet() const +{ + return m_When_matched_update_allIsSet; +} + +void MergeInsertIntoTableRequest::unsetWhen_matched_update_all() +{ + m_When_matched_update_allIsSet = false; +} +utility::string_t MergeInsertIntoTableRequest::getWhenMatchedUpdateAllFilt() const +{ + return m_When_matched_update_all_filt; +} + + +void MergeInsertIntoTableRequest::setWhenMatchedUpdateAllFilt(const utility::string_t& value) +{ + m_When_matched_update_all_filt = value; + m_When_matched_update_all_filtIsSet = true; +} + +bool MergeInsertIntoTableRequest::whenMatchedUpdateAllFiltIsSet() const +{ + return m_When_matched_update_all_filtIsSet; +} + +void MergeInsertIntoTableRequest::unsetWhen_matched_update_all_filt() +{ + m_When_matched_update_all_filtIsSet = false; +} +bool MergeInsertIntoTableRequest::isWhenNotMatchedInsertAll() const +{ + return m_When_not_matched_insert_all; +} + +void MergeInsertIntoTableRequest::setWhenNotMatchedInsertAll(bool value) +{ + m_When_not_matched_insert_all = value; + m_When_not_matched_insert_allIsSet = true; +} + +bool MergeInsertIntoTableRequest::whenNotMatchedInsertAllIsSet() const +{ + return m_When_not_matched_insert_allIsSet; +} + +void MergeInsertIntoTableRequest::unsetWhen_not_matched_insert_all() +{ + m_When_not_matched_insert_allIsSet = false; +} +bool MergeInsertIntoTableRequest::isWhenNotMatchedBySourceDelete() const +{ + return m_When_not_matched_by_source_delete; +} + +void MergeInsertIntoTableRequest::setWhenNotMatchedBySourceDelete(bool value) +{ + m_When_not_matched_by_source_delete = value; + m_When_not_matched_by_source_deleteIsSet = true; +} + +bool MergeInsertIntoTableRequest::whenNotMatchedBySourceDeleteIsSet() const +{ + return m_When_not_matched_by_source_deleteIsSet; +} + +void MergeInsertIntoTableRequest::unsetWhen_not_matched_by_source_delete() +{ + m_When_not_matched_by_source_deleteIsSet = false; +} +utility::string_t MergeInsertIntoTableRequest::getWhenNotMatchedBySourceDeleteFilt() const +{ + return m_When_not_matched_by_source_delete_filt; +} + + +void MergeInsertIntoTableRequest::setWhenNotMatchedBySourceDeleteFilt(const utility::string_t& value) +{ + m_When_not_matched_by_source_delete_filt = value; + m_When_not_matched_by_source_delete_filtIsSet = true; +} + +bool MergeInsertIntoTableRequest::whenNotMatchedBySourceDeleteFiltIsSet() const +{ + return m_When_not_matched_by_source_delete_filtIsSet; +} + +void MergeInsertIntoTableRequest::unsetWhen_not_matched_by_source_delete_filt() +{ + m_When_not_matched_by_source_delete_filtIsSet = false; +} +utility::string_t MergeInsertIntoTableRequest::getTimeout() const +{ + return m_Timeout; +} + + +void MergeInsertIntoTableRequest::setTimeout(const utility::string_t& value) +{ + m_Timeout = value; + m_TimeoutIsSet = true; +} + +bool MergeInsertIntoTableRequest::timeoutIsSet() const +{ + return m_TimeoutIsSet; +} + +void MergeInsertIntoTableRequest::unsetTimeout() +{ + m_TimeoutIsSet = false; +} +bool MergeInsertIntoTableRequest::isUseIndex() const +{ + return m_Use_index; +} + +void MergeInsertIntoTableRequest::setUseIndex(bool value) +{ + m_Use_index = value; + m_Use_indexIsSet = true; +} + +bool MergeInsertIntoTableRequest::useIndexIsSet() const +{ + return m_Use_indexIsSet; +} + +void MergeInsertIntoTableRequest::unsetUse_index() +{ + m_Use_indexIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableResponse.cpp new file mode 100644 index 000000000..d20cea850 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/MergeInsertIntoTableResponse.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/MergeInsertIntoTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +MergeInsertIntoTableResponse::MergeInsertIntoTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Num_updated_rows = 0L; + m_Num_updated_rowsIsSet = false; + m_Num_inserted_rows = 0L; + m_Num_inserted_rowsIsSet = false; + m_Num_deleted_rows = 0L; + m_Num_deleted_rowsIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; +} + +MergeInsertIntoTableResponse::~MergeInsertIntoTableResponse() +{ +} + +void MergeInsertIntoTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value MergeInsertIntoTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_Num_updated_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_updated_rows"))] = ModelBase::toJson(m_Num_updated_rows); + } + if(m_Num_inserted_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_inserted_rows"))] = ModelBase::toJson(m_Num_inserted_rows); + } + if(m_Num_deleted_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_deleted_rows"))] = ModelBase::toJson(m_Num_deleted_rows); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool MergeInsertIntoTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_updated_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_updated_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumUpdatedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumUpdatedRows); + setNumUpdatedRows(refVal_setNumUpdatedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_inserted_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_inserted_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumInsertedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumInsertedRows); + setNumInsertedRows(refVal_setNumInsertedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_deleted_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_deleted_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setNumDeletedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumDeletedRows); + setNumDeletedRows(refVal_setNumDeletedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void MergeInsertIntoTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_Num_updated_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_updated_rows")), m_Num_updated_rows)); + } + if(m_Num_inserted_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_inserted_rows")), m_Num_inserted_rows)); + } + if(m_Num_deleted_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_deleted_rows")), m_Num_deleted_rows)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool MergeInsertIntoTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_updated_rows")))) + { + int64_t refVal_setNumUpdatedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_updated_rows"))), refVal_setNumUpdatedRows ); + setNumUpdatedRows(refVal_setNumUpdatedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_inserted_rows")))) + { + int64_t refVal_setNumInsertedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_inserted_rows"))), refVal_setNumInsertedRows ); + setNumInsertedRows(refVal_setNumInsertedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_deleted_rows")))) + { + int64_t refVal_setNumDeletedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_deleted_rows"))), refVal_setNumDeletedRows ); + setNumDeletedRows(refVal_setNumDeletedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +utility::string_t MergeInsertIntoTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void MergeInsertIntoTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool MergeInsertIntoTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void MergeInsertIntoTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +int64_t MergeInsertIntoTableResponse::getNumUpdatedRows() const +{ + return m_Num_updated_rows; +} + +void MergeInsertIntoTableResponse::setNumUpdatedRows(int64_t value) +{ + m_Num_updated_rows = value; + m_Num_updated_rowsIsSet = true; +} + +bool MergeInsertIntoTableResponse::numUpdatedRowsIsSet() const +{ + return m_Num_updated_rowsIsSet; +} + +void MergeInsertIntoTableResponse::unsetNum_updated_rows() +{ + m_Num_updated_rowsIsSet = false; +} +int64_t MergeInsertIntoTableResponse::getNumInsertedRows() const +{ + return m_Num_inserted_rows; +} + +void MergeInsertIntoTableResponse::setNumInsertedRows(int64_t value) +{ + m_Num_inserted_rows = value; + m_Num_inserted_rowsIsSet = true; +} + +bool MergeInsertIntoTableResponse::numInsertedRowsIsSet() const +{ + return m_Num_inserted_rowsIsSet; +} + +void MergeInsertIntoTableResponse::unsetNum_inserted_rows() +{ + m_Num_inserted_rowsIsSet = false; +} +int64_t MergeInsertIntoTableResponse::getNumDeletedRows() const +{ + return m_Num_deleted_rows; +} + +void MergeInsertIntoTableResponse::setNumDeletedRows(int64_t value) +{ + m_Num_deleted_rows = value; + m_Num_deleted_rowsIsSet = true; +} + +bool MergeInsertIntoTableResponse::numDeletedRowsIsSet() const +{ + return m_Num_deleted_rowsIsSet; +} + +void MergeInsertIntoTableResponse::unsetNum_deleted_rows() +{ + m_Num_deleted_rowsIsSet = false; +} +int64_t MergeInsertIntoTableResponse::getVersion() const +{ + return m_Version; +} + +void MergeInsertIntoTableResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool MergeInsertIntoTableResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void MergeInsertIntoTableResponse::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/MultiMatchQuery.cpp b/cpp/lance_namespace_rest_client/src/model/MultiMatchQuery.cpp new file mode 100644 index 000000000..00aaacf67 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/MultiMatchQuery.cpp @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/MultiMatchQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +MultiMatchQuery::MultiMatchQuery() +{ + m_Match_queriesIsSet = false; +} + +MultiMatchQuery::~MultiMatchQuery() +{ +} + +void MultiMatchQuery::validate() +{ + // TODO: implement validation +} + +web::json::value MultiMatchQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Match_queriesIsSet) + { + + val[utility::conversions::to_string_t(U("match_queries"))] = ModelBase::toJson(m_Match_queries); + } + + return val; +} + +bool MultiMatchQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("match_queries")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("match_queries"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setMatchQueries; + ok &= ModelBase::fromJson(fieldValue, refVal_setMatchQueries); + setMatchQueries(refVal_setMatchQueries); + + } + } + return ok; +} + +void MultiMatchQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Match_queriesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("match_queries")), m_Match_queries)); + } +} + +bool MultiMatchQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("match_queries")))) + { + std::vector> refVal_setMatchQueries; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("match_queries"))), refVal_setMatchQueries ); + setMatchQueries(refVal_setMatchQueries); + } + return ok; +} + + +std::vector> MultiMatchQuery::getMatchQueries() const +{ + return m_Match_queries; +} + + +void MultiMatchQuery::setMatchQueries(const std::vector>& value) +{ + m_Match_queries = value; + m_Match_queriesIsSet = true; +} + +bool MultiMatchQuery::matchQueriesIsSet() const +{ + return m_Match_queriesIsSet; +} + +void MultiMatchQuery::unsetMatch_queries() +{ + m_Match_queriesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/NamespaceExistsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/NamespaceExistsRequest.cpp new file mode 100644 index 000000000..96bf8ea71 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/NamespaceExistsRequest.cpp @@ -0,0 +1,219 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/NamespaceExistsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +NamespaceExistsRequest::NamespaceExistsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; +} + +NamespaceExistsRequest::~NamespaceExistsRequest() +{ +} + +void NamespaceExistsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value NamespaceExistsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + + return val; +} + +bool NamespaceExistsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + return ok; +} + +void NamespaceExistsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } +} + +bool NamespaceExistsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + return ok; +} + + +std::shared_ptr NamespaceExistsRequest::getIdentity() const +{ + return m_Identity; +} + + +void NamespaceExistsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool NamespaceExistsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void NamespaceExistsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map NamespaceExistsRequest::getContext() const +{ + return m_Context; +} + + +void NamespaceExistsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool NamespaceExistsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void NamespaceExistsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector NamespaceExistsRequest::getId() const +{ + return m_Id; +} + + +void NamespaceExistsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool NamespaceExistsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void NamespaceExistsRequest::unsetId() +{ + m_IdIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/PartitionField.cpp b/cpp/lance_namespace_rest_client/src/model/PartitionField.cpp new file mode 100644 index 000000000..727f3d064 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/PartitionField.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/PartitionField.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +PartitionField::PartitionField() +{ + m_Field_id = utility::conversions::to_string_t(""); + m_Field_idIsSet = false; + m_Source_idsIsSet = false; + m_TransformIsSet = false; + m_Expression = utility::conversions::to_string_t(""); + m_ExpressionIsSet = false; + m_Result_typeIsSet = false; +} + +PartitionField::~PartitionField() +{ +} + +void PartitionField::validate() +{ + // TODO: implement validation +} + +web::json::value PartitionField::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Field_idIsSet) + { + + val[utility::conversions::to_string_t(U("field_id"))] = ModelBase::toJson(m_Field_id); + } + if(m_Source_idsIsSet) + { + + val[utility::conversions::to_string_t(U("source_ids"))] = ModelBase::toJson(m_Source_ids); + } + if(m_TransformIsSet) + { + + val[utility::conversions::to_string_t(U("transform"))] = ModelBase::toJson(m_Transform); + } + if(m_ExpressionIsSet) + { + + val[utility::conversions::to_string_t(U("expression"))] = ModelBase::toJson(m_Expression); + } + if(m_Result_typeIsSet) + { + + val[utility::conversions::to_string_t(U("result_type"))] = ModelBase::toJson(m_Result_type); + } + + return val; +} + +bool PartitionField::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("field_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("field_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setFieldId; + ok &= ModelBase::fromJson(fieldValue, refVal_setFieldId); + setFieldId(refVal_setFieldId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("source_ids")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("source_ids"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setSourceIds; + ok &= ModelBase::fromJson(fieldValue, refVal_setSourceIds); + setSourceIds(refVal_setSourceIds); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("transform")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transform"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setTransform; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransform); + setTransform(refVal_setTransform); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("expression")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("expression"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setExpression; + ok &= ModelBase::fromJson(fieldValue, refVal_setExpression); + setExpression(refVal_setExpression); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("result_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("result_type"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setResultType; + ok &= ModelBase::fromJson(fieldValue, refVal_setResultType); + setResultType(refVal_setResultType); + + } + } + return ok; +} + +void PartitionField::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Field_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("field_id")), m_Field_id)); + } + if(m_Source_idsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("source_ids")), m_Source_ids)); + } + if(m_TransformIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transform")), m_Transform)); + } + if(m_ExpressionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("expression")), m_Expression)); + } + if(m_Result_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("result_type")), m_Result_type)); + } +} + +bool PartitionField::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("field_id")))) + { + utility::string_t refVal_setFieldId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("field_id"))), refVal_setFieldId ); + setFieldId(refVal_setFieldId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("source_ids")))) + { + std::vector refVal_setSourceIds; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("source_ids"))), refVal_setSourceIds ); + setSourceIds(refVal_setSourceIds); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("transform")))) + { + std::shared_ptr refVal_setTransform; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transform"))), refVal_setTransform ); + setTransform(refVal_setTransform); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("expression")))) + { + utility::string_t refVal_setExpression; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("expression"))), refVal_setExpression ); + setExpression(refVal_setExpression); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("result_type")))) + { + std::shared_ptr refVal_setResultType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("result_type"))), refVal_setResultType ); + setResultType(refVal_setResultType); + } + return ok; +} + + +utility::string_t PartitionField::getFieldId() const +{ + return m_Field_id; +} + + +void PartitionField::setFieldId(const utility::string_t& value) +{ + m_Field_id = value; + m_Field_idIsSet = true; +} + +bool PartitionField::fieldIdIsSet() const +{ + return m_Field_idIsSet; +} + +void PartitionField::unsetField_id() +{ + m_Field_idIsSet = false; +} +std::vector PartitionField::getSourceIds() const +{ + return m_Source_ids; +} + +void PartitionField::setSourceIds(std::vector value) +{ + m_Source_ids = value; + m_Source_idsIsSet = true; +} + +bool PartitionField::sourceIdsIsSet() const +{ + return m_Source_idsIsSet; +} + +void PartitionField::unsetSource_ids() +{ + m_Source_idsIsSet = false; +} +std::shared_ptr PartitionField::getTransform() const +{ + return m_Transform; +} + + +void PartitionField::setTransform(const std::shared_ptr& value) +{ + m_Transform = value; + m_TransformIsSet = true; +} + +bool PartitionField::transformIsSet() const +{ + return m_TransformIsSet; +} + +void PartitionField::unsetTransform() +{ + m_TransformIsSet = false; +} +utility::string_t PartitionField::getExpression() const +{ + return m_Expression; +} + + +void PartitionField::setExpression(const utility::string_t& value) +{ + m_Expression = value; + m_ExpressionIsSet = true; +} + +bool PartitionField::expressionIsSet() const +{ + return m_ExpressionIsSet; +} + +void PartitionField::unsetExpression() +{ + m_ExpressionIsSet = false; +} +std::shared_ptr PartitionField::getResultType() const +{ + return m_Result_type; +} + + +void PartitionField::setResultType(const std::shared_ptr& value) +{ + m_Result_type = value; + m_Result_typeIsSet = true; +} + +bool PartitionField::resultTypeIsSet() const +{ + return m_Result_typeIsSet; +} + +void PartitionField::unsetResult_type() +{ + m_Result_typeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/PartitionSpec.cpp b/cpp/lance_namespace_rest_client/src/model/PartitionSpec.cpp new file mode 100644 index 000000000..43dbbe4cf --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/PartitionSpec.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/PartitionSpec.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +PartitionSpec::PartitionSpec() +{ + m_Id = 0; + m_IdIsSet = false; + m_FieldsIsSet = false; +} + +PartitionSpec::~PartitionSpec() +{ +} + +void PartitionSpec::validate() +{ + // TODO: implement validation +} + +web::json::value PartitionSpec::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_FieldsIsSet) + { + + val[utility::conversions::to_string_t(U("fields"))] = ModelBase::toJson(m_Fields); + } + + return val; +} + +bool PartitionSpec::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("fields")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fields"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setFields; + ok &= ModelBase::fromJson(fieldValue, refVal_setFields); + setFields(refVal_setFields); + + } + } + return ok; +} + +void PartitionSpec::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_FieldsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fields")), m_Fields)); + } +} + +bool PartitionSpec::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + int32_t refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("fields")))) + { + std::vector> refVal_setFields; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fields"))), refVal_setFields ); + setFields(refVal_setFields); + } + return ok; +} + + +int32_t PartitionSpec::getId() const +{ + return m_Id; +} + +void PartitionSpec::setId(int32_t value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool PartitionSpec::idIsSet() const +{ + return m_IdIsSet; +} + +void PartitionSpec::unsetId() +{ + m_IdIsSet = false; +} +std::vector> PartitionSpec::getFields() const +{ + return m_Fields; +} + + +void PartitionSpec::setFields(const std::vector>& value) +{ + m_Fields = value; + m_FieldsIsSet = true; +} + +bool PartitionSpec::fieldsIsSet() const +{ + return m_FieldsIsSet; +} + +void PartitionSpec::unsetFields() +{ + m_FieldsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/PartitionTransform.cpp b/cpp/lance_namespace_rest_client/src/model/PartitionTransform.cpp new file mode 100644 index 000000000..db204641e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/PartitionTransform.cpp @@ -0,0 +1,220 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/PartitionTransform.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +PartitionTransform::PartitionTransform() +{ + m_Type = utility::conversions::to_string_t(""); + m_TypeIsSet = false; + m_Num_buckets = 0; + m_Num_bucketsIsSet = false; + m_Width = 0; + m_WidthIsSet = false; +} + +PartitionTransform::~PartitionTransform() +{ +} + +void PartitionTransform::validate() +{ + // TODO: implement validation +} + +web::json::value PartitionTransform::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_TypeIsSet) + { + + val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type); + } + if(m_Num_bucketsIsSet) + { + + val[utility::conversions::to_string_t(U("num_buckets"))] = ModelBase::toJson(m_Num_buckets); + } + if(m_WidthIsSet) + { + + val[utility::conversions::to_string_t(U("width"))] = ModelBase::toJson(m_Width); + } + + return val; +} + +bool PartitionTransform::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setType; + ok &= ModelBase::fromJson(fieldValue, refVal_setType); + setType(refVal_setType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_buckets")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_buckets"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNumBuckets; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumBuckets); + setNumBuckets(refVal_setNumBuckets); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("width")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("width"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setWidth; + ok &= ModelBase::fromJson(fieldValue, refVal_setWidth); + setWidth(refVal_setWidth); + + } + } + return ok; +} + +void PartitionTransform::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_TypeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type)); + } + if(m_Num_bucketsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_buckets")), m_Num_buckets)); + } + if(m_WidthIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("width")), m_Width)); + } +} + +bool PartitionTransform::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) + { + utility::string_t refVal_setType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType ); + setType(refVal_setType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_buckets")))) + { + int32_t refVal_setNumBuckets; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_buckets"))), refVal_setNumBuckets ); + setNumBuckets(refVal_setNumBuckets); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("width")))) + { + int32_t refVal_setWidth; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("width"))), refVal_setWidth ); + setWidth(refVal_setWidth); + } + return ok; +} + + +utility::string_t PartitionTransform::getType() const +{ + return m_Type; +} + + +void PartitionTransform::setType(const utility::string_t& value) +{ + m_Type = value; + m_TypeIsSet = true; +} + +bool PartitionTransform::typeIsSet() const +{ + return m_TypeIsSet; +} + +void PartitionTransform::unsetType() +{ + m_TypeIsSet = false; +} +int32_t PartitionTransform::getNumBuckets() const +{ + return m_Num_buckets; +} + +void PartitionTransform::setNumBuckets(int32_t value) +{ + m_Num_buckets = value; + m_Num_bucketsIsSet = true; +} + +bool PartitionTransform::numBucketsIsSet() const +{ + return m_Num_bucketsIsSet; +} + +void PartitionTransform::unsetNum_buckets() +{ + m_Num_bucketsIsSet = false; +} +int32_t PartitionTransform::getWidth() const +{ + return m_Width; +} + +void PartitionTransform::setWidth(int32_t value) +{ + m_Width = value; + m_WidthIsSet = true; +} + +bool PartitionTransform::widthIsSet() const +{ + return m_WidthIsSet; +} + +void PartitionTransform::unsetWidth() +{ + m_WidthIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/PhraseQuery.cpp b/cpp/lance_namespace_rest_client/src/model/PhraseQuery.cpp new file mode 100644 index 000000000..857472d2a --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/PhraseQuery.cpp @@ -0,0 +1,221 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/PhraseQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +PhraseQuery::PhraseQuery() +{ + m_Column = utility::conversions::to_string_t(""); + m_ColumnIsSet = false; + m_Slop = 0; + m_SlopIsSet = false; + m_Terms = utility::conversions::to_string_t(""); + m_TermsIsSet = false; +} + +PhraseQuery::~PhraseQuery() +{ +} + +void PhraseQuery::validate() +{ + // TODO: implement validation +} + +web::json::value PhraseQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_ColumnIsSet) + { + + val[utility::conversions::to_string_t(U("column"))] = ModelBase::toJson(m_Column); + } + if(m_SlopIsSet) + { + + val[utility::conversions::to_string_t(U("slop"))] = ModelBase::toJson(m_Slop); + } + if(m_TermsIsSet) + { + + val[utility::conversions::to_string_t(U("terms"))] = ModelBase::toJson(m_Terms); + } + + return val; +} + +bool PhraseQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumn); + setColumn(refVal_setColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("slop")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("slop"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setSlop; + ok &= ModelBase::fromJson(fieldValue, refVal_setSlop); + setSlop(refVal_setSlop); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("terms")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("terms"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTerms; + ok &= ModelBase::fromJson(fieldValue, refVal_setTerms); + setTerms(refVal_setTerms); + + } + } + return ok; +} + +void PhraseQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_ColumnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column")), m_Column)); + } + if(m_SlopIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("slop")), m_Slop)); + } + if(m_TermsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("terms")), m_Terms)); + } +} + +bool PhraseQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("column")))) + { + utility::string_t refVal_setColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column"))), refVal_setColumn ); + setColumn(refVal_setColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("slop")))) + { + int32_t refVal_setSlop; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("slop"))), refVal_setSlop ); + setSlop(refVal_setSlop); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("terms")))) + { + utility::string_t refVal_setTerms; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("terms"))), refVal_setTerms ); + setTerms(refVal_setTerms); + } + return ok; +} + + +utility::string_t PhraseQuery::getColumn() const +{ + return m_Column; +} + + +void PhraseQuery::setColumn(const utility::string_t& value) +{ + m_Column = value; + m_ColumnIsSet = true; +} + +bool PhraseQuery::columnIsSet() const +{ + return m_ColumnIsSet; +} + +void PhraseQuery::unsetColumn() +{ + m_ColumnIsSet = false; +} +int32_t PhraseQuery::getSlop() const +{ + return m_Slop; +} + +void PhraseQuery::setSlop(int32_t value) +{ + m_Slop = value; + m_SlopIsSet = true; +} + +bool PhraseQuery::slopIsSet() const +{ + return m_SlopIsSet; +} + +void PhraseQuery::unsetSlop() +{ + m_SlopIsSet = false; +} +utility::string_t PhraseQuery::getTerms() const +{ + return m_Terms; +} + + +void PhraseQuery::setTerms(const utility::string_t& value) +{ + m_Terms = value; + m_TermsIsSet = true; +} + +bool PhraseQuery::termsIsSet() const +{ + return m_TermsIsSet; +} + +void PhraseQuery::unsetTerms() +{ + m_TermsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/QueryTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest.cpp new file mode 100644 index 000000000..764ebc925 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest.cpp @@ -0,0 +1,1135 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/QueryTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +QueryTableRequest::QueryTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Bypass_vector_index = false; + m_Bypass_vector_indexIsSet = false; + m_ColumnsIsSet = false; + m_Distance_type = utility::conversions::to_string_t(""); + m_Distance_typeIsSet = false; + m_Ef = 0; + m_EfIsSet = false; + m_Fast_search = false; + m_Fast_searchIsSet = false; + m_Filter = utility::conversions::to_string_t(""); + m_FilterIsSet = false; + m_Full_text_queryIsSet = false; + m_k = 0; + m_kIsSet = false; + m_Lower_bound = 0.0f; + m_Lower_boundIsSet = false; + m_Nprobes = 0; + m_NprobesIsSet = false; + m_Offset = 0; + m_OffsetIsSet = false; + m_Prefilter = false; + m_PrefilterIsSet = false; + m_Refine_factor = 0; + m_Refine_factorIsSet = false; + m_Upper_bound = 0.0f; + m_Upper_boundIsSet = false; + m_VectorIsSet = false; + m_Vector_column = utility::conversions::to_string_t(""); + m_Vector_columnIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_With_row_id = false; + m_With_row_idIsSet = false; +} + +QueryTableRequest::~QueryTableRequest() +{ +} + +void QueryTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value QueryTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_Bypass_vector_indexIsSet) + { + + val[utility::conversions::to_string_t(U("bypass_vector_index"))] = ModelBase::toJson(m_Bypass_vector_index); + } + if(m_ColumnsIsSet) + { + + val[utility::conversions::to_string_t(U("columns"))] = ModelBase::toJson(m_Columns); + } + if(m_Distance_typeIsSet) + { + + val[utility::conversions::to_string_t(U("distance_type"))] = ModelBase::toJson(m_Distance_type); + } + if(m_EfIsSet) + { + + val[utility::conversions::to_string_t(U("ef"))] = ModelBase::toJson(m_Ef); + } + if(m_Fast_searchIsSet) + { + + val[utility::conversions::to_string_t(U("fast_search"))] = ModelBase::toJson(m_Fast_search); + } + if(m_FilterIsSet) + { + + val[utility::conversions::to_string_t(U("filter"))] = ModelBase::toJson(m_Filter); + } + if(m_Full_text_queryIsSet) + { + + val[utility::conversions::to_string_t(U("full_text_query"))] = ModelBase::toJson(m_Full_text_query); + } + if(m_kIsSet) + { + + val[utility::conversions::to_string_t(U("k"))] = ModelBase::toJson(m_k); + } + if(m_Lower_boundIsSet) + { + + val[utility::conversions::to_string_t(U("lower_bound"))] = ModelBase::toJson(m_Lower_bound); + } + if(m_NprobesIsSet) + { + + val[utility::conversions::to_string_t(U("nprobes"))] = ModelBase::toJson(m_Nprobes); + } + if(m_OffsetIsSet) + { + + val[utility::conversions::to_string_t(U("offset"))] = ModelBase::toJson(m_Offset); + } + if(m_PrefilterIsSet) + { + + val[utility::conversions::to_string_t(U("prefilter"))] = ModelBase::toJson(m_Prefilter); + } + if(m_Refine_factorIsSet) + { + + val[utility::conversions::to_string_t(U("refine_factor"))] = ModelBase::toJson(m_Refine_factor); + } + if(m_Upper_boundIsSet) + { + + val[utility::conversions::to_string_t(U("upper_bound"))] = ModelBase::toJson(m_Upper_bound); + } + if(m_VectorIsSet) + { + + val[utility::conversions::to_string_t(U("vector"))] = ModelBase::toJson(m_Vector); + } + if(m_Vector_columnIsSet) + { + + val[utility::conversions::to_string_t(U("vector_column"))] = ModelBase::toJson(m_Vector_column); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_With_row_idIsSet) + { + + val[utility::conversions::to_string_t(U("with_row_id"))] = ModelBase::toJson(m_With_row_id); + } + + return val; +} + +bool QueryTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("bypass_vector_index")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("bypass_vector_index"))); + if(!fieldValue.is_null()) + { + bool refVal_setBypassVectorIndex; + ok &= ModelBase::fromJson(fieldValue, refVal_setBypassVectorIndex); + setBypassVectorIndex(refVal_setBypassVectorIndex); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("columns"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumns); + setColumns(refVal_setColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("distance_type")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("distance_type"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromJson(fieldValue, refVal_setDistanceType); + setDistanceType(refVal_setDistanceType); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("ef")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("ef"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setEf; + ok &= ModelBase::fromJson(fieldValue, refVal_setEf); + setEf(refVal_setEf); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("fast_search")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fast_search"))); + if(!fieldValue.is_null()) + { + bool refVal_setFastSearch; + ok &= ModelBase::fromJson(fieldValue, refVal_setFastSearch); + setFastSearch(refVal_setFastSearch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("filter")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("filter"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setFilter; + ok &= ModelBase::fromJson(fieldValue, refVal_setFilter); + setFilter(refVal_setFilter); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("full_text_query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("full_text_query"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setFullTextQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setFullTextQuery); + setFullTextQuery(refVal_setFullTextQuery); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("k")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("k"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setK; + ok &= ModelBase::fromJson(fieldValue, refVal_setK); + setK(refVal_setK); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("lower_bound")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("lower_bound"))); + if(!fieldValue.is_null()) + { + float refVal_setLowerBound; + ok &= ModelBase::fromJson(fieldValue, refVal_setLowerBound); + setLowerBound(refVal_setLowerBound); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("nprobes")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("nprobes"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNprobes; + ok &= ModelBase::fromJson(fieldValue, refVal_setNprobes); + setNprobes(refVal_setNprobes); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("offset")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("offset"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setOffset; + ok &= ModelBase::fromJson(fieldValue, refVal_setOffset); + setOffset(refVal_setOffset); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("prefilter")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("prefilter"))); + if(!fieldValue.is_null()) + { + bool refVal_setPrefilter; + ok &= ModelBase::fromJson(fieldValue, refVal_setPrefilter); + setPrefilter(refVal_setPrefilter); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("refine_factor")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("refine_factor"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setRefineFactor; + ok &= ModelBase::fromJson(fieldValue, refVal_setRefineFactor); + setRefineFactor(refVal_setRefineFactor); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("upper_bound")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("upper_bound"))); + if(!fieldValue.is_null()) + { + float refVal_setUpperBound; + ok &= ModelBase::fromJson(fieldValue, refVal_setUpperBound); + setUpperBound(refVal_setUpperBound); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("vector")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vector"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVector; + ok &= ModelBase::fromJson(fieldValue, refVal_setVector); + setVector(refVal_setVector); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("vector_column")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vector_column"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setVectorColumn; + ok &= ModelBase::fromJson(fieldValue, refVal_setVectorColumn); + setVectorColumn(refVal_setVectorColumn); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("with_row_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("with_row_id"))); + if(!fieldValue.is_null()) + { + bool refVal_setWithRowId; + ok &= ModelBase::fromJson(fieldValue, refVal_setWithRowId); + setWithRowId(refVal_setWithRowId); + + } + } + return ok; +} + +void QueryTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_Bypass_vector_indexIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("bypass_vector_index")), m_Bypass_vector_index)); + } + if(m_ColumnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("columns")), m_Columns)); + } + if(m_Distance_typeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("distance_type")), m_Distance_type)); + } + if(m_EfIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("ef")), m_Ef)); + } + if(m_Fast_searchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fast_search")), m_Fast_search)); + } + if(m_FilterIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("filter")), m_Filter)); + } + if(m_Full_text_queryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("full_text_query")), m_Full_text_query)); + } + if(m_kIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("k")), m_k)); + } + if(m_Lower_boundIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("lower_bound")), m_Lower_bound)); + } + if(m_NprobesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("nprobes")), m_Nprobes)); + } + if(m_OffsetIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("offset")), m_Offset)); + } + if(m_PrefilterIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("prefilter")), m_Prefilter)); + } + if(m_Refine_factorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("refine_factor")), m_Refine_factor)); + } + if(m_Upper_boundIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("upper_bound")), m_Upper_bound)); + } + if(m_VectorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vector")), m_Vector)); + } + if(m_Vector_columnIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vector_column")), m_Vector_column)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_With_row_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("with_row_id")), m_With_row_id)); + } +} + +bool QueryTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("bypass_vector_index")))) + { + bool refVal_setBypassVectorIndex; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("bypass_vector_index"))), refVal_setBypassVectorIndex ); + setBypassVectorIndex(refVal_setBypassVectorIndex); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("columns")))) + { + std::shared_ptr refVal_setColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("columns"))), refVal_setColumns ); + setColumns(refVal_setColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("distance_type")))) + { + utility::string_t refVal_setDistanceType; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("distance_type"))), refVal_setDistanceType ); + setDistanceType(refVal_setDistanceType); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("ef")))) + { + int32_t refVal_setEf; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("ef"))), refVal_setEf ); + setEf(refVal_setEf); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("fast_search")))) + { + bool refVal_setFastSearch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fast_search"))), refVal_setFastSearch ); + setFastSearch(refVal_setFastSearch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("filter")))) + { + utility::string_t refVal_setFilter; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("filter"))), refVal_setFilter ); + setFilter(refVal_setFilter); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("full_text_query")))) + { + std::shared_ptr refVal_setFullTextQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("full_text_query"))), refVal_setFullTextQuery ); + setFullTextQuery(refVal_setFullTextQuery); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("k")))) + { + int32_t refVal_setK; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("k"))), refVal_setK ); + setK(refVal_setK); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("lower_bound")))) + { + float refVal_setLowerBound; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lower_bound"))), refVal_setLowerBound ); + setLowerBound(refVal_setLowerBound); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("nprobes")))) + { + int32_t refVal_setNprobes; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("nprobes"))), refVal_setNprobes ); + setNprobes(refVal_setNprobes); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("offset")))) + { + int32_t refVal_setOffset; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("offset"))), refVal_setOffset ); + setOffset(refVal_setOffset); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("prefilter")))) + { + bool refVal_setPrefilter; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("prefilter"))), refVal_setPrefilter ); + setPrefilter(refVal_setPrefilter); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("refine_factor")))) + { + int32_t refVal_setRefineFactor; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("refine_factor"))), refVal_setRefineFactor ); + setRefineFactor(refVal_setRefineFactor); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("upper_bound")))) + { + float refVal_setUpperBound; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("upper_bound"))), refVal_setUpperBound ); + setUpperBound(refVal_setUpperBound); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vector")))) + { + std::shared_ptr refVal_setVector; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vector"))), refVal_setVector ); + setVector(refVal_setVector); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vector_column")))) + { + utility::string_t refVal_setVectorColumn; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vector_column"))), refVal_setVectorColumn ); + setVectorColumn(refVal_setVectorColumn); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("with_row_id")))) + { + bool refVal_setWithRowId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("with_row_id"))), refVal_setWithRowId ); + setWithRowId(refVal_setWithRowId); + } + return ok; +} + + +std::shared_ptr QueryTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void QueryTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool QueryTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void QueryTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map QueryTableRequest::getContext() const +{ + return m_Context; +} + + +void QueryTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool QueryTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void QueryTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector QueryTableRequest::getId() const +{ + return m_Id; +} + + +void QueryTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool QueryTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void QueryTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t QueryTableRequest::getBranch() const +{ + return m_Branch; +} + + +void QueryTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool QueryTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void QueryTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +bool QueryTableRequest::isBypassVectorIndex() const +{ + return m_Bypass_vector_index; +} + +void QueryTableRequest::setBypassVectorIndex(bool value) +{ + m_Bypass_vector_index = value; + m_Bypass_vector_indexIsSet = true; +} + +bool QueryTableRequest::bypassVectorIndexIsSet() const +{ + return m_Bypass_vector_indexIsSet; +} + +void QueryTableRequest::unsetBypass_vector_index() +{ + m_Bypass_vector_indexIsSet = false; +} +std::shared_ptr QueryTableRequest::getColumns() const +{ + return m_Columns; +} + + +void QueryTableRequest::setColumns(const std::shared_ptr& value) +{ + m_Columns = value; + m_ColumnsIsSet = true; +} + +bool QueryTableRequest::columnsIsSet() const +{ + return m_ColumnsIsSet; +} + +void QueryTableRequest::unsetColumns() +{ + m_ColumnsIsSet = false; +} +utility::string_t QueryTableRequest::getDistanceType() const +{ + return m_Distance_type; +} + + +void QueryTableRequest::setDistanceType(const utility::string_t& value) +{ + m_Distance_type = value; + m_Distance_typeIsSet = true; +} + +bool QueryTableRequest::distanceTypeIsSet() const +{ + return m_Distance_typeIsSet; +} + +void QueryTableRequest::unsetDistance_type() +{ + m_Distance_typeIsSet = false; +} +int32_t QueryTableRequest::getEf() const +{ + return m_Ef; +} + +void QueryTableRequest::setEf(int32_t value) +{ + m_Ef = value; + m_EfIsSet = true; +} + +bool QueryTableRequest::efIsSet() const +{ + return m_EfIsSet; +} + +void QueryTableRequest::unsetEf() +{ + m_EfIsSet = false; +} +bool QueryTableRequest::isFastSearch() const +{ + return m_Fast_search; +} + +void QueryTableRequest::setFastSearch(bool value) +{ + m_Fast_search = value; + m_Fast_searchIsSet = true; +} + +bool QueryTableRequest::fastSearchIsSet() const +{ + return m_Fast_searchIsSet; +} + +void QueryTableRequest::unsetFast_search() +{ + m_Fast_searchIsSet = false; +} +utility::string_t QueryTableRequest::getFilter() const +{ + return m_Filter; +} + + +void QueryTableRequest::setFilter(const utility::string_t& value) +{ + m_Filter = value; + m_FilterIsSet = true; +} + +bool QueryTableRequest::filterIsSet() const +{ + return m_FilterIsSet; +} + +void QueryTableRequest::unsetFilter() +{ + m_FilterIsSet = false; +} +std::shared_ptr QueryTableRequest::getFullTextQuery() const +{ + return m_Full_text_query; +} + + +void QueryTableRequest::setFullTextQuery(const std::shared_ptr& value) +{ + m_Full_text_query = value; + m_Full_text_queryIsSet = true; +} + +bool QueryTableRequest::fullTextQueryIsSet() const +{ + return m_Full_text_queryIsSet; +} + +void QueryTableRequest::unsetFull_text_query() +{ + m_Full_text_queryIsSet = false; +} +int32_t QueryTableRequest::getK() const +{ + return m_k; +} + +void QueryTableRequest::setK(int32_t value) +{ + m_k = value; + m_kIsSet = true; +} + +bool QueryTableRequest::KIsSet() const +{ + return m_kIsSet; +} + +void QueryTableRequest::unsetk() +{ + m_kIsSet = false; +} +float QueryTableRequest::getLowerBound() const +{ + return m_Lower_bound; +} + +void QueryTableRequest::setLowerBound(float value) +{ + m_Lower_bound = value; + m_Lower_boundIsSet = true; +} + +bool QueryTableRequest::lowerBoundIsSet() const +{ + return m_Lower_boundIsSet; +} + +void QueryTableRequest::unsetLower_bound() +{ + m_Lower_boundIsSet = false; +} +int32_t QueryTableRequest::getNprobes() const +{ + return m_Nprobes; +} + +void QueryTableRequest::setNprobes(int32_t value) +{ + m_Nprobes = value; + m_NprobesIsSet = true; +} + +bool QueryTableRequest::nprobesIsSet() const +{ + return m_NprobesIsSet; +} + +void QueryTableRequest::unsetNprobes() +{ + m_NprobesIsSet = false; +} +int32_t QueryTableRequest::getOffset() const +{ + return m_Offset; +} + +void QueryTableRequest::setOffset(int32_t value) +{ + m_Offset = value; + m_OffsetIsSet = true; +} + +bool QueryTableRequest::offsetIsSet() const +{ + return m_OffsetIsSet; +} + +void QueryTableRequest::unsetOffset() +{ + m_OffsetIsSet = false; +} +bool QueryTableRequest::isPrefilter() const +{ + return m_Prefilter; +} + +void QueryTableRequest::setPrefilter(bool value) +{ + m_Prefilter = value; + m_PrefilterIsSet = true; +} + +bool QueryTableRequest::prefilterIsSet() const +{ + return m_PrefilterIsSet; +} + +void QueryTableRequest::unsetPrefilter() +{ + m_PrefilterIsSet = false; +} +int32_t QueryTableRequest::getRefineFactor() const +{ + return m_Refine_factor; +} + +void QueryTableRequest::setRefineFactor(int32_t value) +{ + m_Refine_factor = value; + m_Refine_factorIsSet = true; +} + +bool QueryTableRequest::refineFactorIsSet() const +{ + return m_Refine_factorIsSet; +} + +void QueryTableRequest::unsetRefine_factor() +{ + m_Refine_factorIsSet = false; +} +float QueryTableRequest::getUpperBound() const +{ + return m_Upper_bound; +} + +void QueryTableRequest::setUpperBound(float value) +{ + m_Upper_bound = value; + m_Upper_boundIsSet = true; +} + +bool QueryTableRequest::upperBoundIsSet() const +{ + return m_Upper_boundIsSet; +} + +void QueryTableRequest::unsetUpper_bound() +{ + m_Upper_boundIsSet = false; +} +std::shared_ptr QueryTableRequest::getVector() const +{ + return m_Vector; +} + + +void QueryTableRequest::setVector(const std::shared_ptr& value) +{ + m_Vector = value; + m_VectorIsSet = true; +} + +bool QueryTableRequest::vectorIsSet() const +{ + return m_VectorIsSet; +} + +void QueryTableRequest::unsetVector() +{ + m_VectorIsSet = false; +} +utility::string_t QueryTableRequest::getVectorColumn() const +{ + return m_Vector_column; +} + + +void QueryTableRequest::setVectorColumn(const utility::string_t& value) +{ + m_Vector_column = value; + m_Vector_columnIsSet = true; +} + +bool QueryTableRequest::vectorColumnIsSet() const +{ + return m_Vector_columnIsSet; +} + +void QueryTableRequest::unsetVector_column() +{ + m_Vector_columnIsSet = false; +} +int64_t QueryTableRequest::getVersion() const +{ + return m_Version; +} + +void QueryTableRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool QueryTableRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void QueryTableRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +bool QueryTableRequest::isWithRowId() const +{ + return m_With_row_id; +} + +void QueryTableRequest::setWithRowId(bool value) +{ + m_With_row_id = value; + m_With_row_idIsSet = true; +} + +bool QueryTableRequest::withRowIdIsSet() const +{ + return m_With_row_idIsSet; +} + +void QueryTableRequest::unsetWith_row_id() +{ + m_With_row_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_columns.cpp b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_columns.cpp new file mode 100644 index 000000000..2d996640f --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_columns.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/QueryTableRequest_columns.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +QueryTableRequest_columns::QueryTableRequest_columns() +{ + m_Column_namesIsSet = false; + m_Column_aliasesIsSet = false; +} + +QueryTableRequest_columns::~QueryTableRequest_columns() +{ +} + +void QueryTableRequest_columns::validate() +{ + // TODO: implement validation +} + +web::json::value QueryTableRequest_columns::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Column_namesIsSet) + { + + val[utility::conversions::to_string_t(U("column_names"))] = ModelBase::toJson(m_Column_names); + } + if(m_Column_aliasesIsSet) + { + + val[utility::conversions::to_string_t(U("column_aliases"))] = ModelBase::toJson(m_Column_aliases); + } + + return val; +} + +bool QueryTableRequest_columns::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("column_names")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column_names"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setColumnNames; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumnNames); + setColumnNames(refVal_setColumnNames); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("column_aliases")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("column_aliases"))); + if(!fieldValue.is_null()) + { + std::map refVal_setColumnAliases; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumnAliases); + setColumnAliases(refVal_setColumnAliases); + + } + } + return ok; +} + +void QueryTableRequest_columns::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Column_namesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column_names")), m_Column_names)); + } + if(m_Column_aliasesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("column_aliases")), m_Column_aliases)); + } +} + +bool QueryTableRequest_columns::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("column_names")))) + { + std::vector refVal_setColumnNames; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column_names"))), refVal_setColumnNames ); + setColumnNames(refVal_setColumnNames); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("column_aliases")))) + { + std::map refVal_setColumnAliases; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("column_aliases"))), refVal_setColumnAliases ); + setColumnAliases(refVal_setColumnAliases); + } + return ok; +} + + +std::vector QueryTableRequest_columns::getColumnNames() const +{ + return m_Column_names; +} + + +void QueryTableRequest_columns::setColumnNames(const std::vector& value) +{ + m_Column_names = value; + m_Column_namesIsSet = true; +} + +bool QueryTableRequest_columns::columnNamesIsSet() const +{ + return m_Column_namesIsSet; +} + +void QueryTableRequest_columns::unsetColumn_names() +{ + m_Column_namesIsSet = false; +} +std::map QueryTableRequest_columns::getColumnAliases() const +{ + return m_Column_aliases; +} + + +void QueryTableRequest_columns::setColumnAliases(const std::map& value) +{ + m_Column_aliases = value; + m_Column_aliasesIsSet = true; +} + +bool QueryTableRequest_columns::columnAliasesIsSet() const +{ + return m_Column_aliasesIsSet; +} + +void QueryTableRequest_columns::unsetColumn_aliases() +{ + m_Column_aliasesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_full_text_query.cpp b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_full_text_query.cpp new file mode 100644 index 000000000..5d52abbde --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_full_text_query.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +QueryTableRequest_full_text_query::QueryTableRequest_full_text_query() +{ + m_String_queryIsSet = false; + m_Structured_queryIsSet = false; +} + +QueryTableRequest_full_text_query::~QueryTableRequest_full_text_query() +{ +} + +void QueryTableRequest_full_text_query::validate() +{ + // TODO: implement validation +} + +web::json::value QueryTableRequest_full_text_query::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_String_queryIsSet) + { + + val[utility::conversions::to_string_t(U("string_query"))] = ModelBase::toJson(m_String_query); + } + if(m_Structured_queryIsSet) + { + + val[utility::conversions::to_string_t(U("structured_query"))] = ModelBase::toJson(m_Structured_query); + } + + return val; +} + +bool QueryTableRequest_full_text_query::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("string_query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("string_query"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setStringQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setStringQuery); + setStringQuery(refVal_setStringQuery); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("structured_query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("structured_query"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setStructuredQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setStructuredQuery); + setStructuredQuery(refVal_setStructuredQuery); + + } + } + return ok; +} + +void QueryTableRequest_full_text_query::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_String_queryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("string_query")), m_String_query)); + } + if(m_Structured_queryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("structured_query")), m_Structured_query)); + } +} + +bool QueryTableRequest_full_text_query::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("string_query")))) + { + std::shared_ptr refVal_setStringQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("string_query"))), refVal_setStringQuery ); + setStringQuery(refVal_setStringQuery); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("structured_query")))) + { + std::shared_ptr refVal_setStructuredQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("structured_query"))), refVal_setStructuredQuery ); + setStructuredQuery(refVal_setStructuredQuery); + } + return ok; +} + + +std::shared_ptr QueryTableRequest_full_text_query::getStringQuery() const +{ + return m_String_query; +} + + +void QueryTableRequest_full_text_query::setStringQuery(const std::shared_ptr& value) +{ + m_String_query = value; + m_String_queryIsSet = true; +} + +bool QueryTableRequest_full_text_query::stringQueryIsSet() const +{ + return m_String_queryIsSet; +} + +void QueryTableRequest_full_text_query::unsetString_query() +{ + m_String_queryIsSet = false; +} +std::shared_ptr QueryTableRequest_full_text_query::getStructuredQuery() const +{ + return m_Structured_query; +} + + +void QueryTableRequest_full_text_query::setStructuredQuery(const std::shared_ptr& value) +{ + m_Structured_query = value; + m_Structured_queryIsSet = true; +} + +bool QueryTableRequest_full_text_query::structuredQueryIsSet() const +{ + return m_Structured_queryIsSet; +} + +void QueryTableRequest_full_text_query::unsetStructured_query() +{ + m_Structured_queryIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_vector.cpp b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_vector.cpp new file mode 100644 index 000000000..3bcf6c33b --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/QueryTableRequest_vector.cpp @@ -0,0 +1,170 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/QueryTableRequest_vector.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +QueryTableRequest_vector::QueryTableRequest_vector() +{ + m_Single_vectorIsSet = false; + m_Multi_vectorIsSet = false; +} + +QueryTableRequest_vector::~QueryTableRequest_vector() +{ +} + +void QueryTableRequest_vector::validate() +{ + // TODO: implement validation +} + +web::json::value QueryTableRequest_vector::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Single_vectorIsSet) + { + + val[utility::conversions::to_string_t(U("single_vector"))] = ModelBase::toJson(m_Single_vector); + } + if(m_Multi_vectorIsSet) + { + + val[utility::conversions::to_string_t(U("multi_vector"))] = ModelBase::toJson(m_Multi_vector); + } + + return val; +} + +bool QueryTableRequest_vector::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("single_vector")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("single_vector"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setSingleVector; + ok &= ModelBase::fromJson(fieldValue, refVal_setSingleVector); + setSingleVector(refVal_setSingleVector); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("multi_vector")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("multi_vector"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setMultiVector; + ok &= ModelBase::fromJson(fieldValue, refVal_setMultiVector); + setMultiVector(refVal_setMultiVector); + + } + } + return ok; +} + +void QueryTableRequest_vector::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Single_vectorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("single_vector")), m_Single_vector)); + } + if(m_Multi_vectorIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("multi_vector")), m_Multi_vector)); + } +} + +bool QueryTableRequest_vector::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("single_vector")))) + { + std::vector refVal_setSingleVector; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("single_vector"))), refVal_setSingleVector ); + setSingleVector(refVal_setSingleVector); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("multi_vector")))) + { + std::vector> refVal_setMultiVector; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("multi_vector"))), refVal_setMultiVector ); + setMultiVector(refVal_setMultiVector); + } + return ok; +} + + +std::vector QueryTableRequest_vector::getSingleVector() const +{ + return m_Single_vector; +} + +void QueryTableRequest_vector::setSingleVector(std::vector value) +{ + m_Single_vector = value; + m_Single_vectorIsSet = true; +} + +bool QueryTableRequest_vector::singleVectorIsSet() const +{ + return m_Single_vectorIsSet; +} + +void QueryTableRequest_vector::unsetSingle_vector() +{ + m_Single_vectorIsSet = false; +} +std::vector> QueryTableRequest_vector::getMultiVector() const +{ + return m_Multi_vector; +} + + +void QueryTableRequest_vector::setMultiVector(const std::vector>& value) +{ + m_Multi_vector = value; + m_Multi_vectorIsSet = true; +} + +bool QueryTableRequest_vector::multiVectorIsSet() const +{ + return m_Multi_vectorIsSet; +} + +void QueryTableRequest_vector::unsetMulti_vector() +{ + m_Multi_vectorIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewRequest.cpp b/cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewRequest.cpp new file mode 100644 index 000000000..66147884e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewRequest.cpp @@ -0,0 +1,557 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RefreshMaterializedViewRequest::RefreshMaterializedViewRequest() +{ + m_IdentityIsSet = false; + m_IdIsSet = false; + m_Src_version = 0; + m_Src_versionIsSet = false; + m_Max_rows_per_fragment = 0; + m_Max_rows_per_fragmentIsSet = false; + m_Concurrency = 0; + m_ConcurrencyIsSet = false; + m_Intra_applier_concurrency = 0; + m_Intra_applier_concurrencyIsSet = false; + m_Source_task_size = 0; + m_Source_task_sizeIsSet = false; + m_Cluster = utility::conversions::to_string_t(""); + m_ClusterIsSet = false; + m_Output_limit = 0; + m_Output_limitIsSet = false; + m_Manifest = utility::conversions::to_string_t(""); + m_ManifestIsSet = false; +} + +RefreshMaterializedViewRequest::~RefreshMaterializedViewRequest() +{ +} + +void RefreshMaterializedViewRequest::validate() +{ + // TODO: implement validation +} + +web::json::value RefreshMaterializedViewRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_Src_versionIsSet) + { + + val[utility::conversions::to_string_t(U("src_version"))] = ModelBase::toJson(m_Src_version); + } + if(m_Max_rows_per_fragmentIsSet) + { + + val[utility::conversions::to_string_t(U("max_rows_per_fragment"))] = ModelBase::toJson(m_Max_rows_per_fragment); + } + if(m_ConcurrencyIsSet) + { + + val[utility::conversions::to_string_t(U("concurrency"))] = ModelBase::toJson(m_Concurrency); + } + if(m_Intra_applier_concurrencyIsSet) + { + + val[utility::conversions::to_string_t(U("intra_applier_concurrency"))] = ModelBase::toJson(m_Intra_applier_concurrency); + } + if(m_Source_task_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("source_task_size"))] = ModelBase::toJson(m_Source_task_size); + } + if(m_ClusterIsSet) + { + + val[utility::conversions::to_string_t(U("cluster"))] = ModelBase::toJson(m_Cluster); + } + if(m_Output_limitIsSet) + { + + val[utility::conversions::to_string_t(U("output_limit"))] = ModelBase::toJson(m_Output_limit); + } + if(m_ManifestIsSet) + { + + val[utility::conversions::to_string_t(U("manifest"))] = ModelBase::toJson(m_Manifest); + } + + return val; +} + +bool RefreshMaterializedViewRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("src_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("src_version"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setSrcVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setSrcVersion); + setSrcVersion(refVal_setSrcVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("max_rows_per_fragment")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("max_rows_per_fragment"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setMaxRowsPerFragment; + ok &= ModelBase::fromJson(fieldValue, refVal_setMaxRowsPerFragment); + setMaxRowsPerFragment(refVal_setMaxRowsPerFragment); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("concurrency")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("concurrency"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setConcurrency; + ok &= ModelBase::fromJson(fieldValue, refVal_setConcurrency); + setConcurrency(refVal_setConcurrency); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("intra_applier_concurrency")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("intra_applier_concurrency"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setIntraApplierConcurrency; + ok &= ModelBase::fromJson(fieldValue, refVal_setIntraApplierConcurrency); + setIntraApplierConcurrency(refVal_setIntraApplierConcurrency); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("source_task_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("source_task_size"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setSourceTaskSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setSourceTaskSize); + setSourceTaskSize(refVal_setSourceTaskSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("cluster")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("cluster"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setCluster; + ok &= ModelBase::fromJson(fieldValue, refVal_setCluster); + setCluster(refVal_setCluster); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("output_limit")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("output_limit"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setOutputLimit; + ok &= ModelBase::fromJson(fieldValue, refVal_setOutputLimit); + setOutputLimit(refVal_setOutputLimit); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifest); + setManifest(refVal_setManifest); + + } + } + return ok; +} + +void RefreshMaterializedViewRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_Src_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("src_version")), m_Src_version)); + } + if(m_Max_rows_per_fragmentIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("max_rows_per_fragment")), m_Max_rows_per_fragment)); + } + if(m_ConcurrencyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("concurrency")), m_Concurrency)); + } + if(m_Intra_applier_concurrencyIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("intra_applier_concurrency")), m_Intra_applier_concurrency)); + } + if(m_Source_task_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("source_task_size")), m_Source_task_size)); + } + if(m_ClusterIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("cluster")), m_Cluster)); + } + if(m_Output_limitIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("output_limit")), m_Output_limit)); + } + if(m_ManifestIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest")), m_Manifest)); + } +} + +bool RefreshMaterializedViewRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("src_version")))) + { + int32_t refVal_setSrcVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("src_version"))), refVal_setSrcVersion ); + setSrcVersion(refVal_setSrcVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("max_rows_per_fragment")))) + { + int32_t refVal_setMaxRowsPerFragment; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("max_rows_per_fragment"))), refVal_setMaxRowsPerFragment ); + setMaxRowsPerFragment(refVal_setMaxRowsPerFragment); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("concurrency")))) + { + int32_t refVal_setConcurrency; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("concurrency"))), refVal_setConcurrency ); + setConcurrency(refVal_setConcurrency); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("intra_applier_concurrency")))) + { + int32_t refVal_setIntraApplierConcurrency; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("intra_applier_concurrency"))), refVal_setIntraApplierConcurrency ); + setIntraApplierConcurrency(refVal_setIntraApplierConcurrency); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("source_task_size")))) + { + int32_t refVal_setSourceTaskSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("source_task_size"))), refVal_setSourceTaskSize ); + setSourceTaskSize(refVal_setSourceTaskSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("cluster")))) + { + utility::string_t refVal_setCluster; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("cluster"))), refVal_setCluster ); + setCluster(refVal_setCluster); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("output_limit")))) + { + int32_t refVal_setOutputLimit; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("output_limit"))), refVal_setOutputLimit ); + setOutputLimit(refVal_setOutputLimit); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest")))) + { + utility::string_t refVal_setManifest; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest"))), refVal_setManifest ); + setManifest(refVal_setManifest); + } + return ok; +} + + +std::shared_ptr RefreshMaterializedViewRequest::getIdentity() const +{ + return m_Identity; +} + + +void RefreshMaterializedViewRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool RefreshMaterializedViewRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void RefreshMaterializedViewRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::vector RefreshMaterializedViewRequest::getId() const +{ + return m_Id; +} + + +void RefreshMaterializedViewRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool RefreshMaterializedViewRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void RefreshMaterializedViewRequest::unsetId() +{ + m_IdIsSet = false; +} +int32_t RefreshMaterializedViewRequest::getSrcVersion() const +{ + return m_Src_version; +} + +void RefreshMaterializedViewRequest::setSrcVersion(int32_t value) +{ + m_Src_version = value; + m_Src_versionIsSet = true; +} + +bool RefreshMaterializedViewRequest::srcVersionIsSet() const +{ + return m_Src_versionIsSet; +} + +void RefreshMaterializedViewRequest::unsetSrc_version() +{ + m_Src_versionIsSet = false; +} +int32_t RefreshMaterializedViewRequest::getMaxRowsPerFragment() const +{ + return m_Max_rows_per_fragment; +} + +void RefreshMaterializedViewRequest::setMaxRowsPerFragment(int32_t value) +{ + m_Max_rows_per_fragment = value; + m_Max_rows_per_fragmentIsSet = true; +} + +bool RefreshMaterializedViewRequest::maxRowsPerFragmentIsSet() const +{ + return m_Max_rows_per_fragmentIsSet; +} + +void RefreshMaterializedViewRequest::unsetMax_rows_per_fragment() +{ + m_Max_rows_per_fragmentIsSet = false; +} +int32_t RefreshMaterializedViewRequest::getConcurrency() const +{ + return m_Concurrency; +} + +void RefreshMaterializedViewRequest::setConcurrency(int32_t value) +{ + m_Concurrency = value; + m_ConcurrencyIsSet = true; +} + +bool RefreshMaterializedViewRequest::concurrencyIsSet() const +{ + return m_ConcurrencyIsSet; +} + +void RefreshMaterializedViewRequest::unsetConcurrency() +{ + m_ConcurrencyIsSet = false; +} +int32_t RefreshMaterializedViewRequest::getIntraApplierConcurrency() const +{ + return m_Intra_applier_concurrency; +} + +void RefreshMaterializedViewRequest::setIntraApplierConcurrency(int32_t value) +{ + m_Intra_applier_concurrency = value; + m_Intra_applier_concurrencyIsSet = true; +} + +bool RefreshMaterializedViewRequest::intraApplierConcurrencyIsSet() const +{ + return m_Intra_applier_concurrencyIsSet; +} + +void RefreshMaterializedViewRequest::unsetIntra_applier_concurrency() +{ + m_Intra_applier_concurrencyIsSet = false; +} +int32_t RefreshMaterializedViewRequest::getSourceTaskSize() const +{ + return m_Source_task_size; +} + +void RefreshMaterializedViewRequest::setSourceTaskSize(int32_t value) +{ + m_Source_task_size = value; + m_Source_task_sizeIsSet = true; +} + +bool RefreshMaterializedViewRequest::sourceTaskSizeIsSet() const +{ + return m_Source_task_sizeIsSet; +} + +void RefreshMaterializedViewRequest::unsetSource_task_size() +{ + m_Source_task_sizeIsSet = false; +} +utility::string_t RefreshMaterializedViewRequest::getCluster() const +{ + return m_Cluster; +} + + +void RefreshMaterializedViewRequest::setCluster(const utility::string_t& value) +{ + m_Cluster = value; + m_ClusterIsSet = true; +} + +bool RefreshMaterializedViewRequest::clusterIsSet() const +{ + return m_ClusterIsSet; +} + +void RefreshMaterializedViewRequest::unsetCluster() +{ + m_ClusterIsSet = false; +} +int32_t RefreshMaterializedViewRequest::getOutputLimit() const +{ + return m_Output_limit; +} + +void RefreshMaterializedViewRequest::setOutputLimit(int32_t value) +{ + m_Output_limit = value; + m_Output_limitIsSet = true; +} + +bool RefreshMaterializedViewRequest::outputLimitIsSet() const +{ + return m_Output_limitIsSet; +} + +void RefreshMaterializedViewRequest::unsetOutput_limit() +{ + m_Output_limitIsSet = false; +} +utility::string_t RefreshMaterializedViewRequest::getManifest() const +{ + return m_Manifest; +} + + +void RefreshMaterializedViewRequest::setManifest(const utility::string_t& value) +{ + m_Manifest = value; + m_ManifestIsSet = true; +} + +bool RefreshMaterializedViewRequest::manifestIsSet() const +{ + return m_ManifestIsSet; +} + +void RefreshMaterializedViewRequest::unsetManifest() +{ + m_ManifestIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewResponse.cpp b/cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewResponse.cpp new file mode 100644 index 000000000..8294b0d61 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RefreshMaterializedViewResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RefreshMaterializedViewResponse::RefreshMaterializedViewResponse() +{ + m_Job_id = utility::conversions::to_string_t(""); + m_Job_idIsSet = false; +} + +RefreshMaterializedViewResponse::~RefreshMaterializedViewResponse() +{ +} + +void RefreshMaterializedViewResponse::validate() +{ + // TODO: implement validation +} + +web::json::value RefreshMaterializedViewResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Job_idIsSet) + { + + val[utility::conversions::to_string_t(U("job_id"))] = ModelBase::toJson(m_Job_id); + } + + return val; +} + +bool RefreshMaterializedViewResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("job_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("job_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setJobId; + ok &= ModelBase::fromJson(fieldValue, refVal_setJobId); + setJobId(refVal_setJobId); + + } + } + return ok; +} + +void RefreshMaterializedViewResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Job_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("job_id")), m_Job_id)); + } +} + +bool RefreshMaterializedViewResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("job_id")))) + { + utility::string_t refVal_setJobId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("job_id"))), refVal_setJobId ); + setJobId(refVal_setJobId); + } + return ok; +} + + +utility::string_t RefreshMaterializedViewResponse::getJobId() const +{ + return m_Job_id; +} + + +void RefreshMaterializedViewResponse::setJobId(const utility::string_t& value) +{ + m_Job_id = value; + m_Job_idIsSet = true; +} + +bool RefreshMaterializedViewResponse::jobIdIsSet() const +{ + return m_Job_idIsSet; +} + +void RefreshMaterializedViewResponse::unsetJob_id() +{ + m_Job_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RegisterTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/RegisterTableRequest.cpp new file mode 100644 index 000000000..4c43afd4a --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RegisterTableRequest.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RegisterTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RegisterTableRequest::RegisterTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_Mode = utility::conversions::to_string_t(""); + m_ModeIsSet = false; + m_PropertiesIsSet = false; +} + +RegisterTableRequest::~RegisterTableRequest() +{ +} + +void RegisterTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value RegisterTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_ModeIsSet) + { + + val[utility::conversions::to_string_t(U("mode"))] = ModelBase::toJson(m_Mode); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool RegisterTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("mode")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("mode"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromJson(fieldValue, refVal_setMode); + setMode(refVal_setMode); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void RegisterTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_ModeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("mode")), m_Mode)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool RegisterTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("mode")))) + { + utility::string_t refVal_setMode; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("mode"))), refVal_setMode ); + setMode(refVal_setMode); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +std::shared_ptr RegisterTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void RegisterTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool RegisterTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void RegisterTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map RegisterTableRequest::getContext() const +{ + return m_Context; +} + + +void RegisterTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool RegisterTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void RegisterTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector RegisterTableRequest::getId() const +{ + return m_Id; +} + + +void RegisterTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool RegisterTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void RegisterTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t RegisterTableRequest::getLocation() const +{ + return m_Location; +} + + +void RegisterTableRequest::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool RegisterTableRequest::locationIsSet() const +{ + return m_LocationIsSet; +} + +void RegisterTableRequest::unsetLocation() +{ + m_LocationIsSet = false; +} +utility::string_t RegisterTableRequest::getMode() const +{ + return m_Mode; +} + + +void RegisterTableRequest::setMode(const utility::string_t& value) +{ + m_Mode = value; + m_ModeIsSet = true; +} + +bool RegisterTableRequest::modeIsSet() const +{ + return m_ModeIsSet; +} + +void RegisterTableRequest::unsetMode() +{ + m_ModeIsSet = false; +} +std::map RegisterTableRequest::getProperties() const +{ + return m_Properties; +} + + +void RegisterTableRequest::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool RegisterTableRequest::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void RegisterTableRequest::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RegisterTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/RegisterTableResponse.cpp new file mode 100644 index 000000000..9f1178ff3 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RegisterTableResponse.cpp @@ -0,0 +1,221 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RegisterTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RegisterTableResponse::RegisterTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Location = utility::conversions::to_string_t(""); + m_LocationIsSet = false; + m_PropertiesIsSet = false; +} + +RegisterTableResponse::~RegisterTableResponse() +{ +} + +void RegisterTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value RegisterTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_LocationIsSet) + { + + val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool RegisterTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("location")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromJson(fieldValue, refVal_setLocation); + setLocation(refVal_setLocation); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void RegisterTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_LocationIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool RegisterTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("location")))) + { + utility::string_t refVal_setLocation; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation ); + setLocation(refVal_setLocation); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t RegisterTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void RegisterTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool RegisterTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void RegisterTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +utility::string_t RegisterTableResponse::getLocation() const +{ + return m_Location; +} + + +void RegisterTableResponse::setLocation(const utility::string_t& value) +{ + m_Location = value; + m_LocationIsSet = true; +} + +bool RegisterTableResponse::locationIsSet() const +{ + return m_LocationIsSet; +} + +void RegisterTableResponse::unsetLocation() +{ + m_LocationIsSet = false; +} +std::map RegisterTableResponse::getProperties() const +{ + return m_Properties; +} + + +void RegisterTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool RegisterTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void RegisterTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RenameTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/RenameTableRequest.cpp new file mode 100644 index 000000000..878901a1e --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RenameTableRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RenameTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RenameTableRequest::RenameTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_New_table_name = utility::conversions::to_string_t(""); + m_New_table_nameIsSet = false; + m_New_namespace_idIsSet = false; +} + +RenameTableRequest::~RenameTableRequest() +{ +} + +void RenameTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value RenameTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_New_table_nameIsSet) + { + + val[utility::conversions::to_string_t(U("new_table_name"))] = ModelBase::toJson(m_New_table_name); + } + if(m_New_namespace_idIsSet) + { + + val[utility::conversions::to_string_t(U("new_namespace_id"))] = ModelBase::toJson(m_New_namespace_id); + } + + return val; +} + +bool RenameTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("new_table_name")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("new_table_name"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setNewTableName; + ok &= ModelBase::fromJson(fieldValue, refVal_setNewTableName); + setNewTableName(refVal_setNewTableName); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("new_namespace_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("new_namespace_id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setNewNamespaceId; + ok &= ModelBase::fromJson(fieldValue, refVal_setNewNamespaceId); + setNewNamespaceId(refVal_setNewNamespaceId); + + } + } + return ok; +} + +void RenameTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_New_table_nameIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("new_table_name")), m_New_table_name)); + } + if(m_New_namespace_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("new_namespace_id")), m_New_namespace_id)); + } +} + +bool RenameTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("new_table_name")))) + { + utility::string_t refVal_setNewTableName; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("new_table_name"))), refVal_setNewTableName ); + setNewTableName(refVal_setNewTableName); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("new_namespace_id")))) + { + std::vector refVal_setNewNamespaceId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("new_namespace_id"))), refVal_setNewNamespaceId ); + setNewNamespaceId(refVal_setNewNamespaceId); + } + return ok; +} + + +std::shared_ptr RenameTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void RenameTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool RenameTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void RenameTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map RenameTableRequest::getContext() const +{ + return m_Context; +} + + +void RenameTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool RenameTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void RenameTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector RenameTableRequest::getId() const +{ + return m_Id; +} + + +void RenameTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool RenameTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void RenameTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t RenameTableRequest::getNewTableName() const +{ + return m_New_table_name; +} + + +void RenameTableRequest::setNewTableName(const utility::string_t& value) +{ + m_New_table_name = value; + m_New_table_nameIsSet = true; +} + +bool RenameTableRequest::newTableNameIsSet() const +{ + return m_New_table_nameIsSet; +} + +void RenameTableRequest::unsetNew_table_name() +{ + m_New_table_nameIsSet = false; +} +std::vector RenameTableRequest::getNewNamespaceId() const +{ + return m_New_namespace_id; +} + + +void RenameTableRequest::setNewNamespaceId(const std::vector& value) +{ + m_New_namespace_id = value; + m_New_namespace_idIsSet = true; +} + +bool RenameTableRequest::newNamespaceIdIsSet() const +{ + return m_New_namespace_idIsSet; +} + +void RenameTableRequest::unsetNew_namespace_id() +{ + m_New_namespace_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RenameTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/RenameTableResponse.cpp new file mode 100644 index 000000000..4ec269104 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RenameTableResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RenameTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RenameTableResponse::RenameTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +RenameTableResponse::~RenameTableResponse() +{ +} + +void RenameTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value RenameTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool RenameTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void RenameTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool RenameTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t RenameTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void RenameTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool RenameTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void RenameTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RestoreTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/RestoreTableRequest.cpp new file mode 100644 index 000000000..45646abca --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RestoreTableRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RestoreTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RestoreTableRequest::RestoreTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; +} + +RestoreTableRequest::~RestoreTableRequest() +{ +} + +void RestoreTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value RestoreTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + + return val; +} + +bool RestoreTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + return ok; +} + +void RestoreTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } +} + +bool RestoreTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + return ok; +} + + +std::shared_ptr RestoreTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void RestoreTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool RestoreTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void RestoreTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map RestoreTableRequest::getContext() const +{ + return m_Context; +} + + +void RestoreTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool RestoreTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void RestoreTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector RestoreTableRequest::getId() const +{ + return m_Id; +} + + +void RestoreTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool RestoreTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void RestoreTableRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t RestoreTableRequest::getVersion() const +{ + return m_Version; +} + +void RestoreTableRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool RestoreTableRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void RestoreTableRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t RestoreTableRequest::getBranch() const +{ + return m_Branch; +} + + +void RestoreTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool RestoreTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void RestoreTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/RestoreTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/RestoreTableResponse.cpp new file mode 100644 index 000000000..58d377f25 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/RestoreTableResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/RestoreTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +RestoreTableResponse::RestoreTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +RestoreTableResponse::~RestoreTableResponse() +{ +} + +void RestoreTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value RestoreTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool RestoreTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void RestoreTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool RestoreTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t RestoreTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void RestoreTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool RestoreTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void RestoreTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/StringFtsQuery.cpp b/cpp/lance_namespace_rest_client/src/model/StringFtsQuery.cpp new file mode 100644 index 000000000..4fbebc837 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/StringFtsQuery.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/StringFtsQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +StringFtsQuery::StringFtsQuery() +{ + m_ColumnsIsSet = false; + m_Query = utility::conversions::to_string_t(""); + m_QueryIsSet = false; +} + +StringFtsQuery::~StringFtsQuery() +{ +} + +void StringFtsQuery::validate() +{ + // TODO: implement validation +} + +web::json::value StringFtsQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_ColumnsIsSet) + { + + val[utility::conversions::to_string_t(U("columns"))] = ModelBase::toJson(m_Columns); + } + if(m_QueryIsSet) + { + + val[utility::conversions::to_string_t(U("query"))] = ModelBase::toJson(m_Query); + } + + return val; +} + +bool StringFtsQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("columns")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("columns"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setColumns; + ok &= ModelBase::fromJson(fieldValue, refVal_setColumns); + setColumns(refVal_setColumns); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("query"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setQuery); + setQuery(refVal_setQuery); + + } + } + return ok; +} + +void StringFtsQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_ColumnsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("columns")), m_Columns)); + } + if(m_QueryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("query")), m_Query)); + } +} + +bool StringFtsQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("columns")))) + { + std::vector refVal_setColumns; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("columns"))), refVal_setColumns ); + setColumns(refVal_setColumns); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("query")))) + { + utility::string_t refVal_setQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("query"))), refVal_setQuery ); + setQuery(refVal_setQuery); + } + return ok; +} + + +std::vector StringFtsQuery::getColumns() const +{ + return m_Columns; +} + + +void StringFtsQuery::setColumns(const std::vector& value) +{ + m_Columns = value; + m_ColumnsIsSet = true; +} + +bool StringFtsQuery::columnsIsSet() const +{ + return m_ColumnsIsSet; +} + +void StringFtsQuery::unsetColumns() +{ + m_ColumnsIsSet = false; +} +utility::string_t StringFtsQuery::getQuery() const +{ + return m_Query; +} + + +void StringFtsQuery::setQuery(const utility::string_t& value) +{ + m_Query = value; + m_QueryIsSet = true; +} + +bool StringFtsQuery::queryIsSet() const +{ + return m_QueryIsSet; +} + +void StringFtsQuery::unsetQuery() +{ + m_QueryIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/StructuredFtsQuery.cpp b/cpp/lance_namespace_rest_client/src/model/StructuredFtsQuery.cpp new file mode 100644 index 000000000..a49e6bff9 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/StructuredFtsQuery.cpp @@ -0,0 +1,123 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/StructuredFtsQuery.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +StructuredFtsQuery::StructuredFtsQuery() +{ + m_QueryIsSet = false; +} + +StructuredFtsQuery::~StructuredFtsQuery() +{ +} + +void StructuredFtsQuery::validate() +{ + // TODO: implement validation +} + +web::json::value StructuredFtsQuery::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_QueryIsSet) + { + + val[utility::conversions::to_string_t(U("query"))] = ModelBase::toJson(m_Query); + } + + return val; +} + +bool StructuredFtsQuery::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("query")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("query"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setQuery; + ok &= ModelBase::fromJson(fieldValue, refVal_setQuery); + setQuery(refVal_setQuery); + + } + } + return ok; +} + +void StructuredFtsQuery::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_QueryIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("query")), m_Query)); + } +} + +bool StructuredFtsQuery::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("query")))) + { + std::shared_ptr refVal_setQuery; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("query"))), refVal_setQuery ); + setQuery(refVal_setQuery); + } + return ok; +} + + +std::shared_ptr StructuredFtsQuery::getQuery() const +{ + return m_Query; +} + + +void StructuredFtsQuery::setQuery(const std::shared_ptr& value) +{ + m_Query = value; + m_QueryIsSet = true; +} + +bool StructuredFtsQuery::queryIsSet() const +{ + return m_QueryIsSet; +} + +void StructuredFtsQuery::unsetQuery() +{ + m_QueryIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/TableBasicStats.cpp b/cpp/lance_namespace_rest_client/src/model/TableBasicStats.cpp new file mode 100644 index 000000000..998da1f9d --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/TableBasicStats.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/TableBasicStats.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +TableBasicStats::TableBasicStats() +{ + m_Num_deleted_rows = 0; + m_Num_deleted_rowsIsSet = false; + m_Num_fragments = 0; + m_Num_fragmentsIsSet = false; +} + +TableBasicStats::~TableBasicStats() +{ +} + +void TableBasicStats::validate() +{ + // TODO: implement validation +} + +web::json::value TableBasicStats::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Num_deleted_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("num_deleted_rows"))] = ModelBase::toJson(m_Num_deleted_rows); + } + if(m_Num_fragmentsIsSet) + { + + val[utility::conversions::to_string_t(U("num_fragments"))] = ModelBase::toJson(m_Num_fragments); + } + + return val; +} + +bool TableBasicStats::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("num_deleted_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_deleted_rows"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNumDeletedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumDeletedRows); + setNumDeletedRows(refVal_setNumDeletedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("num_fragments")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("num_fragments"))); + if(!fieldValue.is_null()) + { + int32_t refVal_setNumFragments; + ok &= ModelBase::fromJson(fieldValue, refVal_setNumFragments); + setNumFragments(refVal_setNumFragments); + + } + } + return ok; +} + +void TableBasicStats::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Num_deleted_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_deleted_rows")), m_Num_deleted_rows)); + } + if(m_Num_fragmentsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("num_fragments")), m_Num_fragments)); + } +} + +bool TableBasicStats::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("num_deleted_rows")))) + { + int32_t refVal_setNumDeletedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_deleted_rows"))), refVal_setNumDeletedRows ); + setNumDeletedRows(refVal_setNumDeletedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("num_fragments")))) + { + int32_t refVal_setNumFragments; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("num_fragments"))), refVal_setNumFragments ); + setNumFragments(refVal_setNumFragments); + } + return ok; +} + + +int32_t TableBasicStats::getNumDeletedRows() const +{ + return m_Num_deleted_rows; +} + +void TableBasicStats::setNumDeletedRows(int32_t value) +{ + m_Num_deleted_rows = value; + m_Num_deleted_rowsIsSet = true; +} + +bool TableBasicStats::numDeletedRowsIsSet() const +{ + return m_Num_deleted_rowsIsSet; +} + +void TableBasicStats::unsetNum_deleted_rows() +{ + m_Num_deleted_rowsIsSet = false; +} +int32_t TableBasicStats::getNumFragments() const +{ + return m_Num_fragments; +} + +void TableBasicStats::setNumFragments(int32_t value) +{ + m_Num_fragments = value; + m_Num_fragmentsIsSet = true; +} + +bool TableBasicStats::numFragmentsIsSet() const +{ + return m_Num_fragmentsIsSet; +} + +void TableBasicStats::unsetNum_fragments() +{ + m_Num_fragmentsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/TableExistsRequest.cpp b/cpp/lance_namespace_rest_client/src/model/TableExistsRequest.cpp new file mode 100644 index 000000000..947e36957 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/TableExistsRequest.cpp @@ -0,0 +1,267 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/TableExistsRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +TableExistsRequest::TableExistsRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; +} + +TableExistsRequest::~TableExistsRequest() +{ +} + +void TableExistsRequest::validate() +{ + // TODO: implement validation +} + +web::json::value TableExistsRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + + return val; +} + +bool TableExistsRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + return ok; +} + +void TableExistsRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } +} + +bool TableExistsRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + return ok; +} + + +std::shared_ptr TableExistsRequest::getIdentity() const +{ + return m_Identity; +} + + +void TableExistsRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool TableExistsRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void TableExistsRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map TableExistsRequest::getContext() const +{ + return m_Context; +} + + +void TableExistsRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool TableExistsRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void TableExistsRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector TableExistsRequest::getId() const +{ + return m_Id; +} + + +void TableExistsRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool TableExistsRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void TableExistsRequest::unsetId() +{ + m_IdIsSet = false; +} +int64_t TableExistsRequest::getVersion() const +{ + return m_Version; +} + +void TableExistsRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool TableExistsRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void TableExistsRequest::unsetVersion() +{ + m_VersionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/TableVersion.cpp b/cpp/lance_namespace_rest_client/src/model/TableVersion.cpp new file mode 100644 index 000000000..ea416f3e7 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/TableVersion.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/TableVersion.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +TableVersion::TableVersion() +{ + m_Version = 0L; + m_VersionIsSet = false; + m_Manifest_path = utility::conversions::to_string_t(""); + m_Manifest_pathIsSet = false; + m_Manifest_size = 0L; + m_Manifest_sizeIsSet = false; + m_E_tag = utility::conversions::to_string_t(""); + m_E_tagIsSet = false; + m_Timestamp_millis = 0L; + m_Timestamp_millisIsSet = false; + m_MetadataIsSet = false; +} + +TableVersion::~TableVersion() +{ +} + +void TableVersion::validate() +{ + // TODO: implement validation +} + +web::json::value TableVersion::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_Manifest_pathIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_path"))] = ModelBase::toJson(m_Manifest_path); + } + if(m_Manifest_sizeIsSet) + { + + val[utility::conversions::to_string_t(U("manifest_size"))] = ModelBase::toJson(m_Manifest_size); + } + if(m_E_tagIsSet) + { + + val[utility::conversions::to_string_t(U("e_tag"))] = ModelBase::toJson(m_E_tag); + } + if(m_Timestamp_millisIsSet) + { + + val[utility::conversions::to_string_t(U("timestamp_millis"))] = ModelBase::toJson(m_Timestamp_millis); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + + return val; +} + +bool TableVersion::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_path")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_path"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setManifestPath; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestPath); + setManifestPath(refVal_setManifestPath); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifest_size")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifest_size"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestSize); + setManifestSize(refVal_setManifestSize); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("e_tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("e_tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setETag; + ok &= ModelBase::fromJson(fieldValue, refVal_setETag); + setETag(refVal_setETag); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("timestamp_millis")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("timestamp_millis"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setTimestampMillis; + ok &= ModelBase::fromJson(fieldValue, refVal_setTimestampMillis); + setTimestampMillis(refVal_setTimestampMillis); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + return ok; +} + +void TableVersion::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_Manifest_pathIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_path")), m_Manifest_path)); + } + if(m_Manifest_sizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifest_size")), m_Manifest_size)); + } + if(m_E_tagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("e_tag")), m_E_tag)); + } + if(m_Timestamp_millisIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("timestamp_millis")), m_Timestamp_millis)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } +} + +bool TableVersion::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_path")))) + { + utility::string_t refVal_setManifestPath; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_path"))), refVal_setManifestPath ); + setManifestPath(refVal_setManifestPath); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifest_size")))) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifest_size"))), refVal_setManifestSize ); + setManifestSize(refVal_setManifestSize); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("e_tag")))) + { + utility::string_t refVal_setETag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("e_tag"))), refVal_setETag ); + setETag(refVal_setETag); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("timestamp_millis")))) + { + int64_t refVal_setTimestampMillis; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("timestamp_millis"))), refVal_setTimestampMillis ); + setTimestampMillis(refVal_setTimestampMillis); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + return ok; +} + + +int64_t TableVersion::getVersion() const +{ + return m_Version; +} + +void TableVersion::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool TableVersion::versionIsSet() const +{ + return m_VersionIsSet; +} + +void TableVersion::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t TableVersion::getManifestPath() const +{ + return m_Manifest_path; +} + + +void TableVersion::setManifestPath(const utility::string_t& value) +{ + m_Manifest_path = value; + m_Manifest_pathIsSet = true; +} + +bool TableVersion::manifestPathIsSet() const +{ + return m_Manifest_pathIsSet; +} + +void TableVersion::unsetManifest_path() +{ + m_Manifest_pathIsSet = false; +} +int64_t TableVersion::getManifestSize() const +{ + return m_Manifest_size; +} + +void TableVersion::setManifestSize(int64_t value) +{ + m_Manifest_size = value; + m_Manifest_sizeIsSet = true; +} + +bool TableVersion::manifestSizeIsSet() const +{ + return m_Manifest_sizeIsSet; +} + +void TableVersion::unsetManifest_size() +{ + m_Manifest_sizeIsSet = false; +} +utility::string_t TableVersion::getETag() const +{ + return m_E_tag; +} + + +void TableVersion::setETag(const utility::string_t& value) +{ + m_E_tag = value; + m_E_tagIsSet = true; +} + +bool TableVersion::eTagIsSet() const +{ + return m_E_tagIsSet; +} + +void TableVersion::unsetE_tag() +{ + m_E_tagIsSet = false; +} +int64_t TableVersion::getTimestampMillis() const +{ + return m_Timestamp_millis; +} + +void TableVersion::setTimestampMillis(int64_t value) +{ + m_Timestamp_millis = value; + m_Timestamp_millisIsSet = true; +} + +bool TableVersion::timestampMillisIsSet() const +{ + return m_Timestamp_millisIsSet; +} + +void TableVersion::unsetTimestamp_millis() +{ + m_Timestamp_millisIsSet = false; +} +std::map TableVersion::getMetadata() const +{ + return m_Metadata; +} + + +void TableVersion::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool TableVersion::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void TableVersion::unsetMetadata() +{ + m_MetadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/TagContents.cpp b/cpp/lance_namespace_rest_client/src/model/TagContents.cpp new file mode 100644 index 000000000..c87ba5a29 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/TagContents.cpp @@ -0,0 +1,220 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/TagContents.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +TagContents::TagContents() +{ + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_ManifestSize = 0L; + m_ManifestSizeIsSet = false; +} + +TagContents::~TagContents() +{ +} + +void TagContents::validate() +{ + // TODO: implement validation +} + +web::json::value TagContents::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_ManifestSizeIsSet) + { + + val[utility::conversions::to_string_t(U("manifestSize"))] = ModelBase::toJson(m_ManifestSize); + } + + return val; +} + +bool TagContents::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("manifestSize")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("manifestSize"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromJson(fieldValue, refVal_setManifestSize); + setManifestSize(refVal_setManifestSize); + + } + } + return ok; +} + +void TagContents::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_ManifestSizeIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("manifestSize")), m_ManifestSize)); + } +} + +bool TagContents::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("manifestSize")))) + { + int64_t refVal_setManifestSize; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("manifestSize"))), refVal_setManifestSize ); + setManifestSize(refVal_setManifestSize); + } + return ok; +} + + +utility::string_t TagContents::getBranch() const +{ + return m_Branch; +} + + +void TagContents::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool TagContents::branchIsSet() const +{ + return m_BranchIsSet; +} + +void TagContents::unsetBranch() +{ + m_BranchIsSet = false; +} +int64_t TagContents::getVersion() const +{ + return m_Version; +} + +void TagContents::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool TagContents::versionIsSet() const +{ + return m_VersionIsSet; +} + +void TagContents::unsetVersion() +{ + m_VersionIsSet = false; +} +int64_t TagContents::getManifestSize() const +{ + return m_ManifestSize; +} + +void TagContents::setManifestSize(int64_t value) +{ + m_ManifestSize = value; + m_ManifestSizeIsSet = true; +} + +bool TagContents::manifestSizeIsSet() const +{ + return m_ManifestSizeIsSet; +} + +void TagContents::unsetManifestSize() +{ + m_ManifestSizeIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataEntry.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataEntry.cpp new file mode 100644 index 000000000..ac49dd840 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataEntry.cpp @@ -0,0 +1,220 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateFieldMetadataEntry::UpdateFieldMetadataEntry() +{ + m_Path = utility::conversions::to_string_t(""); + m_PathIsSet = false; + m_MetadataIsSet = false; + m_Replace = false; + m_ReplaceIsSet = false; +} + +UpdateFieldMetadataEntry::~UpdateFieldMetadataEntry() +{ +} + +void UpdateFieldMetadataEntry::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateFieldMetadataEntry::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_PathIsSet) + { + + val[utility::conversions::to_string_t(U("path"))] = ModelBase::toJson(m_Path); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + if(m_ReplaceIsSet) + { + + val[utility::conversions::to_string_t(U("replace"))] = ModelBase::toJson(m_Replace); + } + + return val; +} + +bool UpdateFieldMetadataEntry::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("path")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("path"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPath; + ok &= ModelBase::fromJson(fieldValue, refVal_setPath); + setPath(refVal_setPath); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("replace")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("replace"))); + if(!fieldValue.is_null()) + { + bool refVal_setReplace; + ok &= ModelBase::fromJson(fieldValue, refVal_setReplace); + setReplace(refVal_setReplace); + + } + } + return ok; +} + +void UpdateFieldMetadataEntry::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_PathIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("path")), m_Path)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } + if(m_ReplaceIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("replace")), m_Replace)); + } +} + +bool UpdateFieldMetadataEntry::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("path")))) + { + utility::string_t refVal_setPath; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("path"))), refVal_setPath ); + setPath(refVal_setPath); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("replace")))) + { + bool refVal_setReplace; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("replace"))), refVal_setReplace ); + setReplace(refVal_setReplace); + } + return ok; +} + + +utility::string_t UpdateFieldMetadataEntry::getPath() const +{ + return m_Path; +} + + +void UpdateFieldMetadataEntry::setPath(const utility::string_t& value) +{ + m_Path = value; + m_PathIsSet = true; +} + +bool UpdateFieldMetadataEntry::pathIsSet() const +{ + return m_PathIsSet; +} + +void UpdateFieldMetadataEntry::unsetPath() +{ + m_PathIsSet = false; +} +std::map UpdateFieldMetadataEntry::getMetadata() const +{ + return m_Metadata; +} + + +void UpdateFieldMetadataEntry::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool UpdateFieldMetadataEntry::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void UpdateFieldMetadataEntry::unsetMetadata() +{ + m_MetadataIsSet = false; +} +bool UpdateFieldMetadataEntry::isReplace() const +{ + return m_Replace; +} + +void UpdateFieldMetadataEntry::setReplace(bool value) +{ + m_Replace = value; + m_ReplaceIsSet = true; +} + +bool UpdateFieldMetadataEntry::replaceIsSet() const +{ + return m_ReplaceIsSet; +} + +void UpdateFieldMetadataEntry::unsetReplace() +{ + m_ReplaceIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataRequest.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataRequest.cpp new file mode 100644 index 000000000..be6f1f38f --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataRequest.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateFieldMetadataRequest::UpdateFieldMetadataRequest() +{ + m_IdentityIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_UpdatesIsSet = false; +} + +UpdateFieldMetadataRequest::~UpdateFieldMetadataRequest() +{ +} + +void UpdateFieldMetadataRequest::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateFieldMetadataRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_UpdatesIsSet) + { + + val[utility::conversions::to_string_t(U("updates"))] = ModelBase::toJson(m_Updates); + } + + return val; +} + +bool UpdateFieldMetadataRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("updates")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("updates"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setUpdates; + ok &= ModelBase::fromJson(fieldValue, refVal_setUpdates); + setUpdates(refVal_setUpdates); + + } + } + return ok; +} + +void UpdateFieldMetadataRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_UpdatesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updates")), m_Updates)); + } +} + +bool UpdateFieldMetadataRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("updates")))) + { + std::vector> refVal_setUpdates; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updates"))), refVal_setUpdates ); + setUpdates(refVal_setUpdates); + } + return ok; +} + + +std::shared_ptr UpdateFieldMetadataRequest::getIdentity() const +{ + return m_Identity; +} + + +void UpdateFieldMetadataRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool UpdateFieldMetadataRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void UpdateFieldMetadataRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::vector UpdateFieldMetadataRequest::getId() const +{ + return m_Id; +} + + +void UpdateFieldMetadataRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool UpdateFieldMetadataRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void UpdateFieldMetadataRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t UpdateFieldMetadataRequest::getBranch() const +{ + return m_Branch; +} + + +void UpdateFieldMetadataRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool UpdateFieldMetadataRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void UpdateFieldMetadataRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::vector> UpdateFieldMetadataRequest::getUpdates() const +{ + return m_Updates; +} + + +void UpdateFieldMetadataRequest::setUpdates(const std::vector>& value) +{ + m_Updates = value; + m_UpdatesIsSet = true; +} + +bool UpdateFieldMetadataRequest::updatesIsSet() const +{ + return m_UpdatesIsSet; +} + +void UpdateFieldMetadataRequest::unsetUpdates() +{ + m_UpdatesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataResponse.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataResponse.cpp new file mode 100644 index 000000000..256f2cea0 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateFieldMetadataResponse.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateFieldMetadataResponse::UpdateFieldMetadataResponse() +{ + m_Version = 0L; + m_VersionIsSet = false; + m_FieldsIsSet = false; +} + +UpdateFieldMetadataResponse::~UpdateFieldMetadataResponse() +{ +} + +void UpdateFieldMetadataResponse::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateFieldMetadataResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_FieldsIsSet) + { + + val[utility::conversions::to_string_t(U("fields"))] = ModelBase::toJson(m_Fields); + } + + return val; +} + +bool UpdateFieldMetadataResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("fields")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fields"))); + if(!fieldValue.is_null()) + { + std::map> refVal_setFields; + ok &= ModelBase::fromJson(fieldValue, refVal_setFields); + setFields(refVal_setFields); + + } + } + return ok; +} + +void UpdateFieldMetadataResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_FieldsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fields")), m_Fields)); + } +} + +bool UpdateFieldMetadataResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("fields")))) + { + std::map> refVal_setFields; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fields"))), refVal_setFields ); + setFields(refVal_setFields); + } + return ok; +} + + +int64_t UpdateFieldMetadataResponse::getVersion() const +{ + return m_Version; +} + +void UpdateFieldMetadataResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool UpdateFieldMetadataResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void UpdateFieldMetadataResponse::unsetVersion() +{ + m_VersionIsSet = false; +} +std::map> UpdateFieldMetadataResponse::getFields() const +{ + return m_Fields; +} + + +void UpdateFieldMetadataResponse::setFields(const std::map>& value) +{ + m_Fields = value; + m_FieldsIsSet = true; +} + +bool UpdateFieldMetadataResponse::fieldsIsSet() const +{ + return m_FieldsIsSet; +} + +void UpdateFieldMetadataResponse::unsetFields() +{ + m_FieldsIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateTableRequest.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateTableRequest.cpp new file mode 100644 index 000000000..f6d1f4828 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateTableRequest.cpp @@ -0,0 +1,413 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateTableRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateTableRequest::UpdateTableRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_Predicate = utility::conversions::to_string_t(""); + m_PredicateIsSet = false; + m_UpdatesIsSet = false; + m_PropertiesIsSet = false; +} + +UpdateTableRequest::~UpdateTableRequest() +{ +} + +void UpdateTableRequest::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateTableRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_PredicateIsSet) + { + + val[utility::conversions::to_string_t(U("predicate"))] = ModelBase::toJson(m_Predicate); + } + if(m_UpdatesIsSet) + { + + val[utility::conversions::to_string_t(U("updates"))] = ModelBase::toJson(m_Updates); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool UpdateTableRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("predicate")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("predicate"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setPredicate; + ok &= ModelBase::fromJson(fieldValue, refVal_setPredicate); + setPredicate(refVal_setPredicate); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("updates")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("updates"))); + if(!fieldValue.is_null()) + { + std::vector> refVal_setUpdates; + ok &= ModelBase::fromJson(fieldValue, refVal_setUpdates); + setUpdates(refVal_setUpdates); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void UpdateTableRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_PredicateIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("predicate")), m_Predicate)); + } + if(m_UpdatesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updates")), m_Updates)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool UpdateTableRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("predicate")))) + { + utility::string_t refVal_setPredicate; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("predicate"))), refVal_setPredicate ); + setPredicate(refVal_setPredicate); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("updates")))) + { + std::vector> refVal_setUpdates; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updates"))), refVal_setUpdates ); + setUpdates(refVal_setUpdates); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +std::shared_ptr UpdateTableRequest::getIdentity() const +{ + return m_Identity; +} + + +void UpdateTableRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool UpdateTableRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void UpdateTableRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map UpdateTableRequest::getContext() const +{ + return m_Context; +} + + +void UpdateTableRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool UpdateTableRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void UpdateTableRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector UpdateTableRequest::getId() const +{ + return m_Id; +} + + +void UpdateTableRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool UpdateTableRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void UpdateTableRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t UpdateTableRequest::getBranch() const +{ + return m_Branch; +} + + +void UpdateTableRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool UpdateTableRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void UpdateTableRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +utility::string_t UpdateTableRequest::getPredicate() const +{ + return m_Predicate; +} + + +void UpdateTableRequest::setPredicate(const utility::string_t& value) +{ + m_Predicate = value; + m_PredicateIsSet = true; +} + +bool UpdateTableRequest::predicateIsSet() const +{ + return m_PredicateIsSet; +} + +void UpdateTableRequest::unsetPredicate() +{ + m_PredicateIsSet = false; +} +std::vector> UpdateTableRequest::getUpdates() const +{ + return m_Updates; +} + + +void UpdateTableRequest::setUpdates(const std::vector>& value) +{ + m_Updates = value; + m_UpdatesIsSet = true; +} + +bool UpdateTableRequest::updatesIsSet() const +{ + return m_UpdatesIsSet; +} + +void UpdateTableRequest::unsetUpdates() +{ + m_UpdatesIsSet = false; +} +std::map UpdateTableRequest::getProperties() const +{ + return m_Properties; +} + + +void UpdateTableRequest::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool UpdateTableRequest::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void UpdateTableRequest::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateTableResponse.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateTableResponse.cpp new file mode 100644 index 000000000..29c91af01 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateTableResponse.cpp @@ -0,0 +1,268 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateTableResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateTableResponse::UpdateTableResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; + m_Updated_rows = 0L; + m_Updated_rowsIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_PropertiesIsSet = false; +} + +UpdateTableResponse::~UpdateTableResponse() +{ +} + +void UpdateTableResponse::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateTableResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + if(m_Updated_rowsIsSet) + { + + val[utility::conversions::to_string_t(U("updated_rows"))] = ModelBase::toJson(m_Updated_rows); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_PropertiesIsSet) + { + + val[utility::conversions::to_string_t(U("properties"))] = ModelBase::toJson(m_Properties); + } + + return val; +} + +bool UpdateTableResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("updated_rows")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("updated_rows"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setUpdatedRows; + ok &= ModelBase::fromJson(fieldValue, refVal_setUpdatedRows); + setUpdatedRows(refVal_setUpdatedRows); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("properties")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("properties"))); + if(!fieldValue.is_null()) + { + std::map refVal_setProperties; + ok &= ModelBase::fromJson(fieldValue, refVal_setProperties); + setProperties(refVal_setProperties); + + } + } + return ok; +} + +void UpdateTableResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } + if(m_Updated_rowsIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updated_rows")), m_Updated_rows)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_PropertiesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("properties")), m_Properties)); + } +} + +bool UpdateTableResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("updated_rows")))) + { + int64_t refVal_setUpdatedRows; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updated_rows"))), refVal_setUpdatedRows ); + setUpdatedRows(refVal_setUpdatedRows); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("properties")))) + { + std::map refVal_setProperties; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("properties"))), refVal_setProperties ); + setProperties(refVal_setProperties); + } + return ok; +} + + +utility::string_t UpdateTableResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void UpdateTableResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool UpdateTableResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void UpdateTableResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} +int64_t UpdateTableResponse::getUpdatedRows() const +{ + return m_Updated_rows; +} + +void UpdateTableResponse::setUpdatedRows(int64_t value) +{ + m_Updated_rows = value; + m_Updated_rowsIsSet = true; +} + +bool UpdateTableResponse::updatedRowsIsSet() const +{ + return m_Updated_rowsIsSet; +} + +void UpdateTableResponse::unsetUpdated_rows() +{ + m_Updated_rowsIsSet = false; +} +int64_t UpdateTableResponse::getVersion() const +{ + return m_Version; +} + +void UpdateTableResponse::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool UpdateTableResponse::versionIsSet() const +{ + return m_VersionIsSet; +} + +void UpdateTableResponse::unsetVersion() +{ + m_VersionIsSet = false; +} +std::map UpdateTableResponse::getProperties() const +{ + return m_Properties; +} + + +void UpdateTableResponse::setProperties(const std::map& value) +{ + m_Properties = value; + m_PropertiesIsSet = true; +} + +bool UpdateTableResponse::propertiesIsSet() const +{ + return m_PropertiesIsSet; +} + +void UpdateTableResponse::unsetProperties() +{ + m_PropertiesIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataRequest.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataRequest.cpp new file mode 100644 index 000000000..69b13c303 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataRequest.cpp @@ -0,0 +1,316 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateTableSchemaMetadataRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateTableSchemaMetadataRequest::UpdateTableSchemaMetadataRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; + m_MetadataIsSet = false; +} + +UpdateTableSchemaMetadataRequest::~UpdateTableSchemaMetadataRequest() +{ +} + +void UpdateTableSchemaMetadataRequest::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateTableSchemaMetadataRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + + return val; +} + +bool UpdateTableSchemaMetadataRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + return ok; +} + +void UpdateTableSchemaMetadataRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } +} + +bool UpdateTableSchemaMetadataRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + return ok; +} + + +std::shared_ptr UpdateTableSchemaMetadataRequest::getIdentity() const +{ + return m_Identity; +} + + +void UpdateTableSchemaMetadataRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool UpdateTableSchemaMetadataRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void UpdateTableSchemaMetadataRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map UpdateTableSchemaMetadataRequest::getContext() const +{ + return m_Context; +} + + +void UpdateTableSchemaMetadataRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool UpdateTableSchemaMetadataRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void UpdateTableSchemaMetadataRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector UpdateTableSchemaMetadataRequest::getId() const +{ + return m_Id; +} + + +void UpdateTableSchemaMetadataRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool UpdateTableSchemaMetadataRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void UpdateTableSchemaMetadataRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t UpdateTableSchemaMetadataRequest::getBranch() const +{ + return m_Branch; +} + + +void UpdateTableSchemaMetadataRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool UpdateTableSchemaMetadataRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void UpdateTableSchemaMetadataRequest::unsetBranch() +{ + m_BranchIsSet = false; +} +std::map UpdateTableSchemaMetadataRequest::getMetadata() const +{ + return m_Metadata; +} + + +void UpdateTableSchemaMetadataRequest::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool UpdateTableSchemaMetadataRequest::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void UpdateTableSchemaMetadataRequest::unsetMetadata() +{ + m_MetadataIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataResponse.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataResponse.cpp new file mode 100644 index 000000000..b46f1b943 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateTableSchemaMetadataResponse.cpp @@ -0,0 +1,172 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateTableSchemaMetadataResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateTableSchemaMetadataResponse::UpdateTableSchemaMetadataResponse() +{ + m_MetadataIsSet = false; + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +UpdateTableSchemaMetadataResponse::~UpdateTableSchemaMetadataResponse() +{ +} + +void UpdateTableSchemaMetadataResponse::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateTableSchemaMetadataResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_MetadataIsSet) + { + + val[utility::conversions::to_string_t(U("metadata"))] = ModelBase::toJson(m_Metadata); + } + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool UpdateTableSchemaMetadataResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("metadata")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("metadata"))); + if(!fieldValue.is_null()) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata); + setMetadata(refVal_setMetadata); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void UpdateTableSchemaMetadataResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_MetadataIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("metadata")), m_Metadata)); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool UpdateTableSchemaMetadataResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("metadata")))) + { + std::map refVal_setMetadata; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("metadata"))), refVal_setMetadata ); + setMetadata(refVal_setMetadata); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +std::map UpdateTableSchemaMetadataResponse::getMetadata() const +{ + return m_Metadata; +} + + +void UpdateTableSchemaMetadataResponse::setMetadata(const std::map& value) +{ + m_Metadata = value; + m_MetadataIsSet = true; +} + +bool UpdateTableSchemaMetadataResponse::metadataIsSet() const +{ + return m_MetadataIsSet; +} + +void UpdateTableSchemaMetadataResponse::unsetMetadata() +{ + m_MetadataIsSet = false; +} +utility::string_t UpdateTableSchemaMetadataResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void UpdateTableSchemaMetadataResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool UpdateTableSchemaMetadataResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void UpdateTableSchemaMetadataResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateTableTagRequest.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateTableTagRequest.cpp new file mode 100644 index 000000000..3c0d37a84 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateTableTagRequest.cpp @@ -0,0 +1,365 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateTableTagRequest.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateTableTagRequest::UpdateTableTagRequest() +{ + m_IdentityIsSet = false; + m_ContextIsSet = false; + m_IdIsSet = false; + m_Tag = utility::conversions::to_string_t(""); + m_TagIsSet = false; + m_Version = 0L; + m_VersionIsSet = false; + m_Branch = utility::conversions::to_string_t(""); + m_BranchIsSet = false; +} + +UpdateTableTagRequest::~UpdateTableTagRequest() +{ +} + +void UpdateTableTagRequest::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateTableTagRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_IdentityIsSet) + { + + val[utility::conversions::to_string_t(U("identity"))] = ModelBase::toJson(m_Identity); + } + if(m_ContextIsSet) + { + + val[utility::conversions::to_string_t(U("context"))] = ModelBase::toJson(m_Context); + } + if(m_IdIsSet) + { + + val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id); + } + if(m_TagIsSet) + { + + val[utility::conversions::to_string_t(U("tag"))] = ModelBase::toJson(m_Tag); + } + if(m_VersionIsSet) + { + + val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version); + } + if(m_BranchIsSet) + { + + val[utility::conversions::to_string_t(U("branch"))] = ModelBase::toJson(m_Branch); + } + + return val; +} + +bool UpdateTableTagRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("identity")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("identity"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromJson(fieldValue, refVal_setIdentity); + setIdentity(refVal_setIdentity); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("context")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("context"))); + if(!fieldValue.is_null()) + { + std::map refVal_setContext; + ok &= ModelBase::fromJson(fieldValue, refVal_setContext); + setContext(refVal_setContext); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); + if(!fieldValue.is_null()) + { + std::vector refVal_setId; + ok &= ModelBase::fromJson(fieldValue, refVal_setId); + setId(refVal_setId); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("tag")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tag"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromJson(fieldValue, refVal_setTag); + setTag(refVal_setTag); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setVersion); + setVersion(refVal_setVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("branch")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("branch"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromJson(fieldValue, refVal_setBranch); + setBranch(refVal_setBranch); + + } + } + return ok; +} + +void UpdateTableTagRequest::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_IdentityIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("identity")), m_Identity)); + } + if(m_ContextIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("context")), m_Context)); + } + if(m_IdIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id)); + } + if(m_TagIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tag")), m_Tag)); + } + if(m_VersionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version)); + } + if(m_BranchIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("branch")), m_Branch)); + } +} + +bool UpdateTableTagRequest::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("identity")))) + { + std::shared_ptr refVal_setIdentity; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("identity"))), refVal_setIdentity ); + setIdentity(refVal_setIdentity); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("context")))) + { + std::map refVal_setContext; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("context"))), refVal_setContext ); + setContext(refVal_setContext); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) + { + std::vector refVal_setId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId ); + setId(refVal_setId); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("tag")))) + { + utility::string_t refVal_setTag; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tag"))), refVal_setTag ); + setTag(refVal_setTag); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("version")))) + { + int64_t refVal_setVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion ); + setVersion(refVal_setVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("branch")))) + { + utility::string_t refVal_setBranch; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("branch"))), refVal_setBranch ); + setBranch(refVal_setBranch); + } + return ok; +} + + +std::shared_ptr UpdateTableTagRequest::getIdentity() const +{ + return m_Identity; +} + + +void UpdateTableTagRequest::setIdentity(const std::shared_ptr& value) +{ + m_Identity = value; + m_IdentityIsSet = true; +} + +bool UpdateTableTagRequest::identityIsSet() const +{ + return m_IdentityIsSet; +} + +void UpdateTableTagRequest::unsetIdentity() +{ + m_IdentityIsSet = false; +} +std::map UpdateTableTagRequest::getContext() const +{ + return m_Context; +} + + +void UpdateTableTagRequest::setContext(const std::map& value) +{ + m_Context = value; + m_ContextIsSet = true; +} + +bool UpdateTableTagRequest::contextIsSet() const +{ + return m_ContextIsSet; +} + +void UpdateTableTagRequest::unsetContext() +{ + m_ContextIsSet = false; +} +std::vector UpdateTableTagRequest::getId() const +{ + return m_Id; +} + + +void UpdateTableTagRequest::setId(const std::vector& value) +{ + m_Id = value; + m_IdIsSet = true; +} + +bool UpdateTableTagRequest::idIsSet() const +{ + return m_IdIsSet; +} + +void UpdateTableTagRequest::unsetId() +{ + m_IdIsSet = false; +} +utility::string_t UpdateTableTagRequest::getTag() const +{ + return m_Tag; +} + + +void UpdateTableTagRequest::setTag(const utility::string_t& value) +{ + m_Tag = value; + m_TagIsSet = true; +} + +bool UpdateTableTagRequest::tagIsSet() const +{ + return m_TagIsSet; +} + +void UpdateTableTagRequest::unsetTag() +{ + m_TagIsSet = false; +} +int64_t UpdateTableTagRequest::getVersion() const +{ + return m_Version; +} + +void UpdateTableTagRequest::setVersion(int64_t value) +{ + m_Version = value; + m_VersionIsSet = true; +} + +bool UpdateTableTagRequest::versionIsSet() const +{ + return m_VersionIsSet; +} + +void UpdateTableTagRequest::unsetVersion() +{ + m_VersionIsSet = false; +} +utility::string_t UpdateTableTagRequest::getBranch() const +{ + return m_Branch; +} + + +void UpdateTableTagRequest::setBranch(const utility::string_t& value) +{ + m_Branch = value; + m_BranchIsSet = true; +} + +bool UpdateTableTagRequest::branchIsSet() const +{ + return m_BranchIsSet; +} + +void UpdateTableTagRequest::unsetBranch() +{ + m_BranchIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/UpdateTableTagResponse.cpp b/cpp/lance_namespace_rest_client/src/model/UpdateTableTagResponse.cpp new file mode 100644 index 000000000..e0b3b2562 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/UpdateTableTagResponse.cpp @@ -0,0 +1,124 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/UpdateTableTagResponse.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +UpdateTableTagResponse::UpdateTableTagResponse() +{ + m_Transaction_id = utility::conversions::to_string_t(""); + m_Transaction_idIsSet = false; +} + +UpdateTableTagResponse::~UpdateTableTagResponse() +{ +} + +void UpdateTableTagResponse::validate() +{ + // TODO: implement validation +} + +web::json::value UpdateTableTagResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Transaction_idIsSet) + { + + val[utility::conversions::to_string_t(U("transaction_id"))] = ModelBase::toJson(m_Transaction_id); + } + + return val; +} + +bool UpdateTableTagResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("transaction_id")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("transaction_id"))); + if(!fieldValue.is_null()) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromJson(fieldValue, refVal_setTransactionId); + setTransactionId(refVal_setTransactionId); + + } + } + return ok; +} + +void UpdateTableTagResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Transaction_idIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("transaction_id")), m_Transaction_id)); + } +} + +bool UpdateTableTagResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("transaction_id")))) + { + utility::string_t refVal_setTransactionId; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("transaction_id"))), refVal_setTransactionId ); + setTransactionId(refVal_setTransactionId); + } + return ok; +} + + +utility::string_t UpdateTableTagResponse::getTransactionId() const +{ + return m_Transaction_id; +} + + +void UpdateTableTagResponse::setTransactionId(const utility::string_t& value) +{ + m_Transaction_id = value; + m_Transaction_idIsSet = true; +} + +bool UpdateTableTagResponse::transactionIdIsSet() const +{ + return m_Transaction_idIsSet; +} + +void UpdateTableTagResponse::unsetTransaction_id() +{ + m_Transaction_idIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/lance_namespace_rest_client/src/model/VersionRange.cpp b/cpp/lance_namespace_rest_client/src/model/VersionRange.cpp new file mode 100644 index 000000000..3f3bf1904 --- /dev/null +++ b/cpp/lance_namespace_rest_client/src/model/VersionRange.cpp @@ -0,0 +1,171 @@ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.12.0. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "lance_namespace_rest_client/model/VersionRange.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +VersionRange::VersionRange() +{ + m_Start_version = 0L; + m_Start_versionIsSet = false; + m_End_version = 0L; + m_End_versionIsSet = false; +} + +VersionRange::~VersionRange() +{ +} + +void VersionRange::validate() +{ + // TODO: implement validation +} + +web::json::value VersionRange::toJson() const +{ + web::json::value val = web::json::value::object(); + if(m_Start_versionIsSet) + { + + val[utility::conversions::to_string_t(U("start_version"))] = ModelBase::toJson(m_Start_version); + } + if(m_End_versionIsSet) + { + + val[utility::conversions::to_string_t(U("end_version"))] = ModelBase::toJson(m_End_version); + } + + return val; +} + +bool VersionRange::fromJson(const web::json::value& val) +{ + bool ok = true; + if(val.has_field(utility::conversions::to_string_t(U("start_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("start_version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setStartVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setStartVersion); + setStartVersion(refVal_setStartVersion); + + } + } + if(val.has_field(utility::conversions::to_string_t(U("end_version")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("end_version"))); + if(!fieldValue.is_null()) + { + int64_t refVal_setEndVersion; + ok &= ModelBase::fromJson(fieldValue, refVal_setEndVersion); + setEndVersion(refVal_setEndVersion); + + } + } + return ok; +} + +void VersionRange::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_Start_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("start_version")), m_Start_version)); + } + if(m_End_versionIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("end_version")), m_End_version)); + } +} + +bool VersionRange::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("start_version")))) + { + int64_t refVal_setStartVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("start_version"))), refVal_setStartVersion ); + setStartVersion(refVal_setStartVersion); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("end_version")))) + { + int64_t refVal_setEndVersion; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("end_version"))), refVal_setEndVersion ); + setEndVersion(refVal_setEndVersion); + } + return ok; +} + + +int64_t VersionRange::getStartVersion() const +{ + return m_Start_version; +} + +void VersionRange::setStartVersion(int64_t value) +{ + m_Start_version = value; + m_Start_versionIsSet = true; +} + +bool VersionRange::startVersionIsSet() const +{ + return m_Start_versionIsSet; +} + +void VersionRange::unsetStart_version() +{ + m_Start_versionIsSet = false; +} +int64_t VersionRange::getEndVersion() const +{ + return m_End_version; +} + +void VersionRange::setEndVersion(int64_t value) +{ + m_End_version = value; + m_End_versionIsSet = true; +} + +bool VersionRange::endVersionIsSet() const +{ + return m_End_versionIsSet; +} + +void VersionRange::unsetEnd_version() +{ + m_End_versionIsSet = false; +} + +} +} +} +} + + diff --git a/cpp/package_release.py b/cpp/package_release.py new file mode 100644 index 000000000..d159c2188 --- /dev/null +++ b/cpp/package_release.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +from __future__ import annotations + +import argparse +import tarfile +from pathlib import Path + + +def should_skip(path: Path, build_dir: str, dist_dir: str) -> bool: + return any(part in {build_dir, dist_dir} for part in path.parts) + + +def create_archive(root: Path, output: Path, build_dir: str, dist_dir: str) -> None: + output.parent.mkdir(parents=True, exist_ok=True) + with tarfile.open(output, "w:gz") as archive: + for path in root.rglob("*"): + if path.is_dir(): + continue + rel_path = path.relative_to(root) + if should_skip(rel_path, build_dir, dist_dir): + continue + archive.add(path, arcname=rel_path.as_posix()) + + +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument("--root", default=".", help="Directory to package") + parser.add_argument("--output", required=True, help="Archive output path") + parser.add_argument("--build-dir", default="build", help="Build directory name to exclude") + parser.add_argument("--dist-dir", default="dist", help="Dist directory name to exclude") + args = parser.parse_args() + + create_archive(Path(args.root).resolve(), Path(args.output), args.build_dir, args.dist_dir) + + +if __name__ == "__main__": + main() From 4f74d31a20290068935259c2f1768ec5910974cd Mon Sep 17 00:00:00 2001 From: Ally Heev Date: Sun, 21 Jun 2026 22:11:15 +0530 Subject: [PATCH 2/2] re-export rest_client headers --- .../apis.hpp} | 32 ++-- .../lance_namespace_rest_client.hpp | 7 - .../include/lance_namespace/models.hpp | 157 ++++++++++++++++++ 3 files changed, 179 insertions(+), 17 deletions(-) rename cpp/lance_namespace/include/{lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp => lance_namespace/apis.hpp} (52%) delete mode 100644 cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp create mode 100644 cpp/lance_namespace/include/lance_namespace/models.hpp diff --git a/cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp b/cpp/lance_namespace/include/lance_namespace/apis.hpp similarity index 52% rename from cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp rename to cpp/lance_namespace/include/lance_namespace/apis.hpp index 2302f3bae..8e45e198a 100644 --- a/cpp/lance_namespace/include/lance_namespace_rest_client/lance_namespace_rest_client_wrapper.hpp +++ b/cpp/lance_namespace/include/lance_namespace/apis.hpp @@ -1,16 +1,29 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file apis.hpp + * @brief expose lance_namespace_rest_client::api as lance_namespace::apis + */ + #pragma once +#include "lance_namespace_rest_client/AnyType.h" #include "lance_namespace_rest_client/ApiClient.h" #include "lance_namespace_rest_client/ApiConfiguration.h" #include "lance_namespace_rest_client/ApiException.h" -#include "lance_namespace_rest_client/AnyType.h" -#include "lance_namespace_rest_client/HttpContent.h" -#include "lance_namespace_rest_client/IHttpBody.h" -#include "lance_namespace_rest_client/JsonBody.h" -#include "lance_namespace_rest_client/ModelBase.h" -#include "lance_namespace_rest_client/MultipartFormData.h" -#include "lance_namespace_rest_client/Object.h" - #include "lance_namespace_rest_client/api/BranchApi.h" #include "lance_namespace_rest_client/api/DataApi.h" #include "lance_namespace_rest_client/api/IndexApi.h" @@ -23,7 +36,6 @@ namespace lance_namespace { -using namespace org::openapitools::client::api; -using namespace org::openapitools::client::model; +namespace apis = org::openapitools::client::api; } // namespace lance_namespace diff --git a/cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp b/cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp deleted file mode 100644 index 41ad9a634..000000000 --- a/cpp/lance_namespace/include/lance_namespace/lance_namespace_rest_client.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#if defined(__has_include) -#if __has_include() -#include -#endif -#endif diff --git a/cpp/lance_namespace/include/lance_namespace/models.hpp b/cpp/lance_namespace/include/lance_namespace/models.hpp new file mode 100644 index 000000000..3df11b64f --- /dev/null +++ b/cpp/lance_namespace/include/lance_namespace/models.hpp @@ -0,0 +1,157 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + /** + * @file models.hpp + * @brief expose lance_namespace_rest_client::model as lance_namespace::models + */ + +#pragma once + +#include "lance_namespace_rest_client/HttpContent.h" +#include "lance_namespace_rest_client/IHttpBody.h" +#include "lance_namespace_rest_client/JsonBody.h" +#include "lance_namespace_rest_client/ModelBase.h" +#include "lance_namespace_rest_client/MultipartFormData.h" +#include "lance_namespace_rest_client/Object.h" +#include "lance_namespace_rest_client/model/AddColumnsEntry.h" +#include "lance_namespace_rest_client/model/AddVirtualColumnEntry.h" +#include "lance_namespace_rest_client/model/AddVirtualColumnOutputEntry.h" +#include "lance_namespace_rest_client/model/AlterColumnsEntry.h" +#include "lance_namespace_rest_client/model/AlterTableAddColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableAddColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableAlterColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableBackfillColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTableDropColumnsRequest.h" +#include "lance_namespace_rest_client/model/AlterTableDropColumnsResponse.h" +#include "lance_namespace_rest_client/model/AlterTransactionAction.h" +#include "lance_namespace_rest_client/model/AlterTransactionRequest.h" +#include "lance_namespace_rest_client/model/AlterTransactionResponse.h" +#include "lance_namespace_rest_client/model/AlterTransactionSetProperty.h" +#include "lance_namespace_rest_client/model/AlterTransactionSetStatus.h" +#include "lance_namespace_rest_client/model/AlterTransactionUnsetProperty.h" +#include "lance_namespace_rest_client/model/AlterVirtualColumnEntry.h" +#include "lance_namespace_rest_client/model/AnalyzeTableQueryPlanRequest.h" +#include "lance_namespace_rest_client/model/AnalyzeTableQueryPlanResponse.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesRequest.h" +#include "lance_namespace_rest_client/model/BatchCommitTablesResponse.h" +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/BatchCreateTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/BatchDeleteTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/CommitTableOperation.h" +#include "lance_namespace_rest_client/model/CommitTableResult.h" +#include "lance_namespace_rest_client/model/CountTableRowsRequest.h" +#include "lance_namespace_rest_client/model/CreateMaterializedViewRequest.h" +#include "lance_namespace_rest_client/model/CreateMaterializedViewResponse.h" +#include "lance_namespace_rest_client/model/CreateNamespaceRequest.h" +#include "lance_namespace_rest_client/model/CreateNamespaceResponse.h" +#include "lance_namespace_rest_client/model/CreateTableBranchRequest.h" +#include "lance_namespace_rest_client/model/CreateTableBranchResponse.h" +#include "lance_namespace_rest_client/model/CreateTableIndexRequest.h" +#include "lance_namespace_rest_client/model/CreateTableIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableRequest.h" +#include "lance_namespace_rest_client/model/CreateTableResponse.h" +#include "lance_namespace_rest_client/model/CreateTableScalarIndexResponse.h" +#include "lance_namespace_rest_client/model/CreateTableTagRequest.h" +#include "lance_namespace_rest_client/model/CreateTableTagResponse.h" +#include "lance_namespace_rest_client/model/CreateTableVersionRequest.h" +#include "lance_namespace_rest_client/model/CreateTableVersionResponse.h" +#include "lance_namespace_rest_client/model/DeclareTableRequest.h" +#include "lance_namespace_rest_client/model/DeclareTableResponse.h" +#include "lance_namespace_rest_client/model/DeleteFromTableRequest.h" +#include "lance_namespace_rest_client/model/DeleteFromTableResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableBranchResponse.h" +#include "lance_namespace_rest_client/model/DeleteTableTagRequest.h" +#include "lance_namespace_rest_client/model/DeleteTableTagResponse.h" +#include "lance_namespace_rest_client/model/DeregisterTableRequest.h" +#include "lance_namespace_rest_client/model/DeregisterTableResponse.h" +#include "lance_namespace_rest_client/model/DescribeNamespaceRequest.h" +#include "lance_namespace_rest_client/model/DescribeNamespaceResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableIndexStatsResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableResponse.h" +#include "lance_namespace_rest_client/model/DescribeTableVersionRequest.h" +#include "lance_namespace_rest_client/model/DescribeTableVersionResponse.h" +#include "lance_namespace_rest_client/model/DescribeTransactionRequest.h" +#include "lance_namespace_rest_client/model/DescribeTransactionResponse.h" +#include "lance_namespace_rest_client/model/DropNamespaceRequest.h" +#include "lance_namespace_rest_client/model/DropNamespaceResponse.h" +#include "lance_namespace_rest_client/model/DropTableIndexRequest.h" +#include "lance_namespace_rest_client/model/DropTableIndexResponse.h" +#include "lance_namespace_rest_client/model/DropTableRequest.h" +#include "lance_namespace_rest_client/model/DropTableResponse.h" +#include "lance_namespace_rest_client/model/ExplainTableQueryPlanRequest.h" +#include "lance_namespace_rest_client/model/ExplainTableQueryPlanResponse.h" +#include "lance_namespace_rest_client/model/GetTableStatsRequest.h" +#include "lance_namespace_rest_client/model/GetTableStatsResponse.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionRequest.h" +#include "lance_namespace_rest_client/model/GetTableTagVersionResponse.h" +#include "lance_namespace_rest_client/model/InsertIntoTableRequest.h" +#include "lance_namespace_rest_client/model/InsertIntoTableResponse.h" +#include "lance_namespace_rest_client/model/ListNamespacesRequest.h" +#include "lance_namespace_rest_client/model/ListNamespacesResponse.h" +#include "lance_namespace_rest_client/model/ListTableBranchesRequest.h" +#include "lance_namespace_rest_client/model/ListTableBranchesResponse.h" +#include "lance_namespace_rest_client/model/ListTableIndicesRequest.h" +#include "lance_namespace_rest_client/model/ListTableIndicesResponse.h" +#include "lance_namespace_rest_client/model/ListTableTagsRequest.h" +#include "lance_namespace_rest_client/model/ListTableTagsResponse.h" +#include "lance_namespace_rest_client/model/ListTableVersionsRequest.h" +#include "lance_namespace_rest_client/model/ListTableVersionsResponse.h" +#include "lance_namespace_rest_client/model/ListTablesRequest.h" +#include "lance_namespace_rest_client/model/ListTablesResponse.h" +#include "lance_namespace_rest_client/model/MatchQuery.h" +#include "lance_namespace_rest_client/model/MaterializedViewUdtfEntry.h" +#include "lance_namespace_rest_client/model/NamespaceExistsRequest.h" +#include "lance_namespace_rest_client/model/PartitionField.h" +#include "lance_namespace_rest_client/model/PartitionSpec.h" +#include "lance_namespace_rest_client/model/PartitionTransform.h" +#include "lance_namespace_rest_client/model/PhraseQuery.h" +#include "lance_namespace_rest_client/model/QueryTableRequest.h" +#include "lance_namespace_rest_client/model/QueryTableRequest_columns.h" +#include "lance_namespace_rest_client/model/QueryTableRequest_full_text_query.h" +#include "lance_namespace_rest_client/model/QueryTableRequest_vector.h" +#include "lance_namespace_rest_client/model/RefreshMaterializedViewRequest.h" +#include "lance_namespace_rest_client/model/RefreshMaterializedViewResponse.h" +#include "lance_namespace_rest_client/model/RegisterTableRequest.h" +#include "lance_namespace_rest_client/model/RegisterTableResponse.h" +#include "lance_namespace_rest_client/model/RenameTableRequest.h" +#include "lance_namespace_rest_client/model/RenameTableResponse.h" +#include "lance_namespace_rest_client/model/RestoreTableRequest.h" +#include "lance_namespace_rest_client/model/RestoreTableResponse.h" +#include "lance_namespace_rest_client/model/TableBasicStats.h" +#include "lance_namespace_rest_client/model/TableExistsRequest.h" +#include "lance_namespace_rest_client/model/TableVersion.h" +#include "lance_namespace_rest_client/model/TagContents.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataEntry.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataRequest.h" +#include "lance_namespace_rest_client/model/UpdateFieldMetadataResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableSchemaMetadataRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableSchemaMetadataResponse.h" +#include "lance_namespace_rest_client/model/UpdateTableTagRequest.h" +#include "lance_namespace_rest_client/model/UpdateTableTagResponse.h" +#include "lance_namespace_rest_client/model/VersionRange.h" +namespace lance_namespace { + +namespace models = org::openapitools::client::model; + +} // namespace lance_namespace