/**
 * Cloudflare DLS API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service dls
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetRegionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    regionId: Schema.String.pipe(T.HttpPath("regionId")),
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dls/regions/{regionId}",
}));
export const GetRegionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    createdOn: Schema.String,
    modifiedOn: Schema.String,
    name: Schema.String,
    regionKey: Schema.String,
    version: Schema.Number,
    versionCreatedOn: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdOn: "created_on",
    modifiedOn: "modified_on",
    name: "name",
    regionKey: "region_key",
    version: "version",
    versionCreatedOn: "version_created_on",
}))
    .pipe(T.ResponsePath("result"));
export const getRegion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetRegionRequest,
    output: GetRegionResponse,
    errors: [],
}));
export const ListRegionsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
    type: Schema.optional(Schema.Union([Schema.Literals(["managed", "custom"]), Schema.String])).pipe(T.HttpQuery("type")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/dls/regions" }));
export const ListRegionsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        modifiedOn: Schema.String,
        name: Schema.String,
        regionKey: Schema.String,
        version: Schema.Number,
        versionCreatedOn: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        modifiedOn: "modified_on",
        name: "name",
        regionKey: "region_key",
        version: "version",
        versionCreatedOn: "version_created_on",
    }))),
    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 listRegions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListRegionsRequest,
    output: ListRegionsResponse,
    errors: [],
    pagination: {
        mode: "cursor",
        inputToken: "cursor",
        outputToken: "resultInfo.cursor",
        items: "result",
        pageSize: "perPage",
    },
}));
export const GetRegionalServicePrefixBindingRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bindingId: Schema.String.pipe(T.HttpPath("bindingId")),
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dls/regional_services/prefix_bindings/{bindingId}",
}));
export const GetRegionalServicePrefixBindingResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    cidr: Schema.String,
    prefixId: Schema.String,
    regionKey: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    cidr: "cidr",
    prefixId: "prefix_id",
    regionKey: "region_key",
}))
    .pipe(T.ResponsePath("result"));
export const getRegionalServicePrefixBinding = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetRegionalServicePrefixBindingRequest,
    output: GetRegionalServicePrefixBindingResponse,
    errors: [],
}));
export const ListRegionalServicePrefixBindingsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dls/regional_services/prefix_bindings",
}));
export const ListRegionalServicePrefixBindingsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        cidr: Schema.String,
        prefixId: Schema.String,
        regionKey: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        cidr: "cidr",
        prefixId: "prefix_id",
        regionKey: "region_key",
    }))),
    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 listRegionalServicePrefixBindings = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListRegionalServicePrefixBindingsRequest,
    output: ListRegionalServicePrefixBindingsResponse,
    errors: [],
    pagination: {
        mode: "cursor",
        inputToken: "cursor",
        outputToken: "resultInfo.cursor",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateRegionalServicePrefixBindingRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
    cidr: Schema.String,
    prefixId: Schema.String,
    regionKey: Schema.String,
}).pipe(Schema.encodeKeys({
    cidr: "cidr",
    prefixId: "prefix_id",
    regionKey: "region_key",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/dls/regional_services/prefix_bindings",
}));
export const CreateRegionalServicePrefixBindingResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    cidr: Schema.String,
    prefixId: Schema.String,
    regionKey: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    cidr: "cidr",
    prefixId: "prefix_id",
    regionKey: "region_key",
}))
    .pipe(T.ResponsePath("result"));
export const createRegionalServicePrefixBinding = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateRegionalServicePrefixBindingRequest,
    output: CreateRegionalServicePrefixBindingResponse,
    errors: [],
}));
export const PatchRegionalServicePrefixBindingRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bindingId: Schema.String.pipe(T.HttpPath("bindingId")),
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
    regionKey: Schema.String,
}).pipe(Schema.encodeKeys({ regionKey: "region_key" }), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/dls/regional_services/prefix_bindings/{bindingId}",
}));
export const PatchRegionalServicePrefixBindingResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    cidr: Schema.String,
    prefixId: Schema.String,
    regionKey: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    cidr: "cidr",
    prefixId: "prefix_id",
    regionKey: "region_key",
}))
    .pipe(T.ResponsePath("result"));
export const patchRegionalServicePrefixBinding = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchRegionalServicePrefixBindingRequest,
    output: PatchRegionalServicePrefixBindingResponse,
    errors: [],
}));
export const DeleteRegionalServicePrefixBindingRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    bindingId: Schema.String.pipe(T.HttpPath("bindingId")),
    accountId: Schema.Number.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/dls/regional_services/prefix_bindings/{bindingId}",
}));
export const DeleteRegionalServicePrefixBindingResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    messages: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    success: Schema.Boolean,
    errors: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            code: Schema.Number,
            message: Schema.String,
            documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            source: Schema.optional(Schema.Union([
                Schema.Struct({
                    pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            code: "code",
            message: "message",
            documentationUrl: "documentation_url",
            source: "source",
        }))),
        Schema.Null,
    ])),
});
export const deleteRegionalServicePrefixBinding = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteRegionalServicePrefixBindingRequest,
    output: DeleteRegionalServicePrefixBindingResponse,
    errors: [],
}));
//# sourceMappingURL=dls.js.map