// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { createdAt: "created_at", credentialStatus: "credential_status", maintenanceConfig: "maintenance_config", maxSnapshotAge: "max_snapshot_age", metadataLocation: "metadata_location", minSnapshotsToKeep: "min_snapshots_to_keep", namespaceUuid: "namespace_uuid", namespaceUuids: "namespace_uuids", nextPageToken: "next_page_token", snapshotExpiration: "snapshot_expiration", tableUuid: "table_uuid", tableUuids: "table_uuids", targetSizeMb: "target_size_mb", updatedAt: "updated_at", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class InvalidCredential extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidCredential", { code: S.Number, message: S.String, }), [{ code: 30004 }, { code: 30005 }], ) {} export class InvalidRoute extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidRoute", { code: S.Number, message: S.String, }), [{ code: 7003 }], ) {} export class NoSuchBucket extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("NoSuchBucket", { code: S.Number, message: S.String, }), [{ code: 10006 }, { code: 40406 }], ) {} export class TableNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("TableNotFound", { code: S.Number, message: S.String, }), [{ code: 10001 }, { code: 40403 }], ) {} export class WarehouseInactive extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("WarehouseInactive", { code: S.Number, message: S.String, }), [{ code: 40402 }], ) {} export class WarehouseNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("WarehouseNotFound", { code: S.Number, message: S.String, }), [{ code: 40401 }], ) {} export interface CreateCredentialRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; /** Provides the Cloudflare API token for accessing R2. */ token: string; } export const CreateCredentialRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), token: S.String, }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/credential", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateCredentialRequest", }) as any as S.Schema; export type CreateCredentialResponse = unknown; export const CreateCredentialResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateCredentialResponse", }) as any as S.Schema; export interface DisableR2DataCatalogRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; } export const DisableR2DataCatalogRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/disable", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DisableR2DataCatalogRequest", }) as any as S.Schema; export interface DisableR2DataCatalogResponse {} export const DisableR2DataCatalogResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DisableR2DataCatalogResponse", }) as any as S.Schema; export interface EnableR2DataCatalogRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; } export const EnableR2DataCatalogRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/enable", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EnableR2DataCatalogRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface EnableR2DataCatalogResponse { /** Use this to uniquely identify the activated catalog. */ id: string; /** Specifies the name of the activated catalog. */ name: string; } export const EnableR2DataCatalogResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EnableR2DataCatalogResponse", }) as any as S.Schema; export interface GetMaintenanceConfigRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; } export const GetMaintenanceConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/maintenance-configs", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMaintenanceConfigRequest", }) as any as S.Schema; export type MaintenanceConfigsGetResponseCredentialStatus = | "present" | "absent"; export const MaintenanceConfigsGetResponseCredentialStatus = /*@__PURE__*/ S.String; export type MaintenanceConfigsGetResponseMaintenanceConfigCompactionState = | "enabled" | "disabled"; export const MaintenanceConfigsGetResponseMaintenanceConfigCompactionState = /*@__PURE__*/ S.String; export type MaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const MaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface MaintenanceConfigsGetResponseMaintenanceConfigCompaction { /** Specifies the state of maintenance operations. */ state: MaintenanceConfigsGetResponseMaintenanceConfigCompactionState; /** Sets the target file size for compaction in megabytes. Defaults to "128". */ targetSizeMb: MaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb; } export const MaintenanceConfigsGetResponseMaintenanceConfigCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: MaintenanceConfigsGetResponseMaintenanceConfigCompactionState, targetSizeMb: MaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), }), ).annotate({ identifier: "MaintenanceConfigsGetResponseMaintenanceConfigCompaction", }) as any as S.Schema; export type MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState = | "enabled" | "disabled"; export const MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState = /*@__PURE__*/ S.String; export interface MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration { /** Specifies the maximum age for snapshots. The system deletes snapshots older than this age. */ maxSnapshotAge: string; /** Specifies the minimum number of snapshots to retain. Defaults to 100. */ minSnapshotsToKeep: number; /** Specifies the state of maintenance operations. */ state: MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState; } export const MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.String.pipe(T.Body("max_snapshot_age")), minSnapshotsToKeep: S.Number.pipe(T.Body("min_snapshots_to_keep")), state: MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState, }), ).annotate({ identifier: "MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration", }) as any as S.Schema; export interface MaintenanceConfigsGetResponseMaintenanceConfig { /** Configures compaction for catalog maintenance. */ compaction?: MaintenanceConfigsGetResponseMaintenanceConfigCompaction | null; /** Configures snapshot expiration settings. */ snapshotExpiration?: MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration | null; } export const MaintenanceConfigsGetResponseMaintenanceConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ compaction: S.optional( S.NullOr(MaintenanceConfigsGetResponseMaintenanceConfigCompaction), ), snapshotExpiration: S.optional( S.NullOr( MaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration, ).pipe(T.Body("snapshot_expiration")), ), }), ).annotate({ identifier: "MaintenanceConfigsGetResponseMaintenanceConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetMaintenanceConfigResponse { /** Shows the credential configuration status. */ credentialStatus: MaintenanceConfigsGetResponseCredentialStatus; /** Configures maintenance for the catalog. */ maintenanceConfig: MaintenanceConfigsGetResponseMaintenanceConfig; } export const GetMaintenanceConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ credentialStatus: MaintenanceConfigsGetResponseCredentialStatus.pipe( T.Body("credential_status"), ), maintenanceConfig: MaintenanceConfigsGetResponseMaintenanceConfig.pipe( T.Body("maintenance_config"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMaintenanceConfigResponse", }) as any as S.Schema; export interface GetNamespaceTableMaintenanceConfigRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; namespace: string; tableName: string; } export const GetNamespaceTableMaintenanceConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), namespace: S.String.pipe(T.Label()), tableName: S.String.pipe(T.Label("table_name")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetNamespaceTableMaintenanceConfigRequest", }) as any as S.Schema; export type NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionState = | "enabled" | "disabled"; export const NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionState = /*@__PURE__*/ S.String; export type NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompaction { /** Specifies the state of maintenance operations. */ state: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionState; /** Sets the target file size for compaction in megabytes. Defaults to "128". */ targetSizeMb: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb; } export const NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionState, targetSizeMb: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompaction", }) as any as S.Schema; export type NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState = | "enabled" | "disabled"; export const NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState = /*@__PURE__*/ S.String; export interface NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration { /** Specifies the maximum age for snapshots. The system deletes snapshots older than this age. */ maxSnapshotAge: string; /** Specifies the minimum number of snapshots to retain. Defaults to 100. */ minSnapshotsToKeep: number; /** Specifies the state of maintenance operations. */ state: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState; } export const NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.String.pipe(T.Body("max_snapshot_age")), minSnapshotsToKeep: S.Number.pipe(T.Body("min_snapshots_to_keep")), state: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpirationState, }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration", }) as any as S.Schema; export interface NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfig { /** Configures compaction settings for table optimization. */ compaction?: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompaction | null; /** Configures snapshot expiration settings. */ snapshotExpiration?: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration | null; } export const NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ compaction: S.optional( S.NullOr( NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigCompaction, ), ), snapshotExpiration: S.optional( S.NullOr( NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfigSnapshotExpiration, ).pipe(T.Body("snapshot_expiration")), ), }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetNamespaceTableMaintenanceConfigResponse { /** Configures maintenance for the table. */ maintenanceConfig: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfig; } export const GetNamespaceTableMaintenanceConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ maintenanceConfig: NamespacesTablesMaintenanceConfigsGetResponseMaintenanceConfig.pipe( T.Body("maintenance_config"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetNamespaceTableMaintenanceConfigResponse", }) as any as S.Schema; export interface GetR2DataCatalogRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; } export const GetR2DataCatalogRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetR2DataCatalogRequest", }) as any as S.Schema; export type GetResponseStatus = "active" | "inactive"; export const GetResponseStatus = /*@__PURE__*/ S.String; export type GetResponseCredentialStatus = "present" | "absent"; export const GetResponseCredentialStatus = /*@__PURE__*/ S.String; export type GetResponseMaintenanceConfigCompactionState = | "enabled" | "disabled"; export const GetResponseMaintenanceConfigCompactionState = /*@__PURE__*/ S.String; export type GetResponseMaintenanceConfigCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const GetResponseMaintenanceConfigCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface GetResponseMaintenanceConfigCompaction { /** Specifies the state of maintenance operations. */ state: GetResponseMaintenanceConfigCompactionState; /** Sets the target file size for compaction in megabytes. Defaults to "128". */ targetSizeMb: GetResponseMaintenanceConfigCompactionTargetSizeMb; } export const GetResponseMaintenanceConfigCompaction = /*@__PURE__*/ S.suspend( () => S.Struct({ state: GetResponseMaintenanceConfigCompactionState, targetSizeMb: GetResponseMaintenanceConfigCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), }), ).annotate({ identifier: "GetResponseMaintenanceConfigCompaction", }) as any as S.Schema; export type GetResponseMaintenanceConfigSnapshotExpirationState = | "enabled" | "disabled"; export const GetResponseMaintenanceConfigSnapshotExpirationState = /*@__PURE__*/ S.String; export interface GetResponseMaintenanceConfigSnapshotExpiration { /** Specifies the maximum age for snapshots. The system deletes snapshots older than this age. */ maxSnapshotAge: string; /** Specifies the minimum number of snapshots to retain. Defaults to 100. */ minSnapshotsToKeep: number; /** Specifies the state of maintenance operations. */ state: GetResponseMaintenanceConfigSnapshotExpirationState; } export const GetResponseMaintenanceConfigSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.String.pipe(T.Body("max_snapshot_age")), minSnapshotsToKeep: S.Number.pipe(T.Body("min_snapshots_to_keep")), state: GetResponseMaintenanceConfigSnapshotExpirationState, }), ).annotate({ identifier: "GetResponseMaintenanceConfigSnapshotExpiration", }) as any as S.Schema; export interface GetResponseMaintenanceConfig { /** Configures compaction for catalog maintenance. */ compaction?: GetResponseMaintenanceConfigCompaction | null; /** Configures snapshot expiration settings. */ snapshotExpiration?: GetResponseMaintenanceConfigSnapshotExpiration | null; } export const GetResponseMaintenanceConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ compaction: S.optional(S.NullOr(GetResponseMaintenanceConfigCompaction)), snapshotExpiration: S.optional( S.NullOr(GetResponseMaintenanceConfigSnapshotExpiration).pipe( T.Body("snapshot_expiration"), ), ), }), ).annotate({ identifier: "GetResponseMaintenanceConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetR2DataCatalogResponse { /** Use this to uniquely identify the catalog. */ id: string; /** Specifies the associated R2 bucket name. */ bucket: string; /** Specifies the catalog name (generated from account and bucket name). */ name: string; /** Indicates the status of the catalog. */ status: GetResponseStatus; /** Shows the credential configuration status. */ credentialStatus?: GetResponseCredentialStatus | null; /** Configures maintenance for the catalog. */ maintenanceConfig?: GetResponseMaintenanceConfig | null; } export const GetR2DataCatalogResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, bucket: S.String, name: S.String, status: GetResponseStatus, credentialStatus: S.optional( S.NullOr(GetResponseCredentialStatus).pipe(T.Body("credential_status")), ), maintenanceConfig: S.optional( S.NullOr(GetResponseMaintenanceConfig).pipe(T.Body("maintenance_config")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetR2DataCatalogResponse", }) as any as S.Schema; export interface ListNamespacesRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; /** Maximum number of namespaces to return per page. */ pageSize?: number; /** Opaque pagination token from a previous response. */ pageToken?: string; /** Parent namespace to filter by. Only returns direct children of this namespace. */ parent?: string; /** Whether to include additional metadata (timestamps). */ returnDetails?: boolean; /** Whether to include namespace UUIDs in the response. */ returnUuids?: boolean; } export const ListNamespacesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), pageSize: S.optional(S.Number.pipe(T.Query("page_size"))), pageToken: S.optional(S.String.pipe(T.Query("page_token"))), parent: S.optional(S.String.pipe(T.Query())), returnDetails: S.optional(S.Boolean.pipe(T.Query("return_details"))), returnUuids: S.optional(S.Boolean.pipe(T.Query("return_uuids"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListNamespacesRequest", }) as any as S.Schema; export type NamespacesListResponseNamespacesItemList = Array; export const NamespacesListResponseNamespacesItemList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type NamespacesListResponseNamespacesList = Array; export const NamespacesListResponseNamespacesList = /*@__PURE__*/ S.Array( NamespacesListResponseNamespacesItemList, ) as any as S.Schema; export type NamespacesListResponseDetailsItemNamespaceList = Array; export const NamespacesListResponseDetailsItemNamespaceList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface NamespacesListResponseDetailsItem { /** Specifies the hierarchical namespace parts as an array of strings. */ namespace: NamespacesListResponseDetailsItemNamespaceList; /** Contains the UUID that persists across renames. */ namespaceUuid: string; /** Indicates the creation timestamp in ISO 8601 format. */ createdAt?: string | null; /** Shows the last update timestamp in ISO 8601 format. Null if never updated. */ updatedAt?: string | null; } export const NamespacesListResponseDetailsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ namespace: NamespacesListResponseDetailsItemNamespaceList, namespaceUuid: S.String.pipe(T.Body("namespace_uuid")), createdAt: S.optional(S.NullOr(S.String).pipe(T.Body("created_at"))), updatedAt: S.optional(S.NullOr(S.String).pipe(T.Body("updated_at"))), }), ).annotate({ identifier: "NamespacesListResponseDetailsItem", }) as any as S.Schema; export type NamespacesListResponseDetailsList = Array; export const NamespacesListResponseDetailsList = /*@__PURE__*/ S.Array( NamespacesListResponseDetailsItem, ) as any as S.Schema; export type NamespacesListResponseNamespaceUuidsList = Array; export const NamespacesListResponseNamespaceUuidsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListNamespacesResponse { /** Lists namespaces in the catalog. */ namespaces: NamespacesListResponseNamespacesList; /** Contains detailed metadata for each namespace when return_details is true. */ details?: NamespacesListResponseDetailsList | null; /** Contains UUIDs for each namespace when return_uuids is true. */ namespaceUuids?: NamespacesListResponseNamespaceUuidsList | null; /** Use this opaque token to fetch the next page of results. */ nextPageToken?: string | null; } export const ListNamespacesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ namespaces: NamespacesListResponseNamespacesList, details: S.optional(S.NullOr(NamespacesListResponseDetailsList)), namespaceUuids: S.optional( S.NullOr(NamespacesListResponseNamespaceUuidsList).pipe( T.Body("namespace_uuids"), ), ), nextPageToken: S.optional( S.NullOr(S.String).pipe(T.Body("next_page_token")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListNamespacesResponse", }) as any as S.Schema; export interface ListNamespaceTablesRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; namespace: string; /** Maximum number of tables to return per page. */ pageSize?: number; /** Opaque pagination token from a previous response. */ pageToken?: string; /** Whether to include additional metadata (timestamps, locations). */ returnDetails?: boolean; /** Whether to include table UUIDs in the response. */ returnUuids?: boolean; } export const ListNamespaceTablesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), namespace: S.String.pipe(T.Label()), pageSize: S.optional(S.Number.pipe(T.Query("page_size"))), pageToken: S.optional(S.String.pipe(T.Query("page_token"))), returnDetails: S.optional(S.Boolean.pipe(T.Query("return_details"))), returnUuids: S.optional(S.Boolean.pipe(T.Query("return_uuids"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListNamespaceTablesRequest", }) as any as S.Schema; export type NamespacesTablesListResponseIdentifiersItemNamespaceList = Array; export const NamespacesTablesListResponseIdentifiersItemNamespaceList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface NamespacesTablesListResponseIdentifiersItem { /** Specifies the table name. */ name: string; /** Specifies the hierarchical namespace parts as an array of strings. */ namespace: NamespacesTablesListResponseIdentifiersItemNamespaceList; } export const NamespacesTablesListResponseIdentifiersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, namespace: NamespacesTablesListResponseIdentifiersItemNamespaceList, }), ).annotate({ identifier: "NamespacesTablesListResponseIdentifiersItem", }) as any as S.Schema; export type NamespacesTablesListResponseIdentifiersList = Array; export const NamespacesTablesListResponseIdentifiersList = /*@__PURE__*/ S.Array( NamespacesTablesListResponseIdentifiersItem, ) as any as S.Schema; export type NamespacesTablesListResponseDetailsItemIdentifierNamespaceList = Array; export const NamespacesTablesListResponseDetailsItemIdentifierNamespaceList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface NamespacesTablesListResponseDetailsItemIdentifier { /** Specifies the table name. */ name: string; /** Specifies the hierarchical namespace parts as an array of strings. */ namespace: NamespacesTablesListResponseDetailsItemIdentifierNamespaceList; } export const NamespacesTablesListResponseDetailsItemIdentifier = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, namespace: NamespacesTablesListResponseDetailsItemIdentifierNamespaceList, }), ).annotate({ identifier: "NamespacesTablesListResponseDetailsItemIdentifier", }) as any as S.Schema; export interface NamespacesTablesListResponseDetailsItem { /** Specifies a unique table identifier within a catalog. */ identifier: NamespacesTablesListResponseDetailsItemIdentifier; /** Contains the UUID that persists across renames. */ tableUuid: string; /** Indicates the creation timestamp in ISO 8601 format. */ createdAt?: string | null; /** Specifies the base S3 URI for table storage location. */ location?: string | null; /** Contains the S3 URI to table metadata file. Null for staged tables. */ metadataLocation?: string | null; /** Shows the last update timestamp in ISO 8601 format. Null if never updated. */ updatedAt?: string | null; } export const NamespacesTablesListResponseDetailsItem = /*@__PURE__*/ S.suspend( () => S.Struct({ identifier: NamespacesTablesListResponseDetailsItemIdentifier, tableUuid: S.String.pipe(T.Body("table_uuid")), createdAt: S.optional(S.NullOr(S.String).pipe(T.Body("created_at"))), location: S.optional(S.NullOr(S.String)), metadataLocation: S.optional( S.NullOr(S.String).pipe(T.Body("metadata_location")), ), updatedAt: S.optional(S.NullOr(S.String).pipe(T.Body("updated_at"))), }), ).annotate({ identifier: "NamespacesTablesListResponseDetailsItem", }) as any as S.Schema; export type NamespacesTablesListResponseDetailsList = Array; export const NamespacesTablesListResponseDetailsList = /*@__PURE__*/ S.Array( NamespacesTablesListResponseDetailsItem, ) as any as S.Schema; export type NamespacesTablesListResponseTableUuidsList = Array; export const NamespacesTablesListResponseTableUuidsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListNamespaceTablesResponse { /** Lists tables in the namespace. */ identifiers: NamespacesTablesListResponseIdentifiersList; /** Contains detailed metadata for each table when return_details is true. */ details?: NamespacesTablesListResponseDetailsList | null; /** Use this opaque token to fetch the next page of results. */ nextPageToken?: string | null; /** Contains UUIDs for each table when return_uuids is true. */ tableUuids?: NamespacesTablesListResponseTableUuidsList | null; } export const ListNamespaceTablesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ identifiers: NamespacesTablesListResponseIdentifiersList, details: S.optional(S.NullOr(NamespacesTablesListResponseDetailsList)), nextPageToken: S.optional( S.NullOr(S.String).pipe(T.Body("next_page_token")), ), tableUuids: S.optional( S.NullOr(NamespacesTablesListResponseTableUuidsList).pipe( T.Body("table_uuids"), ), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListNamespaceTablesResponse", }) as any as S.Schema; export interface ListR2DataCatalogsRequest { /** Use this to identify the account. */ accountId: string; } export const ListR2DataCatalogsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/r2-catalog", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListR2DataCatalogsRequest", }) as any as S.Schema; export type ListResponseWarehousesItemStatus = "active" | "inactive"; export const ListResponseWarehousesItemStatus = /*@__PURE__*/ S.String; export type ListResponseWarehousesItemCredentialStatus = "present" | "absent"; export const ListResponseWarehousesItemCredentialStatus = /*@__PURE__*/ S.String; export type ListResponseWarehousesItemMaintenanceConfigCompactionState = | "enabled" | "disabled"; export const ListResponseWarehousesItemMaintenanceConfigCompactionState = /*@__PURE__*/ S.String; export type ListResponseWarehousesItemMaintenanceConfigCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const ListResponseWarehousesItemMaintenanceConfigCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface ListResponseWarehousesItemMaintenanceConfigCompaction { /** Specifies the state of maintenance operations. */ state: ListResponseWarehousesItemMaintenanceConfigCompactionState; /** Sets the target file size for compaction in megabytes. Defaults to "128". */ targetSizeMb: ListResponseWarehousesItemMaintenanceConfigCompactionTargetSizeMb; } export const ListResponseWarehousesItemMaintenanceConfigCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: ListResponseWarehousesItemMaintenanceConfigCompactionState, targetSizeMb: ListResponseWarehousesItemMaintenanceConfigCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), }), ).annotate({ identifier: "ListResponseWarehousesItemMaintenanceConfigCompaction", }) as any as S.Schema; export type ListResponseWarehousesItemMaintenanceConfigSnapshotExpirationState = | "enabled" | "disabled"; export const ListResponseWarehousesItemMaintenanceConfigSnapshotExpirationState = /*@__PURE__*/ S.String; export interface ListResponseWarehousesItemMaintenanceConfigSnapshotExpiration { /** Specifies the maximum age for snapshots. The system deletes snapshots older than this age. */ maxSnapshotAge: string; /** Specifies the minimum number of snapshots to retain. Defaults to 100. */ minSnapshotsToKeep: number; /** Specifies the state of maintenance operations. */ state: ListResponseWarehousesItemMaintenanceConfigSnapshotExpirationState; } export const ListResponseWarehousesItemMaintenanceConfigSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.String.pipe(T.Body("max_snapshot_age")), minSnapshotsToKeep: S.Number.pipe(T.Body("min_snapshots_to_keep")), state: ListResponseWarehousesItemMaintenanceConfigSnapshotExpirationState, }), ).annotate({ identifier: "ListResponseWarehousesItemMaintenanceConfigSnapshotExpiration", }) as any as S.Schema; export interface ListResponseWarehousesItemMaintenanceConfig { /** Configures compaction for catalog maintenance. */ compaction?: ListResponseWarehousesItemMaintenanceConfigCompaction | null; /** Configures snapshot expiration settings. */ snapshotExpiration?: ListResponseWarehousesItemMaintenanceConfigSnapshotExpiration | null; } export const ListResponseWarehousesItemMaintenanceConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ compaction: S.optional( S.NullOr(ListResponseWarehousesItemMaintenanceConfigCompaction), ), snapshotExpiration: S.optional( S.NullOr( ListResponseWarehousesItemMaintenanceConfigSnapshotExpiration, ).pipe(T.Body("snapshot_expiration")), ), }), ).annotate({ identifier: "ListResponseWarehousesItemMaintenanceConfig", }) as any as S.Schema; export interface ListResponseWarehousesItem { /** Use this to uniquely identify the catalog. */ id: string; /** Specifies the associated R2 bucket name. */ bucket: string; /** Specifies the catalog name (generated from account and bucket name). */ name: string; /** Indicates the status of the catalog. */ status: ListResponseWarehousesItemStatus; /** Shows the credential configuration status. */ credentialStatus?: ListResponseWarehousesItemCredentialStatus | null; /** Configures maintenance for the catalog. */ maintenanceConfig?: ListResponseWarehousesItemMaintenanceConfig | null; } export const ListResponseWarehousesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, bucket: S.String, name: S.String, status: ListResponseWarehousesItemStatus, credentialStatus: S.optional( S.NullOr(ListResponseWarehousesItemCredentialStatus).pipe( T.Body("credential_status"), ), ), maintenanceConfig: S.optional( S.NullOr(ListResponseWarehousesItemMaintenanceConfig).pipe( T.Body("maintenance_config"), ), ), }), ).annotate({ identifier: "ListResponseWarehousesItem", }) as any as S.Schema; export type ListResponseWarehousesList = Array; export const ListResponseWarehousesList = /*@__PURE__*/ S.Array( ListResponseWarehousesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListR2DataCatalogsResponse { /** Lists catalogs in the account. */ warehouses: ListResponseWarehousesList; } export const ListR2DataCatalogsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ warehouses: ListResponseWarehousesList, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListR2DataCatalogsResponse", }) as any as S.Schema; export type MaintenanceConfigsUpdateRequestCompactionState = | "enabled" | "disabled"; export const MaintenanceConfigsUpdateRequestCompactionState = /*@__PURE__*/ S.String; export type MaintenanceConfigsUpdateRequestCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const MaintenanceConfigsUpdateRequestCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface MaintenanceConfigsUpdateRequestCompaction { /** Updates the state optionally. */ state?: MaintenanceConfigsUpdateRequestCompactionState | (string & {}); /** Updates the target file size optionally. */ targetSizeMb?: | MaintenanceConfigsUpdateRequestCompactionTargetSizeMb | (string & {}); } export const MaintenanceConfigsUpdateRequestCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: S.optional(MaintenanceConfigsUpdateRequestCompactionState), targetSizeMb: S.optional( MaintenanceConfigsUpdateRequestCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), ), }), ).annotate({ identifier: "MaintenanceConfigsUpdateRequestCompaction", }) as any as S.Schema; export type MaintenanceConfigsUpdateRequestSnapshotExpirationState = | "enabled" | "disabled"; export const MaintenanceConfigsUpdateRequestSnapshotExpirationState = /*@__PURE__*/ S.String; export interface MaintenanceConfigsUpdateRequestSnapshotExpiration { /** Updates the maximum age for snapshots optionally. */ maxSnapshotAge?: string; /** Updates the minimum number of snapshots to retain optionally. */ minSnapshotsToKeep?: number; /** Updates the state optionally. */ state?: | MaintenanceConfigsUpdateRequestSnapshotExpirationState | (string & {}); } export const MaintenanceConfigsUpdateRequestSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.optional(S.String.pipe(T.Body("max_snapshot_age"))), minSnapshotsToKeep: S.optional( S.Number.pipe(T.Body("min_snapshots_to_keep")), ), state: S.optional(MaintenanceConfigsUpdateRequestSnapshotExpirationState), }), ).annotate({ identifier: "MaintenanceConfigsUpdateRequestSnapshotExpiration", }) as any as S.Schema; export interface UpdateMaintenanceConfigRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; /** Updates compaction configuration (all fields optional). */ compaction?: MaintenanceConfigsUpdateRequestCompaction; /** Updates snapshot expiration configuration (all fields optional). */ snapshotExpiration?: MaintenanceConfigsUpdateRequestSnapshotExpiration; } export const UpdateMaintenanceConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), compaction: S.optional(MaintenanceConfigsUpdateRequestCompaction), snapshotExpiration: S.optional( MaintenanceConfigsUpdateRequestSnapshotExpiration.pipe( T.Body("snapshot_expiration"), ), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/maintenance-configs", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateMaintenanceConfigRequest", }) as any as S.Schema; export type MaintenanceConfigsUpdateResponseCompactionState = | "enabled" | "disabled"; export const MaintenanceConfigsUpdateResponseCompactionState = /*@__PURE__*/ S.String; export type MaintenanceConfigsUpdateResponseCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const MaintenanceConfigsUpdateResponseCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface MaintenanceConfigsUpdateResponseCompaction { /** Specifies the state of maintenance operations. */ state: MaintenanceConfigsUpdateResponseCompactionState; /** Sets the target file size for compaction in megabytes. Defaults to "128". */ targetSizeMb: MaintenanceConfigsUpdateResponseCompactionTargetSizeMb; } export const MaintenanceConfigsUpdateResponseCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: MaintenanceConfigsUpdateResponseCompactionState, targetSizeMb: MaintenanceConfigsUpdateResponseCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), }), ).annotate({ identifier: "MaintenanceConfigsUpdateResponseCompaction", }) as any as S.Schema; export type MaintenanceConfigsUpdateResponseSnapshotExpirationState = | "enabled" | "disabled"; export const MaintenanceConfigsUpdateResponseSnapshotExpirationState = /*@__PURE__*/ S.String; export interface MaintenanceConfigsUpdateResponseSnapshotExpiration { /** Specifies the maximum age for snapshots. The system deletes snapshots older than this age. */ maxSnapshotAge: string; /** Specifies the minimum number of snapshots to retain. Defaults to 100. */ minSnapshotsToKeep: number; /** Specifies the state of maintenance operations. */ state: MaintenanceConfigsUpdateResponseSnapshotExpirationState; } export const MaintenanceConfigsUpdateResponseSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.String.pipe(T.Body("max_snapshot_age")), minSnapshotsToKeep: S.Number.pipe(T.Body("min_snapshots_to_keep")), state: MaintenanceConfigsUpdateResponseSnapshotExpirationState, }), ).annotate({ identifier: "MaintenanceConfigsUpdateResponseSnapshotExpiration", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateMaintenanceConfigResponse { /** Configures compaction for catalog maintenance. */ compaction?: MaintenanceConfigsUpdateResponseCompaction | null; /** Configures snapshot expiration settings. */ snapshotExpiration?: MaintenanceConfigsUpdateResponseSnapshotExpiration | null; } export const UpdateMaintenanceConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ compaction: S.optional( S.NullOr(MaintenanceConfigsUpdateResponseCompaction), ), snapshotExpiration: S.optional( S.NullOr(MaintenanceConfigsUpdateResponseSnapshotExpiration).pipe( T.Body("snapshot_expiration"), ), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateMaintenanceConfigResponse", }) as any as S.Schema; export type NamespacesTablesMaintenanceConfigsUpdateRequestCompactionState = | "enabled" | "disabled"; export const NamespacesTablesMaintenanceConfigsUpdateRequestCompactionState = /*@__PURE__*/ S.String; export type NamespacesTablesMaintenanceConfigsUpdateRequestCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const NamespacesTablesMaintenanceConfigsUpdateRequestCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface NamespacesTablesMaintenanceConfigsUpdateRequestCompaction { /** Updates the state optionally. */ state?: | NamespacesTablesMaintenanceConfigsUpdateRequestCompactionState | (string & {}); /** Updates the target file size optionally. */ targetSizeMb?: | NamespacesTablesMaintenanceConfigsUpdateRequestCompactionTargetSizeMb | (string & {}); } export const NamespacesTablesMaintenanceConfigsUpdateRequestCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: S.optional( NamespacesTablesMaintenanceConfigsUpdateRequestCompactionState, ), targetSizeMb: S.optional( NamespacesTablesMaintenanceConfigsUpdateRequestCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), ), }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsUpdateRequestCompaction", }) as any as S.Schema; export type NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpirationState = | "enabled" | "disabled"; export const NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpirationState = /*@__PURE__*/ S.String; export interface NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpiration { /** Updates the maximum age for snapshots optionally. */ maxSnapshotAge?: string; /** Updates the minimum number of snapshots to retain optionally. */ minSnapshotsToKeep?: number; /** Updates the state optionally. */ state?: | NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpirationState | (string & {}); } export const NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.optional(S.String.pipe(T.Body("max_snapshot_age"))), minSnapshotsToKeep: S.optional( S.Number.pipe(T.Body("min_snapshots_to_keep")), ), state: S.optional( NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpirationState, ), }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpiration", }) as any as S.Schema; export interface UpdateNamespaceTableMaintenanceConfigRequest { /** Use this to identify the account. */ accountId: string; /** Specifies the R2 bucket name. */ bucketName: string; namespace: string; tableName: string; /** Updates compaction configuration (all fields optional). */ compaction?: NamespacesTablesMaintenanceConfigsUpdateRequestCompaction; /** Updates snapshot expiration configuration (all fields optional). */ snapshotExpiration?: NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpiration; } export const UpdateNamespaceTableMaintenanceConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), bucketName: S.String.pipe(T.Label("bucket_name")), namespace: S.String.pipe(T.Label()), tableName: S.String.pipe(T.Label("table_name")), compaction: S.optional( NamespacesTablesMaintenanceConfigsUpdateRequestCompaction, ), snapshotExpiration: S.optional( NamespacesTablesMaintenanceConfigsUpdateRequestSnapshotExpiration.pipe( T.Body("snapshot_expiration"), ), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateNamespaceTableMaintenanceConfigRequest", }) as any as S.Schema; export type NamespacesTablesMaintenanceConfigsUpdateResponseCompactionState = | "enabled" | "disabled"; export const NamespacesTablesMaintenanceConfigsUpdateResponseCompactionState = /*@__PURE__*/ S.String; export type NamespacesTablesMaintenanceConfigsUpdateResponseCompactionTargetSizeMb = | "64" | "128" | "256" | "512"; export const NamespacesTablesMaintenanceConfigsUpdateResponseCompactionTargetSizeMb = /*@__PURE__*/ S.String; export interface NamespacesTablesMaintenanceConfigsUpdateResponseCompaction { /** Specifies the state of maintenance operations. */ state: NamespacesTablesMaintenanceConfigsUpdateResponseCompactionState; /** Sets the target file size for compaction in megabytes. Defaults to "128". */ targetSizeMb: NamespacesTablesMaintenanceConfigsUpdateResponseCompactionTargetSizeMb; } export const NamespacesTablesMaintenanceConfigsUpdateResponseCompaction = /*@__PURE__*/ S.suspend(() => S.Struct({ state: NamespacesTablesMaintenanceConfigsUpdateResponseCompactionState, targetSizeMb: NamespacesTablesMaintenanceConfigsUpdateResponseCompactionTargetSizeMb.pipe( T.Body("target_size_mb"), ), }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsUpdateResponseCompaction", }) as any as S.Schema; export type NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpirationState = | "enabled" | "disabled"; export const NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpirationState = /*@__PURE__*/ S.String; export interface NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpiration { /** Specifies the maximum age for snapshots. The system deletes snapshots older than this age. */ maxSnapshotAge: string; /** Specifies the minimum number of snapshots to retain. Defaults to 100. */ minSnapshotsToKeep: number; /** Specifies the state of maintenance operations. */ state: NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpirationState; } export const NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpiration = /*@__PURE__*/ S.suspend(() => S.Struct({ maxSnapshotAge: S.String.pipe(T.Body("max_snapshot_age")), minSnapshotsToKeep: S.Number.pipe(T.Body("min_snapshots_to_keep")), state: NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpirationState, }), ).annotate({ identifier: "NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpiration", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateNamespaceTableMaintenanceConfigResponse { /** Configures compaction settings for table optimization. */ compaction?: NamespacesTablesMaintenanceConfigsUpdateResponseCompaction | null; /** Configures snapshot expiration settings. */ snapshotExpiration?: NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpiration | null; } export const UpdateNamespaceTableMaintenanceConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ compaction: S.optional( S.NullOr(NamespacesTablesMaintenanceConfigsUpdateResponseCompaction), ), snapshotExpiration: S.optional( S.NullOr( NamespacesTablesMaintenanceConfigsUpdateResponseSnapshotExpiration, ).pipe(T.Body("snapshot_expiration")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateNamespaceTableMaintenanceConfigResponse", }) as any as S.Schema; export type CreateCredentialError = | InvalidRoute | InvalidCredential | CloudflareOpError; /** Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations. */ export const createCredential: API.OperationMethod< CreateCredentialRequest, CreateCredentialResponse, CreateCredentialError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateCredentialRequest, output: CreateCredentialResponse, errors: [ InvalidRoute, InvalidCredential, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DisableR2DataCatalogError = | NoSuchBucket | InvalidRoute | WarehouseNotFound | Forbidden | CloudflareOpError; /** Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later. */ export const disableR2DataCatalog: API.OperationMethod< DisableR2DataCatalogRequest, DisableR2DataCatalogResponse, DisableR2DataCatalogError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DisableR2DataCatalogRequest, output: DisableR2DataCatalogResponse, errors: [ NoSuchBucket, InvalidRoute, WarehouseNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type EnableR2DataCatalogError = | NoSuchBucket | InvalidRoute | CloudflareOpError; /** Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files. */ export const enableR2DataCatalog: API.OperationMethod< EnableR2DataCatalogRequest, EnableR2DataCatalogResponse, EnableR2DataCatalogError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: EnableR2DataCatalogRequest, output: EnableR2DataCatalogResponse, errors: [NoSuchBucket, InvalidRoute, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetMaintenanceConfigError = | InvalidRoute | WarehouseInactive | WarehouseNotFound | CloudflareOpError; /** Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status. */ export const getMaintenanceConfig: API.OperationMethod< GetMaintenanceConfigRequest, GetMaintenanceConfigResponse, GetMaintenanceConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetMaintenanceConfigRequest, output: GetMaintenanceConfigResponse, errors: [ InvalidRoute, WarehouseInactive, WarehouseNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetNamespaceTableMaintenanceConfigError = | TableNotFound | InvalidRoute | WarehouseInactive | CloudflareOpError; /** Retrieve the maintenance configuration for a specific table, including compaction settings. */ export const getNamespaceTableMaintenanceConfig: API.OperationMethod< GetNamespaceTableMaintenanceConfigRequest, GetNamespaceTableMaintenanceConfigResponse, GetNamespaceTableMaintenanceConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetNamespaceTableMaintenanceConfigRequest, output: GetNamespaceTableMaintenanceConfigResponse, errors: [ TableNotFound, InvalidRoute, WarehouseInactive, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetR2DataCatalogError = | NoSuchBucket | InvalidRoute | WarehouseNotFound | Forbidden | CloudflareOpError; /** Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status. */ export const getR2DataCatalog: API.OperationMethod< GetR2DataCatalogRequest, GetR2DataCatalogResponse, GetR2DataCatalogError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetR2DataCatalogRequest, output: GetR2DataCatalogResponse, errors: [ NoSuchBucket, InvalidRoute, WarehouseNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListNamespacesError = | InvalidRoute | WarehouseInactive | WarehouseNotFound | CloudflareOpError; /** Returns a list of namespaces in the specified R2 catalog. Supports hierarchical filtering and pagination for efficient traversal of large namespace hierarchies. */ export const listNamespaces: API.OperationMethod< ListNamespacesRequest, ListNamespacesResponse, ListNamespacesError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListNamespacesRequest, output: ListNamespacesResponse, errors: [ InvalidRoute, WarehouseInactive, WarehouseNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListNamespaceTablesError = | InvalidRoute | WarehouseInactive | CloudflareOpError; /** Returns a list of tables in the specified namespace within an R2 catalog. Supports pagination for efficient traversal of large table collections. */ export const listNamespaceTables: API.OperationMethod< ListNamespaceTablesRequest, ListNamespaceTablesResponse, ListNamespaceTablesError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListNamespaceTablesRequest, output: ListNamespaceTablesResponse, errors: [ InvalidRoute, WarehouseInactive, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListR2DataCatalogsError = InvalidRoute | CloudflareOpError; /** Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files. */ export const listR2DataCatalogs: API.OperationMethod< ListR2DataCatalogsRequest, ListR2DataCatalogsResponse, ListR2DataCatalogsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListR2DataCatalogsRequest, output: ListR2DataCatalogsResponse, errors: [InvalidRoute, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateMaintenanceConfigError = | InvalidRoute | WarehouseInactive | CloudflareOpError; /** Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization. */ export const updateMaintenanceConfig: API.OperationMethod< UpdateMaintenanceConfigRequest, UpdateMaintenanceConfigResponse, UpdateMaintenanceConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateMaintenanceConfigRequest, output: UpdateMaintenanceConfigResponse, errors: [ InvalidRoute, WarehouseInactive, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateNamespaceTableMaintenanceConfigError = | TableNotFound | InvalidRoute | WarehouseInactive | CloudflareOpError; /** Update the maintenance configuration for a specific table. This allows you to enable or disable compaction and adjust target file sizes for optimization. */ export const updateNamespaceTableMaintenanceConfig: API.OperationMethod< UpdateNamespaceTableMaintenanceConfigRequest, UpdateNamespaceTableMaintenanceConfigResponse, UpdateNamespaceTableMaintenanceConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateNamespaceTableMaintenanceConfigRequest, output: UpdateNamespaceTableMaintenanceConfigResponse, errors: [ TableNotFound, InvalidRoute, WarehouseInactive, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, }));