26#include <unordered_map>
30#include "iceberg/catalog/rest/iceberg_rest_export.h"
31#include "iceberg/result.h"
35#include "iceberg/util/macros.h"
40namespace iceberg::rest {
44 std::unordered_map<std::string, std::string> defaults;
45 std::unordered_map<std::string, std::string> overrides;
46 std::vector<Endpoint> endpoints;
59 std::vector<std::string> stack;
63 if (message.empty() || type.empty()) {
64 return ValidationFailed(
"Invalid error response: missing required fields");
67 if (code < 400 || code > 600) {
68 return ValidationFailed(
69 "Invalid error response: code {} is out of range [400, 600]", code);
82 std::unordered_map<std::string, std::string> properties;
92 std::vector<std::string> removals;
93 std::unordered_map<std::string, std::string> updates;
97 for (
const auto& key : removals) {
98 if (updates.contains(key)) {
99 return ValidationFailed(
"Duplicate key to update and remove: {}", key);
111 std::string metadata_location;
112 bool overwrite =
false;
117 return ValidationFailed(
"Missing table name");
120 if (metadata_location.empty()) {
121 return ValidationFailed(
"Empty metadata location");
137 ICEBERG_RETURN_UNEXPECTED(source.Validate());
138 ICEBERG_RETURN_UNEXPECTED(destination.
Validate());
148 std::string location;
149 std::shared_ptr<Schema> schema;
150 std::shared_ptr<PartitionSpec> partition_spec;
151 std::shared_ptr<SortOrder> write_order;
152 bool stage_create =
false;
153 std::unordered_map<std::string, std::string> properties;
158 return ValidationFailed(
"Missing table name");
161 return ValidationFailed(
"Missing schema");
174 std::string metadata_location;
175 std::shared_ptr<TableMetadata> metadata;
176 std::unordered_map<std::string, std::string> config;
182 return ValidationFailed(
"Invalid metadata: null");
199 std::vector<Namespace> namespaces;
210 std::unordered_map<std::string, std::string> properties;
221 std::unordered_map<std::string, std::string> properties;
231 std::vector<std::string> updated;
232 std::vector<std::string> removed;
233 std::vector<std::string> missing;
244 std::vector<TableIdentifier> identifiers;
255 std::vector<std::shared_ptr<TableRequirement>> requirements;
256 std::vector<std::shared_ptr<TableUpdate>> updates;
266 std::string metadata_location;
267 std::shared_ptr<TableMetadata> metadata;
271 if (metadata_location.empty()) {
272 return ValidationFailed(
"Invalid metadata location: empty");
275 return ValidationFailed(
"Invalid metadata: null");
285 std::string access_token;
286 std::string token_type;
287 std::optional<int64_t> expires_in_secs;
288 std::string issued_token_type;
289 std::string refresh_token;
293 Status Validate()
const;
A namespace in a catalog.
Definition table_identifier.h:35
Identifies a table in iceberg catalog.
Definition table_identifier.h:46
Status Validate() const
Validates the TableIdentifier.
Definition table_identifier.h:55
Server-provided configuration for the catalog.
Definition types.h:43
Status Validate() const
Validates the CatalogConfig.
Definition types.h:49
Request to commit changes to a table.
Definition types.h:253
Status Validate() const
Validates the CommitTableRequest.
Definition types.h:259
Response from committing changes to a table.
Definition types.h:265
Status Validate() const
Validates the CommitTableResponse.
Definition types.h:270
Request to create a namespace.
Definition types.h:80
Status Validate() const
Validates the CreateNamespaceRequest.
Definition types.h:85
Response body after creating a namespace.
Definition types.h:208
Status Validate() const
Validates the CreateNamespaceResponse.
Definition types.h:213
Request to create a table.
Definition types.h:146
Status Validate() const
Validates the CreateTableRequest.
Definition types.h:156
JSON error payload returned in a response with further details on the error.
Definition types.h:55
Status Validate() const
Validates the ErrorResponse.
Definition types.h:62
Response body for loading namespace properties.
Definition types.h:219
Status Validate() const
Validates the GetNamespaceResponse.
Definition types.h:224
Response body for listing namespaces.
Definition types.h:197
Status Validate() const
Validates the ListNamespacesResponse.
Definition types.h:202
Response body for listing tables in a namespace.
Definition types.h:242
Status Validate() const
Validates the ListTablesResponse.
Definition types.h:247
Result body for table create/load/register APIs.
Definition types.h:173
Status Validate() const
Validates the LoadTableResult.
Definition types.h:180
Response from an OAuth2 token endpoint.
Definition types.h:284
Request to register a table.
Definition types.h:109
Status Validate() const
Validates the RegisterTableRequest.
Definition types.h:115
Update or delete namespace properties request.
Definition types.h:91
Status Validate() const
Validates the UpdateNamespacePropertiesRequest.
Definition types.h:96
Response body after updating namespace properties.
Definition types.h:230
Status Validate() const
Validates the UpdateNamespacePropertiesResponse.
Definition types.h:236
std::string PageToken
An opaque token that allows clients to make use of pagination for list APIs.
Definition types.h:170