/**
 * Cloudflare CUSTOM-PAGES API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service custom-pages
 */
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 GetCustomPageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    identifier: Schema.Literals([
        "1000_errors",
        "500_errors",
        "basic_challenge",
        "country_challenge",
        "ip_block",
        "managed_challenge",
        "ratelimit_block",
        "under_attack",
        "waf_block",
        "waf_challenge",
    ]).pipe(T.HttpPath("identifier")),
}).pipe(T.Http({
    method: "GET",
    path: "/{accountOrZone}/{accountOrZoneId}/custom_pages/{identifier}",
}));
export const GetCustomPageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    previewTarget: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requiredTokens: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.Literals(["default", "customized"]), Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdOn: "created_on",
    description: "description",
    modifiedOn: "modified_on",
    previewTarget: "preview_target",
    requiredTokens: "required_tokens",
    state: "state",
    url: "url",
}))
    .pipe(T.ResponsePath("result"));
export const getCustomPage = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCustomPageRequest,
    output: GetCustomPageResponse,
    errors: [],
}));
export const ListCustomPagesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({
    method: "GET",
    path: "/{accountOrZone}/{accountOrZoneId}/custom_pages",
}));
export const ListCustomPagesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        previewTarget: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        requiredTokens: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        state: Schema.optional(Schema.Union([
            Schema.Literals(["default", "customized"]),
            Schema.Null,
        ])),
        url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        description: "description",
        modifiedOn: "modified_on",
        previewTarget: "preview_target",
        requiredTokens: "required_tokens",
        state: "state",
        url: "url",
    }))),
});
export const listCustomPages = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCustomPagesRequest,
    output: ListCustomPagesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const PutCustomPageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    identifier: Schema.Literals([
        "1000_errors",
        "500_errors",
        "basic_challenge",
        "country_challenge",
        "ip_block",
        "managed_challenge",
        "ratelimit_block",
        "under_attack",
        "waf_block",
        "waf_challenge",
    ]).pipe(T.HttpPath("identifier")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    state: Schema.Literals(["default", "customized"]),
    url: Schema.String,
}).pipe(T.Http({
    method: "PUT",
    path: "/{accountOrZone}/{accountOrZoneId}/custom_pages/{identifier}",
}));
export const PutCustomPageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    previewTarget: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requiredTokens: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.Literals(["default", "customized"]), Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdOn: "created_on",
    description: "description",
    modifiedOn: "modified_on",
    previewTarget: "preview_target",
    requiredTokens: "required_tokens",
    state: "state",
    url: "url",
}))
    .pipe(T.ResponsePath("result"));
export const putCustomPage = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutCustomPageRequest,
    output: PutCustomPageResponse,
    errors: [],
}));
//# sourceMappingURL=custom-pages.js.map