/**
 * Cloudflare AI-GATEWAY API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service ai-gateway
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
// =============================================================================
// Errors
// =============================================================================
export class GatewayAlreadyExists extends Schema.TaggedErrorClass()("GatewayAlreadyExists", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(GatewayAlreadyExists, [{ code: 7001 }, { status: 504 }]);
export class GatewayNotFound extends Schema.TaggedErrorClass()("GatewayNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(GatewayNotFound, [{ code: 7002 }]);
export const GetAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{id}",
}));
export const GetAiGatewayResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    cacheInvalidateOnUpdate: Schema.Boolean,
    cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    collectLogs: Schema.Boolean,
    createdAt: Schema.String,
    internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedAt: Schema.String,
    rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
    authentication: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    dlp: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                action: Schema.Literals(["BLOCK", "FLAG"]),
                enabled: Schema.Boolean,
                profiles: Schema.Array(Schema.String),
            }),
            Schema.Struct({
                enabled: Schema.Boolean,
                policies: Schema.Array(Schema.Struct({
                    id: Schema.String,
                    action: Schema.Literals(["FLAG", "BLOCK"]),
                    check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
                    enabled: Schema.Boolean,
                    profiles: Schema.Array(Schema.String),
                })),
            }),
        ]),
        Schema.Null,
    ])),
    isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    logManagementStrategy: Schema.optional(Schema.Union([
        Schema.Literal("STOP_INSERTING"),
        Schema.Literal("DELETE_OLDEST"),
        Schema.Null,
    ])),
    logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    otel: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            authorization: Schema.String,
            headers: Schema.Record(Schema.String, Schema.Unknown),
            url: Schema.String,
        })),
        Schema.Null,
    ])),
    storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    stripe: Schema.optional(Schema.Union([
        Schema.Struct({
            authorization: Schema.String,
            usageEvents: Schema.Array(Schema.Struct({
                payload: Schema.String,
            })),
        }).pipe(Schema.encodeKeys({
            authorization: "authorization",
            usageEvents: "usage_events",
        })),
        Schema.Null,
    ])),
    zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    cacheInvalidateOnUpdate: "cache_invalidate_on_update",
    cacheTtl: "cache_ttl",
    collectLogs: "collect_logs",
    createdAt: "created_at",
    internalId: "internal_id",
    modifiedAt: "modified_at",
    rateLimitingInterval: "rate_limiting_interval",
    rateLimitingLimit: "rate_limiting_limit",
    rateLimitingTechnique: "rate_limiting_technique",
    authentication: "authentication",
    dlp: "dlp",
    isDefault: "is_default",
    logManagement: "log_management",
    logManagementStrategy: "log_management_strategy",
    logpush: "logpush",
    logpushPublicKey: "logpush_public_key",
    otel: "otel",
    storeId: "store_id",
    stripe: "stripe",
    zdr: "zdr",
}))
    .pipe(T.ResponsePath("result"));
export const getAiGateway = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAiGatewayRequest,
    output: GetAiGatewayResponse,
    errors: [GatewayNotFound],
}));
export const ListAiGatewaysRequest = /*@__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")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/ai-gateway/gateways" }));
export const ListAiGatewaysResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        accountId: Schema.String,
        accountTag: Schema.String,
        cacheInvalidateOnUpdate: Schema.Boolean,
        cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
        collectLogs: Schema.Boolean,
        createdAt: Schema.String,
        internalId: Schema.String,
        modifiedAt: Schema.String,
        rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
        rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
        rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
        authentication: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        dlp: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    action: Schema.Literals(["BLOCK", "FLAG"]),
                    enabled: Schema.Boolean,
                    profiles: Schema.Array(Schema.String),
                }),
                Schema.Struct({
                    enabled: Schema.Boolean,
                    policies: Schema.Array(Schema.Struct({
                        id: Schema.String,
                        action: Schema.Literals(["FLAG", "BLOCK"]),
                        check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
                        enabled: Schema.Boolean,
                        profiles: Schema.Array(Schema.String),
                    })),
                }),
            ]),
            Schema.Null,
        ])),
        isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        logManagementStrategy: Schema.optional(Schema.Union([
            Schema.Literal("STOP_INSERTING"),
            Schema.Literal("DELETE_OLDEST"),
            Schema.Null,
        ])),
        logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        otel: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                authorization: Schema.String,
                headers: Schema.Record(Schema.String, Schema.Unknown),
                url: Schema.String,
            })),
            Schema.Null,
        ])),
        storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        stripe: Schema.optional(Schema.Union([
            Schema.Struct({
                authorization: Schema.String,
                usageEvents: Schema.Array(Schema.Struct({
                    payload: Schema.String,
                })),
            }).pipe(Schema.encodeKeys({
                authorization: "authorization",
                usageEvents: "usage_events",
            })),
            Schema.Null,
        ])),
        zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        accountId: "account_id",
        accountTag: "account_tag",
        cacheInvalidateOnUpdate: "cache_invalidate_on_update",
        cacheTtl: "cache_ttl",
        collectLogs: "collect_logs",
        createdAt: "created_at",
        internalId: "internal_id",
        modifiedAt: "modified_at",
        rateLimitingInterval: "rate_limiting_interval",
        rateLimitingLimit: "rate_limiting_limit",
        rateLimitingTechnique: "rate_limiting_technique",
        authentication: "authentication",
        dlp: "dlp",
        isDefault: "is_default",
        logManagement: "log_management",
        logManagementStrategy: "log_management_strategy",
        logpush: "logpush",
        logpushPublicKey: "logpush_public_key",
        otel: "otel",
        storeId: "store_id",
        stripe: "stripe",
        zdr: "zdr",
    }))),
    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 listAiGateways = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAiGatewaysRequest,
    output: ListAiGatewaysResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.String,
    cacheInvalidateOnUpdate: Schema.Boolean,
    cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    collectLogs: Schema.Boolean,
    rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
    authentication: Schema.optional(Schema.Boolean),
    isDefault: Schema.optional(Schema.Boolean),
    logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    logManagementStrategy: Schema.optional(Schema.Union([
        Schema.Literal("STOP_INSERTING"),
        Schema.Literal("DELETE_OLDEST"),
        Schema.Null,
    ])),
    logpush: Schema.optional(Schema.Boolean),
    logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    zdr: Schema.optional(Schema.Boolean),
}).pipe(Schema.encodeKeys({
    id: "id",
    cacheInvalidateOnUpdate: "cache_invalidate_on_update",
    cacheTtl: "cache_ttl",
    collectLogs: "collect_logs",
    rateLimitingInterval: "rate_limiting_interval",
    rateLimitingLimit: "rate_limiting_limit",
    rateLimitingTechnique: "rate_limiting_technique",
    authentication: "authentication",
    isDefault: "is_default",
    logManagement: "log_management",
    logManagementStrategy: "log_management_strategy",
    logpush: "logpush",
    logpushPublicKey: "logpush_public_key",
    zdr: "zdr",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/ai-gateway/gateways",
}));
export const CreateAiGatewayResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    cacheInvalidateOnUpdate: Schema.Boolean,
    cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    collectLogs: Schema.Boolean,
    createdAt: Schema.String,
    internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedAt: Schema.String,
    rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
    authentication: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    dlp: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                action: Schema.Literals(["BLOCK", "FLAG"]),
                enabled: Schema.Boolean,
                profiles: Schema.Array(Schema.String),
            }),
            Schema.Struct({
                enabled: Schema.Boolean,
                policies: Schema.Array(Schema.Struct({
                    id: Schema.String,
                    action: Schema.Literals(["FLAG", "BLOCK"]),
                    check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
                    enabled: Schema.Boolean,
                    profiles: Schema.Array(Schema.String),
                })),
            }),
        ]),
        Schema.Null,
    ])),
    isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    logManagementStrategy: Schema.optional(Schema.Union([
        Schema.Literal("STOP_INSERTING"),
        Schema.Literal("DELETE_OLDEST"),
        Schema.Null,
    ])),
    logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    otel: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            authorization: Schema.String,
            headers: Schema.Record(Schema.String, Schema.Unknown),
            url: Schema.String,
        })),
        Schema.Null,
    ])),
    storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    stripe: Schema.optional(Schema.Union([
        Schema.Struct({
            authorization: Schema.String,
            usageEvents: Schema.Array(Schema.Struct({
                payload: Schema.String,
            })),
        }).pipe(Schema.encodeKeys({
            authorization: "authorization",
            usageEvents: "usage_events",
        })),
        Schema.Null,
    ])),
    zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    cacheInvalidateOnUpdate: "cache_invalidate_on_update",
    cacheTtl: "cache_ttl",
    collectLogs: "collect_logs",
    createdAt: "created_at",
    internalId: "internal_id",
    modifiedAt: "modified_at",
    rateLimitingInterval: "rate_limiting_interval",
    rateLimitingLimit: "rate_limiting_limit",
    rateLimitingTechnique: "rate_limiting_technique",
    authentication: "authentication",
    dlp: "dlp",
    isDefault: "is_default",
    logManagement: "log_management",
    logManagementStrategy: "log_management_strategy",
    logpush: "logpush",
    logpushPublicKey: "logpush_public_key",
    otel: "otel",
    storeId: "store_id",
    stripe: "stripe",
    zdr: "zdr",
}))
    .pipe(T.ResponsePath("result"));
export const createAiGateway = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAiGatewayRequest,
    output: CreateAiGatewayResponse,
    errors: [GatewayAlreadyExists],
}));
export const UpdateAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheInvalidateOnUpdate: Schema.Boolean,
    cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    collectLogs: Schema.Boolean,
    rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
    authentication: Schema.optional(Schema.Boolean),
    dlp: Schema.optional(Schema.Union([
        Schema.Struct({
            action: Schema.Literals(["BLOCK", "FLAG"]),
            enabled: Schema.Boolean,
            profiles: Schema.Array(Schema.String),
        }),
        Schema.Struct({
            enabled: Schema.Boolean,
            policies: Schema.Array(Schema.Struct({
                id: Schema.String,
                action: Schema.Literals(["FLAG", "BLOCK"]),
                check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
                enabled: Schema.Boolean,
                profiles: Schema.Array(Schema.String),
            })),
        }),
    ])),
    isDefault: Schema.optional(Schema.Boolean),
    logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    logManagementStrategy: Schema.optional(Schema.Union([
        Schema.Literal("STOP_INSERTING"),
        Schema.Literal("DELETE_OLDEST"),
        Schema.Null,
    ])),
    logpush: Schema.optional(Schema.Boolean),
    logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    otel: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            authorization: Schema.String,
            headers: Schema.Record(Schema.String, Schema.Unknown),
            url: Schema.String,
        })),
        Schema.Null,
    ])),
    storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    stripe: Schema.optional(Schema.Union([
        Schema.Struct({
            authorization: Schema.String,
            usageEvents: Schema.Array(Schema.Struct({
                payload: Schema.String,
            })),
        }).pipe(Schema.encodeKeys({
            authorization: "authorization",
            usageEvents: "usage_events",
        })),
        Schema.Null,
    ])),
    zdr: Schema.optional(Schema.Boolean),
}).pipe(Schema.encodeKeys({
    cacheInvalidateOnUpdate: "cache_invalidate_on_update",
    cacheTtl: "cache_ttl",
    collectLogs: "collect_logs",
    rateLimitingInterval: "rate_limiting_interval",
    rateLimitingLimit: "rate_limiting_limit",
    rateLimitingTechnique: "rate_limiting_technique",
    authentication: "authentication",
    dlp: "dlp",
    isDefault: "is_default",
    logManagement: "log_management",
    logManagementStrategy: "log_management_strategy",
    logpush: "logpush",
    logpushPublicKey: "logpush_public_key",
    otel: "otel",
    storeId: "store_id",
    stripe: "stripe",
    zdr: "zdr",
}), T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/ai-gateway/gateways/{id}",
}));
export const UpdateAiGatewayResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    cacheInvalidateOnUpdate: Schema.Boolean,
    cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    collectLogs: Schema.Boolean,
    createdAt: Schema.String,
    internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedAt: Schema.String,
    rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
    authentication: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    dlp: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                action: Schema.Literals(["BLOCK", "FLAG"]),
                enabled: Schema.Boolean,
                profiles: Schema.Array(Schema.String),
            }),
            Schema.Struct({
                enabled: Schema.Boolean,
                policies: Schema.Array(Schema.Struct({
                    id: Schema.String,
                    action: Schema.Literals(["FLAG", "BLOCK"]),
                    check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
                    enabled: Schema.Boolean,
                    profiles: Schema.Array(Schema.String),
                })),
            }),
        ]),
        Schema.Null,
    ])),
    isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    logManagementStrategy: Schema.optional(Schema.Union([
        Schema.Literal("STOP_INSERTING"),
        Schema.Literal("DELETE_OLDEST"),
        Schema.Null,
    ])),
    logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    otel: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            authorization: Schema.String,
            headers: Schema.Record(Schema.String, Schema.Unknown),
            url: Schema.String,
        })),
        Schema.Null,
    ])),
    storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    stripe: Schema.optional(Schema.Union([
        Schema.Struct({
            authorization: Schema.String,
            usageEvents: Schema.Array(Schema.Struct({
                payload: Schema.String,
            })),
        }).pipe(Schema.encodeKeys({
            authorization: "authorization",
            usageEvents: "usage_events",
        })),
        Schema.Null,
    ])),
    zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    cacheInvalidateOnUpdate: "cache_invalidate_on_update",
    cacheTtl: "cache_ttl",
    collectLogs: "collect_logs",
    createdAt: "created_at",
    internalId: "internal_id",
    modifiedAt: "modified_at",
    rateLimitingInterval: "rate_limiting_interval",
    rateLimitingLimit: "rate_limiting_limit",
    rateLimitingTechnique: "rate_limiting_technique",
    authentication: "authentication",
    dlp: "dlp",
    isDefault: "is_default",
    logManagement: "log_management",
    logManagementStrategy: "log_management_strategy",
    logpush: "logpush",
    logpushPublicKey: "logpush_public_key",
    otel: "otel",
    storeId: "store_id",
    stripe: "stripe",
    zdr: "zdr",
}))
    .pipe(T.ResponsePath("result"));
export const updateAiGateway = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAiGatewayRequest,
    output: UpdateAiGatewayResponse,
    errors: [GatewayNotFound],
}));
export const DeleteAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/ai-gateway/gateways/{id}",
}));
export const DeleteAiGatewayResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    cacheInvalidateOnUpdate: Schema.Boolean,
    cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    collectLogs: Schema.Boolean,
    createdAt: Schema.String,
    internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedAt: Schema.String,
    rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
    rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
    authentication: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    dlp: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                action: Schema.Literals(["BLOCK", "FLAG"]),
                enabled: Schema.Boolean,
                profiles: Schema.Array(Schema.String),
            }),
            Schema.Struct({
                enabled: Schema.Boolean,
                policies: Schema.Array(Schema.Struct({
                    id: Schema.String,
                    action: Schema.Literals(["FLAG", "BLOCK"]),
                    check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
                    enabled: Schema.Boolean,
                    profiles: Schema.Array(Schema.String),
                })),
            }),
        ]),
        Schema.Null,
    ])),
    isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    logManagementStrategy: Schema.optional(Schema.Union([
        Schema.Literal("STOP_INSERTING"),
        Schema.Literal("DELETE_OLDEST"),
        Schema.Null,
    ])),
    logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    otel: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            authorization: Schema.String,
            headers: Schema.Record(Schema.String, Schema.Unknown),
            url: Schema.String,
        })),
        Schema.Null,
    ])),
    storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    stripe: Schema.optional(Schema.Union([
        Schema.Struct({
            authorization: Schema.String,
            usageEvents: Schema.Array(Schema.Struct({
                payload: Schema.String,
            })),
        }).pipe(Schema.encodeKeys({
            authorization: "authorization",
            usageEvents: "usage_events",
        })),
        Schema.Null,
    ])),
    zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    cacheInvalidateOnUpdate: "cache_invalidate_on_update",
    cacheTtl: "cache_ttl",
    collectLogs: "collect_logs",
    createdAt: "created_at",
    internalId: "internal_id",
    modifiedAt: "modified_at",
    rateLimitingInterval: "rate_limiting_interval",
    rateLimitingLimit: "rate_limiting_limit",
    rateLimitingTechnique: "rate_limiting_technique",
    authentication: "authentication",
    dlp: "dlp",
    isDefault: "is_default",
    logManagement: "log_management",
    logManagementStrategy: "log_management_strategy",
    logpush: "logpush",
    logpushPublicKey: "logpush_public_key",
    otel: "otel",
    storeId: "store_id",
    stripe: "stripe",
    zdr: "zdr",
}))
    .pipe(T.ResponsePath("result"));
export const deleteAiGateway = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAiGatewayRequest,
    output: DeleteAiGatewayResponse,
    errors: [GatewayNotFound],
}));
export const GetDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets/{id}",
}));
export const GetDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    enable: Schema.Boolean,
    filters: Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "created_at",
            "request_content_type",
            "response_content_type",
            "success",
            "cached",
            "provider",
            "model",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
        ]),
        operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
    })),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    enable: "enable",
    filters: "filters",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const getDataset = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDatasetRequest,
    output: GetDatasetResponse,
    errors: [],
}));
export const ListDatasetsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    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")),
    enable: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("enable")),
    name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets",
}));
export const ListDatasetsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        accountId: Schema.String,
        accountTag: Schema.String,
        createdAt: Schema.String,
        enable: Schema.Boolean,
        filters: Schema.Array(Schema.Struct({
            key: Schema.Literals([
                "created_at",
                "request_content_type",
                "response_content_type",
                "success",
                "cached",
                "provider",
                "model",
                "cost",
                "tokens",
                "tokens_in",
                "tokens_out",
                "duration",
                "feedback",
            ]),
            operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
            value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
        })),
        gatewayId: Schema.String,
        modifiedAt: Schema.String,
        name: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        accountId: "account_id",
        accountTag: "account_tag",
        createdAt: "created_at",
        enable: "enable",
        filters: "filters",
        gatewayId: "gateway_id",
        modifiedAt: "modified_at",
        name: "name",
    }))),
    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 listDatasets = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListDatasetsRequest,
    output: ListDatasetsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    enable: Schema.Boolean,
    filters: Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "created_at",
            "request_content_type",
            "response_content_type",
            "success",
            "cached",
            "provider",
            "model",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
        ]),
        operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
    })),
    name: Schema.String,
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets",
}));
export const CreateDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    enable: Schema.Boolean,
    filters: Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "created_at",
            "request_content_type",
            "response_content_type",
            "success",
            "cached",
            "provider",
            "model",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
        ]),
        operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
    })),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    enable: "enable",
    filters: "filters",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const createDataset = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateDatasetRequest,
    output: CreateDatasetResponse,
    errors: [],
}));
export const UpdateDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    enable: Schema.Boolean,
    filters: Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "created_at",
            "request_content_type",
            "response_content_type",
            "success",
            "cached",
            "provider",
            "model",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
        ]),
        operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
    })),
    name: Schema.String,
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets/{id}",
}));
export const UpdateDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    enable: Schema.Boolean,
    filters: Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "created_at",
            "request_content_type",
            "response_content_type",
            "success",
            "cached",
            "provider",
            "model",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
        ]),
        operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
    })),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    enable: "enable",
    filters: "filters",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const updateDataset = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateDatasetRequest,
    output: UpdateDatasetResponse,
    errors: [],
}));
export const DeleteDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets/{id}",
}));
export const DeleteDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    enable: Schema.Boolean,
    filters: Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "created_at",
            "request_content_type",
            "response_content_type",
            "success",
            "cached",
            "provider",
            "model",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
        ]),
        operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
    })),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    enable: "enable",
    filters: "filters",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const deleteDataset = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteDatasetRequest,
    output: DeleteDatasetResponse,
    errors: [],
}));
export const GetEvaluationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations/{id}",
}));
export const GetEvaluationResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    datasets: Schema.Array(Schema.Struct({
        id: Schema.String,
        accountId: Schema.String,
        accountTag: Schema.String,
        createdAt: Schema.String,
        enable: Schema.Boolean,
        filters: Schema.Array(Schema.Struct({
            key: Schema.Literals([
                "created_at",
                "request_content_type",
                "response_content_type",
                "success",
                "cached",
                "provider",
                "model",
                "cost",
                "tokens",
                "tokens_in",
                "tokens_out",
                "duration",
                "feedback",
            ]),
            operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
            value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
        })),
        gatewayId: Schema.String,
        modifiedAt: Schema.String,
        name: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        accountId: "account_id",
        accountTag: "account_tag",
        createdAt: "created_at",
        enable: "enable",
        filters: "filters",
        gatewayId: "gateway_id",
        modifiedAt: "modified_at",
        name: "name",
    }))),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
    processed: Schema.Boolean,
    results: Schema.Array(Schema.Struct({
        id: Schema.String,
        createdAt: Schema.String,
        evaluationId: Schema.String,
        evaluationTypeId: Schema.String,
        modifiedAt: Schema.String,
        result: Schema.String,
        status: Schema.Number,
        statusDescription: Schema.String,
        totalLogs: Schema.Number,
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        evaluationId: "evaluation_id",
        evaluationTypeId: "evaluation_type_id",
        modifiedAt: "modified_at",
        result: "result",
        status: "status",
        statusDescription: "status_description",
        totalLogs: "total_logs",
    }))),
    totalLogs: Schema.Number,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    datasets: "datasets",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
    processed: "processed",
    results: "results",
    totalLogs: "total_logs",
}))
    .pipe(T.ResponsePath("result"));
export const getEvaluation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetEvaluationRequest,
    output: GetEvaluationResponse,
    errors: [],
}));
export const ListEvaluationsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    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")),
    name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
    processed: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("processed")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations",
}));
export const ListEvaluationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        accountId: Schema.String,
        accountTag: Schema.String,
        createdAt: Schema.String,
        datasets: Schema.Array(Schema.Struct({
            id: Schema.String,
            accountId: Schema.String,
            accountTag: Schema.String,
            createdAt: Schema.String,
            enable: Schema.Boolean,
            filters: Schema.Array(Schema.Struct({
                key: Schema.Literals([
                    "created_at",
                    "request_content_type",
                    "response_content_type",
                    "success",
                    "cached",
                    "provider",
                    "model",
                    "cost",
                    "tokens",
                    "tokens_in",
                    "tokens_out",
                    "duration",
                    "feedback",
                ]),
                operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
                value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
            })),
            gatewayId: Schema.String,
            modifiedAt: Schema.String,
            name: Schema.String,
        }).pipe(Schema.encodeKeys({
            id: "id",
            accountId: "account_id",
            accountTag: "account_tag",
            createdAt: "created_at",
            enable: "enable",
            filters: "filters",
            gatewayId: "gateway_id",
            modifiedAt: "modified_at",
            name: "name",
        }))),
        gatewayId: Schema.String,
        modifiedAt: Schema.String,
        name: Schema.String,
        processed: Schema.Boolean,
        results: Schema.Array(Schema.Struct({
            id: Schema.String,
            createdAt: Schema.String,
            evaluationId: Schema.String,
            evaluationTypeId: Schema.String,
            modifiedAt: Schema.String,
            result: Schema.String,
            status: Schema.Number,
            statusDescription: Schema.String,
            totalLogs: Schema.Number,
        }).pipe(Schema.encodeKeys({
            id: "id",
            createdAt: "created_at",
            evaluationId: "evaluation_id",
            evaluationTypeId: "evaluation_type_id",
            modifiedAt: "modified_at",
            result: "result",
            status: "status",
            statusDescription: "status_description",
            totalLogs: "total_logs",
        }))),
        totalLogs: Schema.Number,
    }).pipe(Schema.encodeKeys({
        id: "id",
        accountId: "account_id",
        accountTag: "account_tag",
        createdAt: "created_at",
        datasets: "datasets",
        gatewayId: "gateway_id",
        modifiedAt: "modified_at",
        name: "name",
        processed: "processed",
        results: "results",
        totalLogs: "total_logs",
    }))),
    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 listEvaluations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListEvaluationsRequest,
    output: ListEvaluationsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateEvaluationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    datasetIds: Schema.Array(Schema.String),
    evaluationTypeIds: Schema.Array(Schema.String),
    name: Schema.String,
}).pipe(Schema.encodeKeys({
    datasetIds: "dataset_ids",
    evaluationTypeIds: "evaluation_type_ids",
    name: "name",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations",
}));
export const CreateEvaluationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    datasets: Schema.Array(Schema.Struct({
        id: Schema.String,
        accountId: Schema.String,
        accountTag: Schema.String,
        createdAt: Schema.String,
        enable: Schema.Boolean,
        filters: Schema.Array(Schema.Struct({
            key: Schema.Literals([
                "created_at",
                "request_content_type",
                "response_content_type",
                "success",
                "cached",
                "provider",
                "model",
                "cost",
                "tokens",
                "tokens_in",
                "tokens_out",
                "duration",
                "feedback",
            ]),
            operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
            value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
        })),
        gatewayId: Schema.String,
        modifiedAt: Schema.String,
        name: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        accountId: "account_id",
        accountTag: "account_tag",
        createdAt: "created_at",
        enable: "enable",
        filters: "filters",
        gatewayId: "gateway_id",
        modifiedAt: "modified_at",
        name: "name",
    }))),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
    processed: Schema.Boolean,
    results: Schema.Array(Schema.Struct({
        id: Schema.String,
        createdAt: Schema.String,
        evaluationId: Schema.String,
        evaluationTypeId: Schema.String,
        modifiedAt: Schema.String,
        result: Schema.String,
        status: Schema.Number,
        statusDescription: Schema.String,
        totalLogs: Schema.Number,
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        evaluationId: "evaluation_id",
        evaluationTypeId: "evaluation_type_id",
        modifiedAt: "modified_at",
        result: "result",
        status: "status",
        statusDescription: "status_description",
        totalLogs: "total_logs",
    }))),
    totalLogs: Schema.Number,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    datasets: "datasets",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
    processed: "processed",
    results: "results",
    totalLogs: "total_logs",
}))
    .pipe(T.ResponsePath("result"));
export const createEvaluation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateEvaluationRequest,
    output: CreateEvaluationResponse,
    errors: [],
}));
export const DeleteEvaluationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations/{id}",
}));
export const DeleteEvaluationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    accountId: Schema.String,
    accountTag: Schema.String,
    createdAt: Schema.String,
    datasets: Schema.Array(Schema.Struct({
        id: Schema.String,
        accountId: Schema.String,
        accountTag: Schema.String,
        createdAt: Schema.String,
        enable: Schema.Boolean,
        filters: Schema.Array(Schema.Struct({
            key: Schema.Literals([
                "created_at",
                "request_content_type",
                "response_content_type",
                "success",
                "cached",
                "provider",
                "model",
                "cost",
                "tokens",
                "tokens_in",
                "tokens_out",
                "duration",
                "feedback",
            ]),
            operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
            value: Schema.Array(Schema.Union([Schema.String, Schema.Number, Schema.Boolean])),
        })),
        gatewayId: Schema.String,
        modifiedAt: Schema.String,
        name: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        accountId: "account_id",
        accountTag: "account_tag",
        createdAt: "created_at",
        enable: "enable",
        filters: "filters",
        gatewayId: "gateway_id",
        modifiedAt: "modified_at",
        name: "name",
    }))),
    gatewayId: Schema.String,
    modifiedAt: Schema.String,
    name: Schema.String,
    processed: Schema.Boolean,
    results: Schema.Array(Schema.Struct({
        id: Schema.String,
        createdAt: Schema.String,
        evaluationId: Schema.String,
        evaluationTypeId: Schema.String,
        modifiedAt: Schema.String,
        result: Schema.String,
        status: Schema.Number,
        statusDescription: Schema.String,
        totalLogs: Schema.Number,
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        evaluationId: "evaluation_id",
        evaluationTypeId: "evaluation_type_id",
        modifiedAt: "modified_at",
        result: "result",
        status: "status",
        statusDescription: "status_description",
        totalLogs: "total_logs",
    }))),
    totalLogs: Schema.Number,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountId: "account_id",
    accountTag: "account_tag",
    createdAt: "created_at",
    datasets: "datasets",
    gatewayId: "gateway_id",
    modifiedAt: "modified_at",
    name: "name",
    processed: "processed",
    results: "results",
    totalLogs: "total_logs",
}))
    .pipe(T.ResponsePath("result"));
export const deleteEvaluation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteEvaluationRequest,
    output: DeleteEvaluationResponse,
    errors: [],
}));
export const ListEvaluationTypesRequest = 
/*@__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.String).pipe(T.HttpQuery("order_by")),
    orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("order_by_direction")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/evaluation-types",
}));
export const ListEvaluationTypesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        createdAt: Schema.String,
        description: Schema.String,
        enable: Schema.Boolean,
        mandatory: Schema.Boolean,
        modifiedAt: Schema.String,
        name: Schema.String,
        type: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        description: "description",
        enable: "enable",
        mandatory: "mandatory",
        modifiedAt: "modified_at",
        name: "name",
        type: "type",
    }))),
    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 listEvaluationTypes = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListEvaluationTypesRequest,
    output: ListEvaluationTypesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const GetLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}",
}));
export const GetLogResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    cached: Schema.Boolean,
    createdAt: Schema.String,
    duration: Schema.Number,
    model: Schema.String,
    path: Schema.String,
    provider: Schema.String,
    success: Schema.Boolean,
    tokensIn: Schema.Union([Schema.Number, Schema.Null]),
    tokensOut: Schema.Union([Schema.Number, Schema.Null]),
    cost: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    customCost: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    metadata: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modelType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requestContentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requestHead: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requestHeadComplete: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    requestSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    requestType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    responseContentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    responseHead: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    responseHeadComplete: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    responseSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    statusCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    step: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    cached: "cached",
    createdAt: "created_at",
    duration: "duration",
    model: "model",
    path: "path",
    provider: "provider",
    success: "success",
    tokensIn: "tokens_in",
    tokensOut: "tokens_out",
    cost: "cost",
    customCost: "custom_cost",
    metadata: "metadata",
    modelType: "model_type",
    requestContentType: "request_content_type",
    requestHead: "request_head",
    requestHeadComplete: "request_head_complete",
    requestSize: "request_size",
    requestType: "request_type",
    responseContentType: "response_content_type",
    responseHead: "response_head",
    responseHeadComplete: "response_head_complete",
    responseSize: "response_size",
    statusCode: "status_code",
    step: "step",
}))
    .pipe(T.ResponsePath("result"));
export const getLog = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetLogRequest,
    output: GetLogResponse,
    errors: [],
}));
export const ListLogsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    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")),
    cached: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("cached")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    endDate: Schema.optional(Schema.String).pipe(T.HttpQuery("end_date")),
    feedback: Schema.optional(Schema.Literals(["0", "1"])).pipe(T.HttpQuery("feedback")),
    filters: Schema.optional(Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "id",
            "created_at",
            "request_content_type",
            "response_content_type",
            "request_type",
            "success",
            "cached",
            "provider",
            "model",
            "model_type",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
            "event_id",
            "metadata.key",
            "metadata.value",
            "prompts.prompt_id",
            "prompts.version_id",
            "authentication",
            "wholesale",
            "compatibilityMode",
            "dlp_action",
        ]),
        operator: Schema.Literals(["eq", "neq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([
            Schema.String,
            Schema.Null,
            Schema.Number,
            Schema.Boolean,
        ])),
    }))).pipe(T.HttpQuery("filters")),
    maxCost: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_cost")),
    maxDuration: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_duration")),
    maxTokensIn: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_tokens_in")),
    maxTokensOut: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_tokens_out")),
    maxTotalTokens: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_total_tokens")),
    metaInfo: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("meta_info")),
    minCost: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_cost")),
    minDuration: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_duration")),
    minTokensIn: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_tokens_in")),
    minTokensOut: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_tokens_out")),
    minTotalTokens: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_total_tokens")),
    model: Schema.optional(Schema.String).pipe(T.HttpQuery("model")),
    modelType: Schema.optional(Schema.String).pipe(T.HttpQuery("model_type")),
    orderBy: Schema.optional(Schema.Literals([
        "created_at",
        "provider",
        "model",
        "model_type",
        "success",
        "cached",
    ])).pipe(T.HttpQuery("order_by")),
    orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("order_by_direction")),
    provider: Schema.optional(Schema.String).pipe(T.HttpQuery("provider")),
    requestContentType: Schema.optional(Schema.String).pipe(T.HttpQuery("request_content_type")),
    responseContentType: Schema.optional(Schema.String).pipe(T.HttpQuery("response_content_type")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
    startDate: Schema.optional(Schema.String).pipe(T.HttpQuery("start_date")),
    success: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("success")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs",
}));
export const ListLogsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        cached: Schema.Boolean,
        createdAt: Schema.String,
        duration: Schema.Number,
        model: Schema.String,
        path: Schema.String,
        provider: Schema.String,
        success: Schema.Boolean,
        tokensIn: Schema.Union([Schema.Number, Schema.Null]),
        tokensOut: Schema.Union([Schema.Number, Schema.Null]),
        cost: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        customCost: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        metadata: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        modelType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        requestContentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        requestType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        responseContentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        statusCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        step: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        cached: "cached",
        createdAt: "created_at",
        duration: "duration",
        model: "model",
        path: "path",
        provider: "provider",
        success: "success",
        tokensIn: "tokens_in",
        tokensOut: "tokens_out",
        cost: "cost",
        customCost: "custom_cost",
        metadata: "metadata",
        modelType: "model_type",
        requestContentType: "request_content_type",
        requestType: "request_type",
        responseContentType: "response_content_type",
        statusCode: "status_code",
        step: "step",
    }))),
    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 listLogs = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListLogsRequest,
    output: ListLogsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PatchLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    feedback: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    metadata: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}",
}));
export const PatchLogResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const patchLog = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchLogRequest,
    output: PatchLogResponse,
    errors: [],
}));
export const DeleteLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    filters: Schema.optional(Schema.Array(Schema.Struct({
        key: Schema.Literals([
            "id",
            "created_at",
            "request_content_type",
            "response_content_type",
            "request_type",
            "success",
            "cached",
            "provider",
            "model",
            "model_type",
            "cost",
            "tokens",
            "tokens_in",
            "tokens_out",
            "duration",
            "feedback",
            "event_id",
            "metadata.key",
            "metadata.value",
            "prompts.prompt_id",
            "prompts.version_id",
            "authentication",
            "wholesale",
            "compatibilityMode",
            "dlp_action",
        ]),
        operator: Schema.Literals(["eq", "neq", "contains", "lt", "gt"]),
        value: Schema.Array(Schema.Union([
            Schema.String,
            Schema.Null,
            Schema.Number,
            Schema.Boolean,
        ])),
    }))).pipe(T.HttpQuery("filters")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    orderBy: Schema.optional(Schema.Literals([
        "created_at",
        "provider",
        "model",
        "model_type",
        "success",
        "cached",
        "cost",
        "tokens_in",
        "tokens_out",
        "duration",
        "feedback",
    ])).pipe(T.HttpQuery("order_by")),
    orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("order_by_direction")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs",
}));
export const DeleteLogResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    success: Schema.Boolean,
});
export const deleteLog = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteLogRequest,
    output: DeleteLogResponse,
    errors: [],
}));
export const RequestLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}/request",
}));
export const RequestLogResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const requestLog = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RequestLogRequest,
    output: RequestLogResponse,
    errors: [],
}));
export const ResponseLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    id: Schema.String.pipe(T.HttpPath("id")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}/response",
}));
export const ResponseLogResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const responseLog = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ResponseLogRequest,
    output: ResponseLogResponse,
    errors: [],
}));
export const GetUrlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
    provider: Schema.String.pipe(T.HttpPath("provider")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/url/{provider}",
}));
export const GetUrlResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const getUrl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetUrlRequest,
    output: GetUrlResponse,
    errors: [],
}));
//# sourceMappingURL=ai-gateway.js.map