/**
 * Cloudflare FRAUD API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service fraud
 */
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 GetFraudRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/fraud_detection/settings" }));
export const GetFraudResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    authenticationSettings: Schema.optional(Schema.Union([
        Schema.Struct({
            failureCriteria: Schema.optional(Schema.Union([
                Schema.Struct({
                    kind: Schema.Literal("status_code"),
                    statusCodes: Schema.optional(Schema.Union([Schema.Array(Schema.Number), Schema.Null])),
                }).pipe(Schema.encodeKeys({ kind: "kind", statusCodes: "status_codes" })),
                Schema.Null,
            ])),
            successCriteria: Schema.optional(Schema.Union([
                Schema.Struct({
                    kind: Schema.Literal("status_code"),
                    statusCodes: Schema.optional(Schema.Union([Schema.Array(Schema.Number), Schema.Null])),
                }).pipe(Schema.encodeKeys({ kind: "kind", statusCodes: "status_codes" })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            failureCriteria: "failure_criteria",
            successCriteria: "success_criteria",
        })),
        Schema.Null,
    ])),
    userProfiles: Schema.optional(Schema.Union([Schema.Literals(["enabled", "disabled"]), Schema.Null])),
    usernameExpressions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    authenticationSettings: "authentication_settings",
    userProfiles: "user_profiles",
    usernameExpressions: "username_expressions",
}))
    .pipe(T.ResponsePath("result"));
export const getFraud = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetFraudRequest,
    output: GetFraudResponse,
    errors: [],
}));
export const PutFraudRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    authenticationSettings: Schema.optional(Schema.Struct({
        failureCriteria: Schema.optional(Schema.Struct({
            kind: Schema.Literal("status_code"),
            statusCodes: Schema.optional(Schema.Array(Schema.Number)),
        }).pipe(Schema.encodeKeys({ kind: "kind", statusCodes: "status_codes" }))),
        successCriteria: Schema.optional(Schema.Struct({
            kind: Schema.Literal("status_code"),
            statusCodes: Schema.optional(Schema.Array(Schema.Number)),
        }).pipe(Schema.encodeKeys({ kind: "kind", statusCodes: "status_codes" }))),
    }).pipe(Schema.encodeKeys({
        failureCriteria: "failure_criteria",
        successCriteria: "success_criteria",
    }))),
    userProfiles: Schema.optional(Schema.Literals(["enabled", "disabled"])),
    usernameExpressions: Schema.optional(Schema.Array(Schema.String)),
}).pipe(Schema.encodeKeys({
    authenticationSettings: "authentication_settings",
    userProfiles: "user_profiles",
    usernameExpressions: "username_expressions",
}), T.Http({ method: "PUT", path: "/zones/{zone_id}/fraud_detection/settings" }));
export const PutFraudResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    authenticationSettings: Schema.optional(Schema.Union([
        Schema.Struct({
            failureCriteria: Schema.optional(Schema.Union([
                Schema.Struct({
                    kind: Schema.Literal("status_code"),
                    statusCodes: Schema.optional(Schema.Union([Schema.Array(Schema.Number), Schema.Null])),
                }).pipe(Schema.encodeKeys({ kind: "kind", statusCodes: "status_codes" })),
                Schema.Null,
            ])),
            successCriteria: Schema.optional(Schema.Union([
                Schema.Struct({
                    kind: Schema.Literal("status_code"),
                    statusCodes: Schema.optional(Schema.Union([Schema.Array(Schema.Number), Schema.Null])),
                }).pipe(Schema.encodeKeys({ kind: "kind", statusCodes: "status_codes" })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            failureCriteria: "failure_criteria",
            successCriteria: "success_criteria",
        })),
        Schema.Null,
    ])),
    userProfiles: Schema.optional(Schema.Union([Schema.Literals(["enabled", "disabled"]), Schema.Null])),
    usernameExpressions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    authenticationSettings: "authentication_settings",
    userProfiles: "user_profiles",
    usernameExpressions: "username_expressions",
}))
    .pipe(T.ResponsePath("result"));
export const putFraud = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutFraudRequest,
    output: PutFraudResponse,
    errors: [],
}));
//# sourceMappingURL=fraud.js.map