/**
 * Cloudflare RUM API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service rum
 */
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 ListRulesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/rum/v2/{rulesetId}/rules",
}));
export const ListRulesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            created: "created",
            host: "host",
            inclusive: "inclusive",
            isPaused: "is_paused",
            paths: "paths",
            priority: "priority",
        }))),
        Schema.Null,
    ])),
    ruleset: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            enabled: "enabled",
            zoneName: "zone_name",
            zoneTag: "zone_tag",
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const listRules = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListRulesRequest,
    output: ListRulesResponse,
    errors: [],
}));
export const CreateRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    host: Schema.optional(Schema.String),
    inclusive: Schema.optional(Schema.Boolean),
    isPaused: Schema.optional(Schema.Boolean),
    paths: Schema.optional(Schema.Array(Schema.String)),
}).pipe(Schema.encodeKeys({
    host: "host",
    inclusive: "inclusive",
    isPaused: "is_paused",
    paths: "paths",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/rum/v2/{rulesetId}/rule",
}));
export const CreateRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    created: "created",
    host: "host",
    inclusive: "inclusive",
    isPaused: "is_paused",
    paths: "paths",
    priority: "priority",
}))
    .pipe(T.ResponsePath("result"));
export const createRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateRuleRequest,
    output: CreateRuleResponse,
    errors: [],
}));
export const UpdateRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    host: Schema.optional(Schema.String),
    inclusive: Schema.optional(Schema.Boolean),
    isPaused: Schema.optional(Schema.Boolean),
    paths: Schema.optional(Schema.Array(Schema.String)),
}).pipe(Schema.encodeKeys({
    host: "host",
    inclusive: "inclusive",
    isPaused: "is_paused",
    paths: "paths",
}), T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/rum/v2/{rulesetId}/rule/{ruleId}",
}));
export const UpdateRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    created: "created",
    host: "host",
    inclusive: "inclusive",
    isPaused: "is_paused",
    paths: "paths",
    priority: "priority",
}))
    .pipe(T.ResponsePath("result"));
export const updateRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateRuleRequest,
    output: UpdateRuleResponse,
    errors: [],
}));
export const DeleteRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/rum/v2/{rulesetId}/rule/{ruleId}",
}));
export const DeleteRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteRuleRequest,
    output: DeleteRuleResponse,
    errors: [],
}));
export const BulkCreateRulesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    deleteRules: Schema.optional(Schema.Array(Schema.String)),
    rules: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        host: Schema.optional(Schema.String),
        inclusive: Schema.optional(Schema.Boolean),
        isPaused: Schema.optional(Schema.Boolean),
        paths: Schema.optional(Schema.Array(Schema.String)),
    }).pipe(Schema.encodeKeys({
        id: "id",
        host: "host",
        inclusive: "inclusive",
        isPaused: "is_paused",
        paths: "paths",
    })))),
}).pipe(Schema.encodeKeys({ deleteRules: "delete_rules", rules: "rules" }), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/rum/v2/{rulesetId}/rules",
}));
export const BulkCreateRulesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            created: "created",
            host: "host",
            inclusive: "inclusive",
            isPaused: "is_paused",
            paths: "paths",
            priority: "priority",
        }))),
        Schema.Null,
    ])),
    ruleset: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            enabled: "enabled",
            zoneName: "zone_name",
            zoneTag: "zone_tag",
        })),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const bulkCreateRules = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BulkCreateRulesRequest,
    output: BulkCreateRulesResponse,
    errors: [],
}));
export const GetSiteInfoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    siteId: Schema.String.pipe(T.HttpPath("siteId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/rum/site_info/{siteId}",
}));
export const GetSiteInfoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            created: "created",
            host: "host",
            inclusive: "inclusive",
            isPaused: "is_paused",
            paths: "paths",
            priority: "priority",
        }))),
        Schema.Null,
    ])),
    ruleset: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            enabled: "enabled",
            zoneName: "zone_name",
            zoneTag: "zone_tag",
        })),
        Schema.Null,
    ])),
    siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    autoInstall: "auto_install",
    created: "created",
    rules: "rules",
    ruleset: "ruleset",
    siteTag: "site_tag",
    siteToken: "site_token",
    snippet: "snippet",
}))
    .pipe(T.ResponsePath("result"));
