/**
 * 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";
// =============================================================================
// CustomPage
// =============================================================================
const GetCustomPageBaseFields = {
    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")),
};
export const GetCustomPageForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...GetCustomPageBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/custom_pages/{identifier}",
}));
export const GetCustomPageForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...GetCustomPageBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/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 getCustomPageForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCustomPageForAccountRequest,
    output: GetCustomPageResponse,
    errors: [],
}));
export const getCustomPageForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCustomPageForZoneRequest,
    output: GetCustomPageResponse,
    errors: [],
}));
const ListCustomPagesBaseFields = {};
export const ListCustomPagesForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...ListCustomPagesBaseFields,
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/custom_pages" }));
export const ListCustomPagesForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...ListCustomPagesBaseFields,
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/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 listCustomPagesForAccount = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCustomPagesForAccountRequest,
    output: ListCustomPagesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const listCustomPagesForZone = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCustomPagesForZoneRequest,
    output: ListCustomPagesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
const PutCustomPageBaseFields = {
    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")),
    state: Schema.Literals(["default", "customized"]),
    url: Schema.String,
};
export const PutCustomPageForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...PutCustomPageBaseFields,
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/custom_pages/{identifier}",
}));
export const PutCustomPageForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...PutCustomPageBaseFields,
}).pipe(T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/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 putCustomPageForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutCustomPageForAccountRequest,
    output: PutCustomPageResponse,
    errors: [],
}));
export const putCustomPageForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutCustomPageForZoneRequest,
    output: PutCustomPageResponse,
    errors: [],
}));
//# sourceMappingURL=custom-pages.js.map