/**
 * 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";
// =============================================================================
// Asset
// =============================================================================
const GetAssetBaseFields = {
    assetName: Schema.String.pipe(T.HttpPath("assetName")),
};
export const GetAssetForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...GetAssetBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/custom_pages/assets/{assetName}",
}));
export const GetAssetForZoneRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...GetAssetBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/custom_pages/assets/{assetName}",
}));
export const GetAssetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    sizeBytes: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    description: "description",
    lastUpdated: "last_updated",
    name: "name",
    sizeBytes: "size_bytes",
    url: "url",
}))
    .pipe(T.ResponsePath("result"));
export const getAssetForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAssetForAccountRequest,
    output: GetAssetResponse,
    errors: [],
}));
export const getAssetForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAssetForZoneRequest,
    output: GetAssetResponse,
    errors: [],
}));
const ListAssetsBaseFields = {};
export const ListAssetsForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...ListAssetsBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/custom_pages/assets",
}));
export const ListAssetsForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...ListAssetsBaseFields,
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/custom_pages/assets" }));
export const ListAssetsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        sizeBytes: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        description: "description",
        lastUpdated: "last_updated",
        name: "name",
        sizeBytes: "size_bytes",
        url: "url",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listAssetsForAccount = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAssetsForAccountRequest,
    output: ListAssetsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const listAssetsForZone = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAssetsForZoneRequest,
    output: ListAssetsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
const CreateAssetBaseFields = {
    description: Schema.String,
    name: Schema.String,
    url: Schema.String,
};
export const CreateAssetForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...CreateAssetBaseFields,
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/custom_pages/assets",
}));
export const CreateAssetForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...CreateAssetBaseFields,
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/custom_pages/assets" }));
export const CreateAssetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    sizeBytes: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    description: "description",
    lastUpdated: "last_updated",
    name: "name",
    sizeBytes: "size_bytes",
    url: "url",
}))
    .pipe(T.ResponsePath("result"));
export const createAssetForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAssetForAccountRequest,
    output: CreateAssetResponse,
    errors: [],
}));
export const createAssetForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAssetForZoneRequest,
    output: CreateAssetResponse,
    errors: [],
}));
const UpdateAssetBaseFields = {
    assetName: Schema.String.pipe(T.HttpPath("assetName")),
    description: Schema.String,
    url: Schema.String,
};
export const UpdateAssetForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...UpdateAssetBaseFields,
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/custom_pages/assets/{assetName}",
}));
export const UpdateAssetForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...UpdateAssetBaseFields,
}).pipe(T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/custom_pages/assets/{assetName}",
}));
export const UpdateAssetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    sizeBytes: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    description: "description",
    lastUpdated: "last_updated",
    name: "name",
    sizeBytes: "size_bytes",
    url: "url",
}))
    .pipe(T.ResponsePath("result"));
export const updateAssetForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAssetForAccountRequest,
    output: UpdateAssetResponse,
    errors: [],
}));
export const updateAssetForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAssetForZoneRequest,
    output: UpdateAssetResponse,
    errors: [],
}));
const DeleteAssetBaseFields = {
    assetName: Schema.String.pipe(T.HttpPath("assetName")),
};
export const DeleteAssetForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...DeleteAssetBaseFields,
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/custom_pages/assets/{assetName}",
}));
export const DeleteAssetForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...DeleteAssetBaseFields,
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/custom_pages/assets/{assetName}",
}));
export const DeleteAssetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const deleteAssetForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAssetForAccountRequest,
    output: DeleteAssetResponse,
    errors: [],
}));
export const deleteAssetForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAssetForZoneRequest,
    output: DeleteAssetResponse,
    errors: [],
}));
// =============================================================================
// CustomPage
// =============================================================================
const GetCustomPageBaseFields = {
    identifier: Schema.Union([
        Schema.Literals([
            "1000_errors",
            "500_errors",
            "basic_challenge",
            "country_challenge",
            "ip_block",
            "managed_challenge",
            "ratelimit_block",
            "under_attack",
            "waf_block",
            "waf_challenge",
        ]),
        Schema.String,
    ]).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.Union([Schema.Literals(["default", "customized"]), Schema.String]),
        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.Union([
                Schema.Literals(["default", "customized"]),
                Schema.String,
            ]),
            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.Union([
        Schema.Literals([
            "1000_errors",
            "500_errors",
            "basic_challenge",
            "country_challenge",
            "ip_block",
            "managed_challenge",
            "ratelimit_block",
            "under_attack",
            "waf_block",
            "waf_challenge",
        ]),
        Schema.String,
    ]).pipe(T.HttpPath("identifier")),
    state: Schema.Union([
        Schema.Literals(["default", "customized"]),
        Schema.String,
    ]),
    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.Union([Schema.Literals(["default", "customized"]), Schema.String]),
        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