export const getSiteInfo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSiteInfoRequest,
    output: GetSiteInfoResponse,
    errors: [],
}));
export const ListSiteInfosRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    orderBy: Schema.optional(Schema.Literals(["host", "created"])).pipe(T.HttpQuery("order_by")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/rum/site_info/list" }));
export const ListSiteInfosResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        rules: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                id: "id",
                created: "created",
                host: "host",
                inclusive: "inclusive",
                isPaused: "is_paused",
                paths: "paths",
                priority: "priority",
            }))),
            Schema.Null,
        ])),
        ruleset: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                id: "id",
                enabled: "enabled",
                zoneName: "zone_name",
                zoneTag: "zone_tag",
            })),
            Schema.Null,
        ])),
        siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        autoInstall: "auto_install",
        created: "created",
        rules: "rules",
        ruleset: "ruleset",
        siteTag: "site_tag",
        siteToken: "site_token",
        snippet: "snippet",
    }))),
    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 listSiteInfos = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSiteInfosRequest,
    output: ListSiteInfosResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateSiteInfoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    autoInstall: Schema.optional(Schema.Boolean),
    host: Schema.optional(Schema.String),
    zoneTag: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    autoInstall: "auto_install",
    host: "host",
    zoneTag: "zone_tag",
}), T.Http({ method: "POST", path: "/accounts/{account_id}/rum/site_info" }));
export const CreateSiteInfoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            created: "created",
            host: "host",
            inclusive: "inclusive",
            isPaused: "is_paused",
            paths: "paths",
            priority: "priority",
        }))),
        Schema.Null,
    ])),
    ruleset: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            enabled: "enabled",
            zoneName: "zone_name",
            zoneTag: "zone_tag",
        })),
        Schema.Null,
    ])),
    siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    autoInstall: "auto_install",
    created: "created",
    rules: "rules",
    ruleset: "ruleset",
    siteTag: "site_tag",
    siteToken: "site_token",
    snippet: "snippet",
}))
    .pipe(T.ResponsePath("result"));
export const createSiteInfo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSiteInfoRequest,
    output: CreateSiteInfoResponse,
    errors: [],
}));
export const UpdateSiteInfoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    siteId: Schema.String.pipe(T.HttpPath("siteId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    autoInstall: Schema.optional(Schema.Boolean),
    enabled: Schema.optional(Schema.Boolean),
    host: Schema.optional(Schema.String),
    lite: Schema.optional(Schema.Boolean),
    zoneTag: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    autoInstall: "auto_install",
    enabled: "enabled",
    host: "host",
    lite: "lite",
    zoneTag: "zone_tag",
}), T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/rum/site_info/{siteId}",
}));
export const UpdateSiteInfoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    rules: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            inclusive: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            isPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            paths: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            created: "created",
            host: "host",
            inclusive: "inclusive",
            isPaused: "is_paused",
            paths: "paths",
            priority: "priority",
        }))),
        Schema.Null,
    ])),
    ruleset: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            zoneName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            enabled: "enabled",
            zoneName: "zone_name",
            zoneTag: "zone_tag",
        })),
        Schema.Null,
    ])),
    siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    autoInstall: "auto_install",
    created: "created",
    rules: "rules",
    ruleset: "ruleset",
    siteTag: "site_tag",
    siteToken: "site_token",
    snippet: "snippet",
}))
    .pipe(T.ResponsePath("result"));
export const updateSiteInfo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateSiteInfoRequest,
    output: UpdateSiteInfoResponse,
    errors: [],
}));
export const DeleteSiteInfoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    siteId: Schema.String.pipe(T.HttpPath("siteId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/rum/site_info/{siteId}",
}));
export const DeleteSiteInfoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({ siteTag: "site_tag" }))
    .pipe(T.ResponsePath("result"));
export const deleteSiteInfo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSiteInfoRequest,
    output: DeleteSiteInfoResponse,
    errors: [],
}));
//# sourceMappingURL=rum.js.map