/**
 * Cloudflare R2 API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service r2
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
import { BinaryBodySchema } from "../schemas.js";
import { BinaryStreamResponseSchema } from "../schemas.js";
import { SensitiveString } from "../sensitive.js";
// =============================================================================
// Errors
// =============================================================================
export class BucketAlreadyExists extends Schema.TaggedErrorClass()("BucketAlreadyExists", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(BucketAlreadyExists, [{ code: 10004 }]);
export class BucketNotFound extends Schema.TaggedErrorClass()("BucketNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(BucketNotFound, [{ code: 10085 }]);
export class DomainNotFound extends Schema.TaggedErrorClass()("DomainNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(DomainNotFound, [{ code: 10053 }]);
export class EventNotificationConfigNotFound extends Schema.TaggedErrorClass()("EventNotificationConfigNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(EventNotificationConfigNotFound, [{ code: 11011 }]);
export class EventNotificationRuleConflict extends Schema.TaggedErrorClass()("EventNotificationRuleConflict", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(EventNotificationRuleConflict, [{ code: 11020 }]);
export class InvalidBucketName extends Schema.TaggedErrorClass()("InvalidBucketName", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidBucketName, [{ code: 10005 }]);
export class InvalidEventNotificationConfig extends Schema.TaggedErrorClass()("InvalidEventNotificationConfig", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidEventNotificationConfig, [
    { code: 11014 },
    { code: 11019 },
]);
export class InvalidRoute extends Schema.TaggedErrorClass()("InvalidRoute", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
export class InvalidUpstreamCredentials extends Schema.TaggedErrorClass()("InvalidUpstreamCredentials", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidUpstreamCredentials, [{ code: 10063 }]);
export class NoCorsConfiguration extends Schema.TaggedErrorClass()("NoCorsConfiguration", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(NoCorsConfiguration, [{ code: 10059 }]);
export class NoEventNotificationConfig extends Schema.TaggedErrorClass()("NoEventNotificationConfig", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(NoEventNotificationConfig, [{ code: 11015 }]);
export class NoRoute extends Schema.TaggedErrorClass()("NoRoute", {
    code: Schema.Number,
    message: Schema.String,
}) {
}
T.applyErrorMatchers(NoRoute, [{ code: 10015 }]);
export class NoSuchBucket extends Schema.TaggedErrorClass()("NoSuchBucket", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(NoSuchBucket, [{ code: 10006 }]);
export class QueueNotFound extends Schema.TaggedErrorClass()("QueueNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(QueueNotFound, [{ code: 11000 }]);
export const AbortAllSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/slurper/jobs/abortAll",
}));
export const AbortAllSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const abortAllSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AbortAllSuperSlurperJobRequest,
    output: AbortAllSuperSlurperJobResponse,
    errors: [],
}));
export const GetBucketRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}",
}));
export const GetBucketResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    creationDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    jurisdiction: Schema.optional(Schema.Union([Schema.Literals(["default", "eu", "fedramp"]), Schema.Null])),
    location: Schema.optional(Schema.Union([
        Schema.Literals([
            "apac",
            "eeur",
            "enam",
            "weur",
            "wnam",
            "oc",
            "APAC",
            "EEUR",
            "ENAM",
            "WEUR",
            "WNAM",
            "OC",
        ]),
        Schema.Null,
    ])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    storageClass: Schema.optional(Schema.Union([
        Schema.Literals(["Standard", "InfrequentAccess"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    creationDate: "creation_date",
    jurisdiction: "jurisdiction",
    location: "location",
    name: "name",
    storageClass: "storage_class",
}))
    .pipe(T.ResponsePath("result"));
export const getBucket = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketRequest,
    output: GetBucketResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const ListBucketsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    nameContains: Schema.optional(Schema.String).pipe(T.HttpQuery("name_contains")),
    order: Schema.optional(Schema.Literal("name")).pipe(T.HttpQuery("order")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    startAfter: Schema.optional(Schema.String).pipe(T.HttpQuery("start_after")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/r2/buckets" }));
export const ListBucketsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    buckets: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            creationDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            jurisdiction: Schema.optional(Schema.Union([
                Schema.Literals(["default", "eu", "fedramp"]),
                Schema.Null,
            ])),
            location: Schema.optional(Schema.Union([
                Schema.Literals([
                    "apac",
                    "eeur",
                    "enam",
                    "weur",
                    "wnam",
                    "oc",
                    "APAC",
                    "EEUR",
                    "ENAM",
                    "WEUR",
                    "WNAM",
                    "OC",
                ]),
                Schema.Null,
            ])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            storageClass: Schema.optional(Schema.Union([
                Schema.Literals(["Standard", "InfrequentAccess"]),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            creationDate: "creation_date",
            jurisdiction: "jurisdiction",
            location: "location",
            name: "name",
            storageClass: "storage_class",
        }))),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const listBuckets = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListBucketsRequest,
    output: ListBucketsResponse,
    errors: [InvalidRoute],
}));
export const CreateBucketRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    name: Schema.String,
    locationHint: Schema.optional(Schema.Literals(["apac", "eeur", "enam", "weur", "wnam", "oc"])),
    storageClass: Schema.optional(Schema.Literals(["Standard", "InfrequentAccess"])),
}).pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/r2/buckets" }));
export const CreateBucketResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    creationDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    jurisdiction: Schema.optional(Schema.Union([Schema.Literals(["default", "eu", "fedramp"]), Schema.Null])),
    location: Schema.optional(Schema.Union([
        Schema.Literals([
            "apac",
            "eeur",
            "enam",
            "weur",
            "wnam",
            "oc",
            "APAC",
            "EEUR",
            "ENAM",
            "WEUR",
            "WNAM",
            "OC",
        ]),
        Schema.Null,
    ])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    storageClass: Schema.optional(Schema.Union([
        Schema.Literals(["Standard", "InfrequentAccess"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    creationDate: "creation_date",
    jurisdiction: "jurisdiction",
    location: "location",
    name: "name",
    storageClass: "storage_class",
}))
    .pipe(T.ResponsePath("result"));
export const createBucket = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateBucketRequest,
    output: CreateBucketResponse,
    errors: [InvalidBucketName, BucketAlreadyExists, InvalidRoute],
}));
export const PatchBucketRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    storageClass: Schema.Literals(["Standard", "InfrequentAccess"]).pipe(T.HttpHeader("cf-r2-storage-class")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}",
}));
export const PatchBucketResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    creationDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    jurisdiction: Schema.optional(Schema.Union([Schema.Literals(["default", "eu", "fedramp"]), Schema.Null])),
    location: Schema.optional(Schema.Union([
        Schema.Literals([
            "apac",
            "eeur",
            "enam",
            "weur",
            "wnam",
            "oc",
            "APAC",
            "EEUR",
            "ENAM",
            "WEUR",
            "WNAM",
            "OC",
        ]),
        Schema.Null,
    ])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    storageClass: Schema.optional(Schema.Union([
        Schema.Literals(["Standard", "InfrequentAccess"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    creationDate: "creation_date",
    jurisdiction: "jurisdiction",
    location: "location",
    name: "name",
    storageClass: "storage_class",
}))
    .pipe(T.ResponsePath("result"));
export const patchBucket = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchBucketRequest,
    output: PatchBucketResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const DeleteBucketRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}",
}));
export const DeleteBucketResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteBucket = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteBucketRequest,
    output: DeleteBucketResponse,
    errors: [NoSuchBucket, InvalidRoute, NoRoute],
}));
export const GetBucketCorsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/cors",
}));
export const GetBucketCorsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            allowed: Schema.Struct({
                methods: Schema.Array(Schema.Literals(["GET", "PUT", "POST", "DELETE", "HEAD"])),
                origins: Schema.Array(Schema.String),
                headers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            }),
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            exposeHeaders: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            maxAgeSeconds: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const getBucketCors = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketCorsRequest,
    output: GetBucketCorsResponse,
    errors: [NoSuchBucket, InvalidRoute, NoCorsConfiguration],
}));
export const PutBucketCorsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    rules: Schema.optional(Schema.Array(Schema.Struct({
        allowed: Schema.Struct({
            methods: Schema.Array(Schema.Literals(["GET", "PUT", "POST", "DELETE", "HEAD"])),
            origins: Schema.Array(Schema.String),
            headers: Schema.optional(Schema.Array(Schema.String)),
        }),
        id: Schema.optional(Schema.String),
        exposeHeaders: Schema.optional(Schema.Array(Schema.String)),
        maxAgeSeconds: Schema.optional(Schema.Number),
    }))),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/cors",
}));
export const PutBucketCorsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const putBucketCors = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutBucketCorsRequest,
    output: PutBucketCorsResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const DeleteBucketCorsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/cors",
}));
export const DeleteBucketCorsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteBucketCors = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteBucketCorsRequest,
    output: DeleteBucketCorsResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const GetBucketDomainCustomRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    domain: Schema.String.pipe(T.HttpPath("domain")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/custom/{domain}",
}));
export const GetBucketDomainCustomResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domain: Schema.String,
    enabled: Schema.Boolean,
    status: Schema.Struct({
        ownership: Schema.Literals([
            "pending",
            "active",
            "deactivated",
            "blocked",
            "error",
            "unknown",
        ]),
        ssl: Schema.Literals([
            "initializing",
            "pending",
            "active",
            "deactivated",
            "error",
            "unknown",
        ]),
    }),
    ciphers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    minTLS: Schema.optional(Schema.Union([
        Schema.Literals(["1.0", "1.1", "1.2", "1.3"]),
        Schema.Null,
    ])),
    zoneId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getBucketDomainCustom = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketDomainCustomRequest,
    output: GetBucketDomainCustomResponse,
    errors: [DomainNotFound, NoSuchBucket, InvalidRoute],
}));
export const ListBucketDomainCustomsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/custom",
}));
export const ListBucketDomainCustomsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domains: Schema.Array(Schema.Struct({
        domain: Schema.String,
        enabled: Schema.Boolean,
        status: Schema.Struct({
            ownership: Schema.Literals([
                "pending",
                "active",
                "deactivated",
                "blocked",
                "error",
                "unknown",
            ]),
            ssl: Schema.Literals([
                "initializing",
                "pending",
                "active",
                "deactivated",
                "error",
                "unknown",
            ]),
        }),
        ciphers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        minTLS: Schema.optional(Schema.Union([
            Schema.Literals(["1.0", "1.1", "1.2", "1.3"]),
            Schema.Null,
        ])),
        zoneId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
}).pipe(T.ResponsePath("result"));
export const listBucketDomainCustoms = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListBucketDomainCustomsRequest,
    output: ListBucketDomainCustomsResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const CreateBucketDomainCustomRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    domain: Schema.String,
    enabled: Schema.Boolean,
    zoneId: Schema.String,
    ciphers: Schema.optional(Schema.Array(Schema.String)),
    minTLS: Schema.optional(Schema.Literals(["1.0", "1.1", "1.2", "1.3"])),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/custom",
}));
export const CreateBucketDomainCustomResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domain: Schema.String,
    enabled: Schema.Boolean,
    ciphers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    minTLS: Schema.optional(Schema.Union([
        Schema.Literals(["1.0", "1.1", "1.2", "1.3"]),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const createBucketDomainCustom = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateBucketDomainCustomRequest,
    output: CreateBucketDomainCustomResponse,
    errors: [NoSuchBucket, InvalidBucketName],
}));
export const UpdateBucketDomainCustomRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    domain: Schema.String.pipe(T.HttpPath("domain")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    ciphers: Schema.optional(Schema.Array(Schema.String)),
    enabled: Schema.optional(Schema.Boolean),
    minTLS: Schema.optional(Schema.Literals(["1.0", "1.1", "1.2", "1.3"])),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/custom/{domain}",
}));
export const UpdateBucketDomainCustomResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domain: Schema.String,
    ciphers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    minTLS: Schema.optional(Schema.Union([
        Schema.Literals(["1.0", "1.1", "1.2", "1.3"]),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const updateBucketDomainCustom = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateBucketDomainCustomRequest,
    output: UpdateBucketDomainCustomResponse,
    errors: [],
}));
export const DeleteBucketDomainCustomRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    domain: Schema.String.pipe(T.HttpPath("domain")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/custom/{domain}",
}));
export const DeleteBucketDomainCustomResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domain: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteBucketDomainCustom = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteBucketDomainCustomRequest,
    output: DeleteBucketDomainCustomResponse,
    errors: [],
}));
export const ListBucketDomainManagedsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/managed",
}));
export const ListBucketDomainManagedsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketId: Schema.String,
    domain: Schema.String,
    enabled: Schema.Boolean,
}).pipe(T.ResponsePath("result"));
export const listBucketDomainManageds = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListBucketDomainManagedsRequest,
    output: ListBucketDomainManagedsResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const PutBucketDomainManagedRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    enabled: Schema.Boolean,
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/domains/managed",
}));
export const PutBucketDomainManagedResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketId: Schema.String,
    domain: Schema.String,
    enabled: Schema.Boolean,
}).pipe(T.ResponsePath("result"));
export const putBucketDomainManaged = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutBucketDomainManagedRequest,
    output: PutBucketDomainManagedResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const GetBucketEventNotificationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    queueId: Schema.String.pipe(T.HttpPath("queueId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/event_notifications/r2/{bucketName}/configuration/queues/{queueId}",
}));
export const GetBucketEventNotificationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            actions: Schema.Array(Schema.Literals([
                "PutObject",
                "CopyObject",
                "DeleteObject",
                "CompleteMultipartUpload",
                "LifecycleDeletion",
            ])),
            createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            ruleId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            suffix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const getBucketEventNotification = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketEventNotificationRequest,
    output: GetBucketEventNotificationResponse,
    errors: [
        BucketNotFound,
        NoEventNotificationConfig,
        EventNotificationConfigNotFound,
        QueueNotFound,
        InvalidRoute,
    ],
}));
export const ListBucketEventNotificationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/event_notifications/r2/{bucketName}/configuration",
}));
export const ListBucketEventNotificationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    queues: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            rules: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    actions: Schema.Array(Schema.Literals([
                        "PutObject",
                        "CopyObject",
                        "DeleteObject",
                        "CompleteMultipartUpload",
                        "LifecycleDeletion",
                    ])),
                    createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    ruleId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    suffix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                })),
                Schema.Null,
            ])),
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const listBucketEventNotifications = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListBucketEventNotificationsRequest,
    output: ListBucketEventNotificationsResponse,
    errors: [
        NoSuchBucket,
        InvalidRoute,
        NoEventNotificationConfig,
        BucketNotFound,
    ],
}));
export const PutBucketEventNotificationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    queueId: Schema.String.pipe(T.HttpPath("queueId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    rules: Schema.Array(Schema.Struct({
        actions: Schema.Array(Schema.Literals([
            "PutObject",
            "CopyObject",
            "DeleteObject",
            "CompleteMultipartUpload",
            "LifecycleDeletion",
        ])),
        description: Schema.optional(Schema.String),
        prefix: Schema.optional(Schema.String),
        suffix: Schema.optional(Schema.String),
    })),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/event_notifications/r2/{bucketName}/configuration/queues/{queueId}",
}));
export const PutBucketEventNotificationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const putBucketEventNotification = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutBucketEventNotificationRequest,
    output: PutBucketEventNotificationResponse,
    errors: [
        BucketNotFound,
        InvalidEventNotificationConfig,
        EventNotificationRuleConflict,
        QueueNotFound,
        InvalidRoute,
    ],
}));
export const DeleteBucketEventNotificationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    queueId: Schema.String.pipe(T.HttpPath("queueId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/event_notifications/r2/{bucketName}/configuration/queues/{queueId}",
}));
export const DeleteBucketEventNotificationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteBucketEventNotification = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteBucketEventNotificationRequest,
    output: DeleteBucketEventNotificationResponse,
    errors: [
        BucketNotFound,
        EventNotificationConfigNotFound,
        QueueNotFound,
        InvalidRoute,
    ],
}));
export const GetBucketLifecycleRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/lifecycle",
}));
export const GetBucketLifecycleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.String,
            conditions: Schema.Struct({
                prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            enabled: Schema.Boolean,
            abortMultipartUploadsTransition: Schema.optional(Schema.Union([
                Schema.Struct({
                    condition: Schema.optional(Schema.Union([
                        Schema.Struct({
                            maxAge: Schema.Number,
                            type: Schema.Literal("Age"),
                        }),
                        Schema.Null,
                    ])),
                }),
                Schema.Null,
            ])),
            deleteObjectsTransition: Schema.optional(Schema.Union([
                Schema.Struct({
                    condition: Schema.optional(Schema.Union([
                        Schema.Union([
                            Schema.Struct({
                                maxAge: Schema.Number,
                                type: Schema.Literal("Age"),
                            }),
                            Schema.Struct({
                                date: Schema.String,
                                type: Schema.Literal("Date"),
                            }),
                        ]),
                        Schema.Null,
                    ])),
                }),
                Schema.Null,
            ])),
            storageClassTransitions: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    condition: Schema.Union([
                        Schema.Struct({
                            maxAge: Schema.Number,
                            type: Schema.Literal("Age"),
                        }),
                        Schema.Struct({
                            date: Schema.String,
                            type: Schema.Literal("Date"),
                        }),
                    ]),
                    storageClass: Schema.Literal("InfrequentAccess"),
                })),
                Schema.Null,
            ])),
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const getBucketLifecycle = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketLifecycleRequest,
    output: GetBucketLifecycleResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const PutBucketLifecycleRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    rules: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.String,
        conditions: Schema.Struct({
            prefix: Schema.String,
        }),
        enabled: Schema.Boolean,
        abortMultipartUploadsTransition: Schema.optional(Schema.Struct({
            condition: Schema.optional(Schema.Struct({
                maxAge: Schema.Number,
                type: Schema.Literal("Age"),
            })),
        })),
        deleteObjectsTransition: Schema.optional(Schema.Struct({
            condition: Schema.optional(Schema.Union([
                Schema.Struct({
                    maxAge: Schema.Number,
                    type: Schema.Literal("Age"),
                }),
                Schema.Struct({
                    date: Schema.String,
                    type: Schema.Literal("Date"),
                }),
            ])),
        })),
        storageClassTransitions: Schema.optional(Schema.Array(Schema.Struct({
            condition: Schema.Union([
                Schema.Struct({
                    maxAge: Schema.Number,
                    type: Schema.Literal("Age"),
                }),
                Schema.Struct({
                    date: Schema.String,
                    type: Schema.Literal("Date"),
                }),
            ]),
            storageClass: Schema.Literal("InfrequentAccess"),
        }))),
    }))),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/lifecycle",
}));
export const PutBucketLifecycleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const putBucketLifecycle = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutBucketLifecycleRequest,
    output: PutBucketLifecycleResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const GetBucketLockRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/lock",
}));
export const GetBucketLockResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.String,
            condition: Schema.Union([
                Schema.Struct({
                    maxAgeSeconds: Schema.Number,
                    type: Schema.Literal("Age"),
                }),
                Schema.Struct({
                    date: Schema.String,
                    type: Schema.Literal("Date"),
                }),
                Schema.Struct({
                    type: Schema.Literal("Indefinite"),
                }),
            ]),
            enabled: Schema.Boolean,
            prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const getBucketLock = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketLockRequest,
    output: GetBucketLockResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const PutBucketLockRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    rules: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.String,
        condition: Schema.Union([
            Schema.Struct({
                maxAgeSeconds: Schema.Number,
                type: Schema.Literal("Age"),
            }),
            Schema.Struct({
                date: Schema.String,
                type: Schema.Literal("Date"),
            }),
            Schema.Struct({
                type: Schema.Literal("Indefinite"),
            }),
        ]),
        enabled: Schema.Boolean,
        prefix: Schema.optional(Schema.String),
    }))),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/lock",
}));
export const PutBucketLockResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const putBucketLock = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutBucketLockRequest,
    output: PutBucketLockResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const ListBucketMetricsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/r2/metrics" }));
export const ListBucketMetricsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    infrequentAccess: Schema.optional(Schema.Union([
        Schema.Struct({
            published: Schema.optional(Schema.Union([
                Schema.Struct({
                    metadataSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    objects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    payloadSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                }),
                Schema.Null,
            ])),
            uploaded: Schema.optional(Schema.Union([
                Schema.Struct({
                    metadataSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    objects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    payloadSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                }),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    standard: Schema.optional(Schema.Union([
        Schema.Struct({
            published: Schema.optional(Schema.Union([
                Schema.Struct({
                    metadataSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    objects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    payloadSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                }),
                Schema.Null,
            ])),
            uploaded: Schema.optional(Schema.Union([
                Schema.Struct({
                    metadataSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    objects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    payloadSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                }),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const listBucketMetrics = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListBucketMetricsRequest,
    output: ListBucketMetricsResponse,
    errors: [InvalidRoute],
}));
export const GetBucketSippyRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/sippy",
}));
export const GetBucketSippyResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    destination: Schema.optional(Schema.Union([
        Schema.Struct({
            accessKeyId: Schema.optional(Schema.Union([SensitiveString, Schema.Null])),
            account: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            provider: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null])),
        }),
        Schema.Null,
    ])),
    enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    source: Schema.optional(Schema.Union([
        Schema.Struct({
            bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            bucketUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            provider: Schema.optional(Schema.Union([Schema.Literals(["aws", "gcs", "s3"]), Schema.Null])),
            region: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const getBucketSippy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBucketSippyRequest,
    output: GetBucketSippyResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const PutBucketSippyRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    destination: Schema.optional(Schema.Struct({
        accessKeyId: Schema.optional(SensitiveString),
        provider: Schema.optional(Schema.Literal("r2")),
        secretAccessKey: Schema.optional(SensitiveString),
    })),
    source: Schema.optional(Schema.Struct({
        accessKeyId: Schema.optional(SensitiveString),
        bucket: Schema.optional(Schema.String),
        provider: Schema.optional(Schema.Literal("aws")),
        region: Schema.optional(Schema.String),
        secretAccessKey: Schema.optional(SensitiveString),
    })),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/sippy",
}));
export const PutBucketSippyResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    destination: Schema.optional(Schema.Union([
        Schema.Struct({
            accessKeyId: Schema.optional(Schema.Union([SensitiveString, Schema.Null])),
            account: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            provider: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null])),
        }),
        Schema.Null,
    ])),
    enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    source: Schema.optional(Schema.Union([
        Schema.Struct({
            bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            bucketUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            provider: Schema.optional(Schema.Union([Schema.Literals(["aws", "gcs", "s3"]), Schema.Null])),
            region: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const putBucketSippy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutBucketSippyRequest,
    output: PutBucketSippyResponse,
    errors: [InvalidUpstreamCredentials, InvalidRoute],
}));
export const DeleteBucketSippyRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/sippy",
}));
export const DeleteBucketSippyResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    enabled: Schema.optional(Schema.Union([Schema.Literal(false), Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteBucketSippy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteBucketSippyRequest,
    output: DeleteBucketSippyResponse,
    errors: [NoSuchBucket, InvalidRoute],
}));
export const GetObjectRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    objectName: Schema.String.pipe(T.HttpPath("objectName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cfR2Jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/objects/{objectName}",
    responseContentType: "binary",
}));
export const GetObjectResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    body: BinaryStreamResponseSchema.pipe(T.BinaryResponseBody()),
    etag: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("etag")),
    contentType: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("content-type")),
    contentLength: Schema.optional(Schema.Number).pipe(T.HttpResponseHeader("content-length")),
    contentEncoding: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("content-encoding")),
    contentDisposition: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("content-disposition")),
    contentLanguage: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("content-language")),
    contentRange: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("content-range")),
    cacheControl: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("cache-control")),
    expires: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("expires")),
    lastModified: Schema.optional(Schema.String).pipe(T.HttpResponseHeader("last-modified")),
    cfR2StorageClass: Schema.optional(Schema.Literals(["Standard", "InfrequentAccess"])).pipe(T.HttpResponseHeader("cf-r2-storage-class")),
});
export const getObject = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetObjectRequest,
    output: GetObjectResponse,
    errors: [NoSuchBucket, InvalidRoute, NoRoute],
}));
export const ListObjectsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    prefix: Schema.optional(Schema.String).pipe(T.HttpQuery("prefix")),
    delimiter: Schema.optional(Schema.String).pipe(T.HttpQuery("delimiter")),
    cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
    startAfter: Schema.optional(Schema.String).pipe(T.HttpQuery("start_after")),
    cfR2Jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/objects",
}));
export const ListObjectsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        size: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        etag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        lastModified: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        storageClass: Schema.optional(Schema.Union([
            Schema.Literals(["Standard", "InfrequentAccess"]),
            Schema.Null,
        ])),
        ssec: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        customMetadata: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
        httpMetadata: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        key: "key",
        size: "size",
        etag: "etag",
        lastModified: "last_modified",
        storageClass: "storage_class",
        ssec: "ssec",
        customMetadata: "custom_metadata",
        httpMetadata: "http_metadata",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            cursor: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            cursor: "cursor",
            perPage: "per_page",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listObjects = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListObjectsRequest,
    output: ListObjectsResponse,
    errors: [NoSuchBucket, InvalidRoute, NoRoute],
    pagination: {
        mode: "cursor",
        inputToken: "cursor",
        outputToken: "resultInfo.cursor",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PutObjectRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    objectName: Schema.String.pipe(T.HttpPath("objectName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cfR2Jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    contentType: Schema.optional(Schema.String).pipe(T.HttpHeader("content-type")),
    contentDisposition: Schema.optional(Schema.String).pipe(T.HttpHeader("content-disposition")),
    contentEncoding: Schema.optional(Schema.String).pipe(T.HttpHeader("content-encoding")),
    contentLanguage: Schema.optional(Schema.String).pipe(T.HttpHeader("content-language")),
    contentLength: Schema.optional(Schema.String).pipe(T.HttpHeader("content-length")),
    cacheControl: Schema.optional(Schema.String).pipe(T.HttpHeader("cache-control")),
    expires: Schema.optional(Schema.String).pipe(T.HttpHeader("expires")),
    cfR2StorageClass: Schema.optional(Schema.Literals(["Standard", "InfrequentAccess"])).pipe(T.HttpHeader("cf-r2-storage-class")),
    body: BinaryBodySchema.pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/objects/{objectName}",
    contentType: "binary",
}));
export const PutObjectResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const putObject = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutObjectRequest,
    output: PutObjectResponse,
    errors: [NoSuchBucket, InvalidRoute, NoRoute],
}));
export const DeleteObjectsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    prefix: Schema.optional(Schema.String).pipe(T.HttpQuery("prefix")),
    cfR2Jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
    body: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/objects",
}));
export const DeleteObjectsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Array(Schema.Struct({
        key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        jobType: Schema.optional(Schema.Union([Schema.Literal("prefixDelete"), Schema.Null])),
        status: Schema.optional(Schema.Union([
            Schema.Literals([
                "ENQUEUED",
                "RUNNING",
                "COMPLETED",
                "FAILED",
                "CANCELLED",
            ]),
            Schema.Null,
        ])),
        startTime: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        endTime: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        prefixDelete: Schema.optional(Schema.Union([
            Schema.Struct({
                prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                deletedObjects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                isBucketClear: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }),
]).pipe(T.ResponsePath("result"));
export const deleteObjects = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteObjectsRequest,
    output: DeleteObjectsResponse,
    errors: [NoSuchBucket, InvalidRoute, NoRoute],
}));
export const DeleteObjectRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bucketName: Schema.String.pipe(T.HttpPath("bucketName")),
    objectName: Schema.String.pipe(T.HttpPath("objectName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cfR2Jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])).pipe(T.HttpHeader("cf-r2-jurisdiction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/r2/buckets/{bucketName}/objects/{objectName}",
}));
export const DeleteObjectResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteObject = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteObjectRequest,
    output: DeleteObjectResponse,
    errors: [NoSuchBucket, InvalidRoute, NoRoute],
}));
export const SourceSuperSlurperConnectivityPrecheckRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    bucket: Schema.String,
    secret: Schema.Struct({
        accessKeyId: SensitiveString,
        secretAccessKey: SensitiveString,
    }),
    vendor: Schema.Literal("s3"),
    endpoint: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    region: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/slurper/source/connectivity-precheck",
}));
export const SourceSuperSlurperConnectivityPrecheckResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    connectivityStatus: Schema.optional(Schema.Union([Schema.Literals(["success", "error"]), Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const sourceSuperSlurperConnectivityPrecheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SourceSuperSlurperConnectivityPrecheckRequest,
    output: SourceSuperSlurperConnectivityPrecheckResponse,
    errors: [],
}));
export const TargetSuperSlurperConnectivityPrecheckRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    bucket: Schema.String,
    secret: Schema.Struct({
        accessKeyId: SensitiveString,
        secretAccessKey: SensitiveString,
    }),
    vendor: Schema.Literal("r2"),
    jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/slurper/target/connectivity-precheck",
}));
export const TargetSuperSlurperConnectivityPrecheckResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    connectivityStatus: Schema.optional(Schema.Union([Schema.Literals(["success", "error"]), Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const targetSuperSlurperConnectivityPrecheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TargetSuperSlurperConnectivityPrecheckRequest,
    output: TargetSuperSlurperConnectivityPrecheckResponse,
    errors: [],
}));
export const GetSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/slurper/jobs/{jobId}",
}));
export const GetSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    finishedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    overwrite: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    source: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                endpoint: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                keys: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                vendor: Schema.optional(Schema.Union([Schema.Literal("s3"), Schema.Null])),
            }),
            Schema.Struct({
                bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                keys: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                vendor: Schema.optional(Schema.Union([Schema.Literal("gcs"), Schema.Null])),
            }),
            Schema.Struct({
                bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                jurisdiction: Schema.optional(Schema.Union([
                    Schema.Literals(["default", "eu", "fedramp"]),
                    Schema.Null,
                ])),
                keys: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                vendor: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null])),
            }),
        ]),
        Schema.Null,
    ])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["running", "paused", "aborted", "completed"]),
        Schema.Null,
    ])),
    target: Schema.optional(Schema.Union([
        Schema.Struct({
            bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            jurisdiction: Schema.optional(Schema.Union([
                Schema.Literals(["default", "eu", "fedramp"]),
                Schema.Null,
            ])),
            vendor: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null])),
        }),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const getSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSuperSlurperJobRequest,
    output: GetSuperSlurperJobResponse,
    errors: [],
}));
export const ListSuperSlurperJobsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/slurper/jobs" }));
export const ListSuperSlurperJobsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        finishedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        overwrite: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    endpoint: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    keys: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    vendor: Schema.optional(Schema.Union([Schema.Literal("s3"), Schema.Null])),
                }),
                Schema.Struct({
                    bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    keys: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    vendor: Schema.optional(Schema.Union([Schema.Literal("gcs"), Schema.Null])),
                }),
                Schema.Struct({
                    bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    jurisdiction: Schema.optional(Schema.Union([
                        Schema.Literals(["default", "eu", "fedramp"]),
                        Schema.Null,
                    ])),
                    keys: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    vendor: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        status: Schema.optional(Schema.Union([
            Schema.Literals(["running", "paused", "aborted", "completed"]),
            Schema.Null,
        ])),
        target: Schema.optional(Schema.Union([
            Schema.Struct({
                bucket: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                jurisdiction: Schema.optional(Schema.Union([
                    Schema.Literals(["default", "eu", "fedramp"]),
                    Schema.Null,
                ])),
                vendor: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null])),
            }),
            Schema.Null,
        ])),
    })),
});
export const listSuperSlurperJobs = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSuperSlurperJobsRequest,
    output: ListSuperSlurperJobsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    overwrite: Schema.optional(Schema.Boolean),
    source: Schema.optional(Schema.Union([
        Schema.Struct({
            bucket: Schema.String,
            secret: Schema.Struct({
                accessKeyId: SensitiveString,
                secretAccessKey: SensitiveString,
            }),
            vendor: Schema.Literal("s3"),
            endpoint: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            region: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            bucket: Schema.String,
            secret: Schema.Struct({
                clientEmail: Schema.String,
                privateKey: SensitiveString,
            }),
            vendor: Schema.Literal("gcs"),
            pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            bucket: Schema.String,
            secret: Schema.Struct({
                accessKeyId: SensitiveString,
                secretAccessKey: SensitiveString,
            }),
            vendor: Schema.Literal("r2"),
            jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])),
            pathPrefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ])),
    target: Schema.optional(Schema.Struct({
        bucket: Schema.String,
        secret: Schema.Struct({
            accessKeyId: SensitiveString,
            secretAccessKey: SensitiveString,
        }),
        vendor: Schema.Literal("r2"),
        jurisdiction: Schema.optional(Schema.Literals(["default", "eu", "fedramp"])),
    })),
}).pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/slurper/jobs" }));
export const CreateSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const createSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSuperSlurperJobRequest,
    output: CreateSuperSlurperJobResponse,
    errors: [],
}));
export const AbortSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/slurper/jobs/{jobId}/abort",
}));
export const AbortSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const abortSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AbortSuperSlurperJobRequest,
    output: AbortSuperSlurperJobResponse,
    errors: [],
}));
export const PauseSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/slurper/jobs/{jobId}/pause",
}));
export const PauseSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const pauseSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PauseSuperSlurperJobRequest,
    output: PauseSuperSlurperJobResponse,
    errors: [],
}));
export const ProgressSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/slurper/jobs/{jobId}/progress",
}));
export const ProgressSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failedObjects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    objects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    skippedObjects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["running", "paused", "aborted", "completed"]),
        Schema.Null,
    ])),
    transferredObjects: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const progressSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ProgressSuperSlurperJobRequest,
    output: ProgressSuperSlurperJobResponse,
    errors: [],
}));
export const ResumeSuperSlurperJobRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/slurper/jobs/{jobId}/resume",
}));
export const ResumeSuperSlurperJobResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const resumeSuperSlurperJob = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ResumeSuperSlurperJobRequest,
    output: ResumeSuperSlurperJobResponse,
    errors: [],
}));
export const ListSuperSlurperJobLogsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/slurper/jobs/{jobId}/logs",
}));
export const ListSuperSlurperJobLogsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        job: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        logType: Schema.optional(Schema.Union([
            Schema.Literals([
                "migrationStart",
                "migrationComplete",
                "migrationAbort",
                "migrationError",
                "migrationPause",
                "migrationResume",
                "migrationErrorFailedContinuation",
                "importErrorRetryExhaustion",
                "importSkippedStorageClass",
                "importSkippedOversized",
                "importSkippedEmptyObject",
                "importSkippedUnsupportedContentType",
                "importSkippedExcludedContentType",
                "importSkippedInvalidMedia",
                "importSkippedRequiresRetrieval",
            ]),
            Schema.Null,
        ])),
        message: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        objectKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const listSuperSlurperJobLogs = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSuperSlurperJobLogsRequest,
    output: ListSuperSlurperJobLogsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateTemporaryCredentialRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    bucket: Schema.String,
    parentAccessKeyId: Schema.String,
    permission: Schema.Literals([
        "admin-read-write",
        "admin-read-only",
        "object-read-write",
        "object-read-only",
    ]),
    ttlSeconds: Schema.Number,
    objects: Schema.optional(Schema.Array(Schema.String)),
    prefixes: Schema.optional(Schema.Array(Schema.String)),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/r2/temp-access-credentials",
}));
export const CreateTemporaryCredentialResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accessKeyId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    secretAccessKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    sessionToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const createTemporaryCredential = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateTemporaryCredentialRequest,
    output: CreateTemporaryCredentialResponse,
    errors: [],
}));
//# sourceMappingURL=r2.js.map