/**
 * Cloudflare API-GATEWAY API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service api-gateway
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
import { UploadableSchema } from "../schemas.js";
// =============================================================================
// Errors
// =============================================================================
export class InvalidObjectIdentifier extends Schema.TaggedErrorClass()("InvalidObjectIdentifier", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidObjectIdentifier, [{ code: 7003 }]);
export class NotEntitled extends Schema.TaggedErrorClass()("NotEntitled", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(NotEntitled, [{ code: 10403 }, { code: 10404 }]);
export class OperationNotFound extends Schema.TaggedErrorClass()("OperationNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(OperationNotFound, [{ code: 10404 }]);
export class SchemaNotFound extends Schema.TaggedErrorClass()("SchemaNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(SchemaNotFound, [{ code: 19400 }]);
export const GetConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    normalize: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("normalize")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/configuration",
}));
export const GetConfigurationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    authIdCharacteristics: Schema.Array(Schema.Union([
        Schema.Struct({
            name: Schema.String,
            type: Schema.Literals(["header", "cookie"]),
        }),
        Schema.Struct({
            name: Schema.String,
            type: Schema.Literal("jwt"),
        }),
    ])),
})
    .pipe(Schema.encodeKeys({ authIdCharacteristics: "auth_id_characteristics" }))
    .pipe(T.ResponsePath("result"));
export const getConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetConfigurationRequest,
    output: GetConfigurationResponse,
    errors: [InvalidObjectIdentifier, NotEntitled],
}));
export const PutConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    normalize: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("normalize")),
    authIdCharacteristics: Schema.Array(Schema.Union([
        Schema.Struct({
            name: Schema.String,
            type: Schema.Literals(["header", "cookie"]),
        }),
        Schema.Struct({
            name: Schema.String,
            type: Schema.Literal("jwt"),
        }),
    ])),
}).pipe(Schema.encodeKeys({ authIdCharacteristics: "auth_id_characteristics" }), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/api_gateway/configuration",
}));
export const PutConfigurationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    authIdCharacteristics: Schema.Array(Schema.Union([
        Schema.Struct({
            name: Schema.String,
            type: Schema.Literals(["header", "cookie"]),
        }),
        Schema.Struct({
            name: Schema.String,
            type: Schema.Literal("jwt"),
        }),
    ])),
})
    .pipe(Schema.encodeKeys({ authIdCharacteristics: "auth_id_characteristics" }))
    .pipe(T.ResponsePath("result"));
export const putConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutConfigurationRequest,
    output: PutConfigurationResponse,
    errors: [InvalidObjectIdentifier, NotEntitled],
}));
export const GetDiscoveryRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/api_gateway/discovery" }));
export const GetDiscoveryResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemas: Schema.Array(Schema.Unknown),
    timestamp: Schema.String,
}).pipe(T.ResponsePath("result"));
export const getDiscovery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDiscoveryRequest,
    output: GetDiscoveryResponse,
    errors: [InvalidObjectIdentifier, NotEntitled],
}));
export const ListDiscoveryOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    diff: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("diff")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    endpoint: Schema.optional(Schema.String).pipe(T.HttpQuery("endpoint")),
    host: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("host")),
    method: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("method")),
    order: Schema.optional(Schema.Literals([
        "host",
        "method",
        "endpoint",
        "traffic_stats.requests",
        "traffic_stats.last_updated",
    ])).pipe(T.HttpQuery("order")),
    origin: Schema.optional(Schema.Literals(["ML", "SessionIdentifier", "LabelDiscovery"])).pipe(T.HttpQuery("origin")),
    state: Schema.optional(Schema.Literals(["review", "saved", "ignored"])).pipe(T.HttpQuery("state")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/discovery/operations",
}));
export const ListDiscoveryOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        endpoint: Schema.String,
        host: Schema.String,
        lastUpdated: Schema.String,
        method: Schema.Literals([
            "GET",
            "POST",
            "HEAD",
            "OPTIONS",
            "PUT",
            "DELETE",
            "CONNECT",
            "PATCH",
            "TRACE",
        ]),
        origin: Schema.Array(Schema.Literals(["ML", "SessionIdentifier", "LabelDiscovery"])),
        state: Schema.Literals(["review", "saved", "ignored"]),
        features: Schema.optional(Schema.Union([
            Schema.Struct({
                trafficStats: Schema.optional(Schema.Union([
                    Schema.Struct({
                        lastUpdated: Schema.String,
                        periodSeconds: Schema.Number,
                        requests: Schema.Number,
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        periodSeconds: "period_seconds",
                        requests: "requests",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ trafficStats: "traffic_stats" })),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        endpoint: "endpoint",
        host: "host",
        lastUpdated: "last_updated",
        method: "method",
        origin: "origin",
        state: "state",
        features: "features",
    }))),
    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 listDiscoveryOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListDiscoveryOperationsRequest,
    output: ListDiscoveryOperationsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PatchDiscoveryOperationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    state: Schema.optional(Schema.Literals(["review", "ignored"])),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/api_gateway/discovery/operations/{operationId}",
}));
export const PatchDiscoveryOperationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    state: Schema.optional(Schema.Union([
        Schema.Literals(["review", "saved", "ignored"]),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const patchDiscoveryOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchDiscoveryOperationRequest,
    output: PatchDiscoveryOperationResponse,
    errors: [InvalidObjectIdentifier, NotEntitled],
}));
export const BulkPatchDiscoveryOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Record(Schema.String, Schema.Unknown).pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/api_gateway/discovery/operations",
}));
export const BulkPatchDiscoveryOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Record(Schema.String, Schema.Unknown).pipe(T.ResponsePath("result"));
export const bulkPatchDiscoveryOperations = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BulkPatchDiscoveryOperationsRequest,
    output: BulkPatchDiscoveryOperationsResponse,
    errors: [InvalidObjectIdentifier, NotEntitled],
}));
export const CreateExpressionTemplateFallthroughRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    hosts: Schema.Array(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/zones/{zone_id}/api_gateway/expression-template/fallthrough",
}));
export const CreateExpressionTemplateFallthroughResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    expression: Schema.String,
    title: Schema.String,
}).pipe(T.ResponsePath("result"));
export const createExpressionTemplateFallthrough = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateExpressionTemplateFallthroughRequest,
    output: CreateExpressionTemplateFallthroughResponse,
    errors: [InvalidObjectIdentifier],
}));
export const GetOperationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    feature: Schema.optional(Schema.Array(Schema.Literals(["thresholds", "parameter_schemas", "schema_info"]))).pipe(T.HttpQuery("feature")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/operations/{operationId}",
}));
export const GetOperationResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    endpoint: Schema.String,
    host: Schema.String,
    lastUpdated: Schema.String,
    method: Schema.Literals([
        "GET",
        "POST",
        "HEAD",
        "OPTIONS",
        "PUT",
        "DELETE",
        "CONNECT",
        "PATCH",
        "TRACE",
    ]),
    operationId: Schema.String,
    features: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                parameterSchemas: Schema.Struct({
                    lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    parameterSchemas: Schema.optional(Schema.Union([
                        Schema.Struct({
                            parameters: Schema.optional(Schema.Union([Schema.Array(Schema.Unknown), Schema.Null])),
                            responses: Schema.optional(Schema.Null),
                        }),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({
                    lastUpdated: "last_updated",
                    parameterSchemas: "parameter_schemas",
                })),
            }).pipe(Schema.encodeKeys({ parameterSchemas: "parameter_schemas" })),
            Schema.Struct({
                thresholds: Schema.optional(Schema.Union([
                    Schema.Struct({
                        authIdTokens: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        dataPoints: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        p50: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        p90: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        p99: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        periodSeconds: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        requests: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        suggestedThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    }).pipe(Schema.encodeKeys({
                        authIdTokens: "auth_id_tokens",
                        dataPoints: "data_points",
                        lastUpdated: "last_updated",
                        p50: "p50",
                        p90: "p90",
                        p99: "p99",
                        periodSeconds: "period_seconds",
                        requests: "requests",
                        suggestedThreshold: "suggested_threshold",
                    })),
                    Schema.Null,
                ])),
            }),
            Schema.Struct({
                apiRouting: Schema.optional(Schema.Union([
                    Schema.Struct({
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        route: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        route: "route",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ apiRouting: "api_routing" })),
            Schema.Struct({
                confidenceIntervals: Schema.optional(Schema.Union([
                    Schema.Struct({
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        suggestedThreshold: Schema.optional(Schema.Union([
                            Schema.Struct({
                                confidenceIntervals: Schema.optional(Schema.Union([
                                    Schema.Struct({
                                        p90: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                lower: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                                upper: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                            }),
                                            Schema.Null,
                                        ])),
                                        p95: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                lower: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                                upper: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                            }),
                                            Schema.Null,
                                        ])),
                                        p99: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                lower: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                                upper: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                            }),
                                            Schema.Null,
                                        ])),
                                    }),
                                    Schema.Null,
                                ])),
                                mean: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                confidenceIntervals: "confidence_intervals",
                                mean: "mean",
                            })),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        suggestedThreshold: "suggested_threshold",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ confidenceIntervals: "confidence_intervals" })),
            Schema.Struct({
                schemaInfo: Schema.optional(Schema.Union([
                    Schema.Struct({
                        activeSchema: Schema.optional(Schema.Union([
                            Schema.Struct({
                                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                isLearned: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                id: "id",
                                createdAt: "created_at",
                                isLearned: "is_learned",
                                name: "name",
                            })),
                            Schema.Null,
                        ])),
                        learnedAvailable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                        mitigationAction: Schema.optional(Schema.Union([
                            Schema.Literal("none"),
                            Schema.Literal("log"),
                            Schema.Literal("block"),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        activeSchema: "active_schema",
                        learnedAvailable: "learned_available",
                        mitigationAction: "mitigation_action",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ schemaInfo: "schema_info" })),
        ]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    endpoint: "endpoint",
    host: "host",
    lastUpdated: "last_updated",
    method: "method",
    operationId: "operation_id",
    features: "features",
}))
    .pipe(T.ResponsePath("result"));
export const getOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOperationRequest,
    output: GetOperationResponse,
    errors: [InvalidObjectIdentifier, OperationNotFound],
}));
export const ListOperationsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    endpoint: Schema.optional(Schema.String).pipe(T.HttpQuery("endpoint")),
    feature: Schema.optional(Schema.Array(Schema.Literals(["thresholds", "parameter_schemas", "schema_info"]))).pipe(T.HttpQuery("feature")),
    host: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("host")),
    method: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("method")),
    order: Schema.optional(Schema.Literals(["method", "host", "endpoint", "thresholds.$key"])).pipe(T.HttpQuery("order")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/api_gateway/operations" }));
export const ListOperationsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        endpoint: Schema.String,
        host: Schema.String,
        lastUpdated: Schema.String,
        method: Schema.Literals([
            "GET",
            "POST",
            "HEAD",
            "OPTIONS",
            "PUT",
            "DELETE",
            "CONNECT",
            "PATCH",
            "TRACE",
        ]),
        operationId: Schema.String,
        features: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    parameterSchemas: Schema.Struct({
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        parameterSchemas: Schema.optional(Schema.Union([
                            Schema.Struct({
                                parameters: Schema.optional(Schema.Union([
                                    Schema.Array(Schema.Unknown),
                                    Schema.Null,
                                ])),
                                responses: Schema.optional(Schema.Null),
                            }),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        parameterSchemas: "parameter_schemas",
                    })),
                }).pipe(Schema.encodeKeys({ parameterSchemas: "parameter_schemas" })),
                Schema.Struct({
                    thresholds: Schema.optional(Schema.Union([
                        Schema.Struct({
                            authIdTokens: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            dataPoints: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            p50: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            p90: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            p99: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            periodSeconds: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            requests: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            suggestedThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        }).pipe(Schema.encodeKeys({
                            authIdTokens: "auth_id_tokens",
                            dataPoints: "data_points",
                            lastUpdated: "last_updated",
                            p50: "p50",
                            p90: "p90",
                            p99: "p99",
                            periodSeconds: "period_seconds",
                            requests: "requests",
                            suggestedThreshold: "suggested_threshold",
                        })),
                        Schema.Null,
                    ])),
                }),
                Schema.Struct({
                    apiRouting: Schema.optional(Schema.Union([
                        Schema.Struct({
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            route: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        }).pipe(Schema.encodeKeys({
                            lastUpdated: "last_updated",
                            route: "route",
                        })),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({ apiRouting: "api_routing" })),
                Schema.Struct({
                    confidenceIntervals: Schema.optional(Schema.Union([
                        Schema.Struct({
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            suggestedThreshold: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    confidenceIntervals: Schema.optional(Schema.Union([
                                        Schema.Struct({
                                            p90: Schema.optional(Schema.Union([
                                                Schema.Struct({
                                                    lower: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                    upper: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                }),
                                                Schema.Null,
                                            ])),
                                            p95: Schema.optional(Schema.Union([
                                                Schema.Struct({
                                                    lower: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                    upper: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                }),
                                                Schema.Null,
                                            ])),
                                            p99: Schema.optional(Schema.Union([
                                                Schema.Struct({
                                                    lower: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                    upper: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                }),
                                                Schema.Null,
                                            ])),
                                        }),
                                        Schema.Null,
                                    ])),
                                    mean: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                }).pipe(Schema.encodeKeys({
                                    confidenceIntervals: "confidence_intervals",
                                    mean: "mean",
                                })),
                                Schema.Null,
                            ])),
                        }).pipe(Schema.encodeKeys({
                            lastUpdated: "last_updated",
                            suggestedThreshold: "suggested_threshold",
                        })),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({
                    confidenceIntervals: "confidence_intervals",
                })),
                Schema.Struct({
                    schemaInfo: Schema.optional(Schema.Union([
                        Schema.Struct({
                            activeSchema: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                    createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                    isLearned: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                                    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                }).pipe(Schema.encodeKeys({
                                    id: "id",
                                    createdAt: "created_at",
                                    isLearned: "is_learned",
                                    name: "name",
                                })),
                                Schema.Null,
                            ])),
                            learnedAvailable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                            mitigationAction: Schema.optional(Schema.Union([
                                Schema.Literal("none"),
                                Schema.Literal("log"),
                                Schema.Literal("block"),
                                Schema.Null,
                            ])),
                        }).pipe(Schema.encodeKeys({
                            activeSchema: "active_schema",
                            learnedAvailable: "learned_available",
                            mitigationAction: "mitigation_action",
                        })),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({ schemaInfo: "schema_info" })),
            ]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        endpoint: "endpoint",
        host: "host",
        lastUpdated: "last_updated",
        method: "method",
        operationId: "operation_id",
        features: "features",
    }))),
    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 listOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListOperationsRequest,
    output: ListOperationsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateOperationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    endpoint: Schema.String,
    host: Schema.String,
    method: Schema.Literals([
        "GET",
        "POST",
        "HEAD",
        "OPTIONS",
        "PUT",
        "DELETE",
        "CONNECT",
        "PATCH",
        "TRACE",
    ]),
}).pipe(T.Http({
    method: "POST",
    path: "/zones/{zone_id}/api_gateway/operations/item",
}));
export const CreateOperationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    endpoint: Schema.String,
    host: Schema.String,
    lastUpdated: Schema.String,
    method: Schema.Literals([
        "GET",
        "POST",
        "HEAD",
        "OPTIONS",
        "PUT",
        "DELETE",
        "CONNECT",
        "PATCH",
        "TRACE",
    ]),
    operationId: Schema.String,
    features: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                parameterSchemas: Schema.Struct({
                    lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    parameterSchemas: Schema.optional(Schema.Union([
                        Schema.Struct({
                            parameters: Schema.optional(Schema.Union([Schema.Array(Schema.Unknown), Schema.Null])),
                            responses: Schema.optional(Schema.Null),
                        }),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({
                    lastUpdated: "last_updated",
                    parameterSchemas: "parameter_schemas",
                })),
            }).pipe(Schema.encodeKeys({ parameterSchemas: "parameter_schemas" })),
            Schema.Struct({
                thresholds: Schema.optional(Schema.Union([
                    Schema.Struct({
                        authIdTokens: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        dataPoints: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        p50: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        p90: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        p99: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        periodSeconds: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        requests: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        suggestedThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    }).pipe(Schema.encodeKeys({
                        authIdTokens: "auth_id_tokens",
                        dataPoints: "data_points",
                        lastUpdated: "last_updated",
                        p50: "p50",
                        p90: "p90",
                        p99: "p99",
                        periodSeconds: "period_seconds",
                        requests: "requests",
                        suggestedThreshold: "suggested_threshold",
                    })),
                    Schema.Null,
                ])),
            }),
            Schema.Struct({
                apiRouting: Schema.optional(Schema.Union([
                    Schema.Struct({
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        route: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        route: "route",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ apiRouting: "api_routing" })),
            Schema.Struct({
                confidenceIntervals: Schema.optional(Schema.Union([
                    Schema.Struct({
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        suggestedThreshold: Schema.optional(Schema.Union([
                            Schema.Struct({
                                confidenceIntervals: Schema.optional(Schema.Union([
                                    Schema.Struct({
                                        p90: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                lower: Schema.optional(Schema.Union([
                                                    Schema.Number,
                                                    Schema.Null,
                                                ])),
                                                upper: Schema.optional(Schema.Union([
                                                    Schema.Number,
                                                    Schema.Null,
                                                ])),
                                            }),
                                            Schema.Null,
                                        ])),
                                        p95: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                lower: Schema.optional(Schema.Union([
                                                    Schema.Number,
                                                    Schema.Null,
                                                ])),
                                                upper: Schema.optional(Schema.Union([
                                                    Schema.Number,
                                                    Schema.Null,
                                                ])),
                                            }),
                                            Schema.Null,
                                        ])),
                                        p99: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                lower: Schema.optional(Schema.Union([
                                                    Schema.Number,
                                                    Schema.Null,
                                                ])),
                                                upper: Schema.optional(Schema.Union([
                                                    Schema.Number,
                                                    Schema.Null,
                                                ])),
                                            }),
                                            Schema.Null,
                                        ])),
                                    }),
                                    Schema.Null,
                                ])),
                                mean: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                confidenceIntervals: "confidence_intervals",
                                mean: "mean",
                            })),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        suggestedThreshold: "suggested_threshold",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ confidenceIntervals: "confidence_intervals" })),
            Schema.Struct({
                schemaInfo: Schema.optional(Schema.Union([
                    Schema.Struct({
                        activeSchema: Schema.optional(Schema.Union([
                            Schema.Struct({
                                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                isLearned: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                id: "id",
                                createdAt: "created_at",
                                isLearned: "is_learned",
                                name: "name",
                            })),
                            Schema.Null,
                        ])),
                        learnedAvailable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                        mitigationAction: Schema.optional(Schema.Union([
                            Schema.Literal("none"),
                            Schema.Literal("log"),
                            Schema.Literal("block"),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        activeSchema: "active_schema",
                        learnedAvailable: "learned_available",
                        mitigationAction: "mitigation_action",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ schemaInfo: "schema_info" })),
        ]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    endpoint: "endpoint",
    host: "host",
    lastUpdated: "last_updated",
    method: "method",
    operationId: "operation_id",
    features: "features",
}))
    .pipe(T.ResponsePath("result"));
export const createOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateOperationRequest,
    output: CreateOperationResponse,
    errors: [InvalidObjectIdentifier],
}));
export const DeleteOperationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/api_gateway/operations/{operationId}",
}));
export const DeleteOperationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    errors: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    messages: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    success: Schema.Literal(true),
});
export const deleteOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteOperationRequest,
    output: DeleteOperationResponse,
    errors: [InvalidObjectIdentifier, OperationNotFound],
}));
export const BulkCreateOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Array(Schema.Struct({
        endpoint: Schema.String,
        host: Schema.String,
        method: Schema.Literals([
            "GET",
            "POST",
            "HEAD",
            "OPTIONS",
            "PUT",
            "DELETE",
            "CONNECT",
            "PATCH",
            "TRACE",
        ]),
    })).pipe(T.HttpBody()),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/api_gateway/operations" }));
export const BulkCreateOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        endpoint: Schema.String,
        host: Schema.String,
        lastUpdated: Schema.String,
        method: Schema.Literals([
            "GET",
            "POST",
            "HEAD",
            "OPTIONS",
            "PUT",
            "DELETE",
            "CONNECT",
            "PATCH",
            "TRACE",
        ]),
        operationId: Schema.String,
        features: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    parameterSchemas: Schema.Struct({
                        lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        parameterSchemas: Schema.optional(Schema.Union([
                            Schema.Struct({
                                parameters: Schema.optional(Schema.Union([
                                    Schema.Array(Schema.Unknown),
                                    Schema.Null,
                                ])),
                                responses: Schema.optional(Schema.Null),
                            }),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        lastUpdated: "last_updated",
                        parameterSchemas: "parameter_schemas",
                    })),
                }).pipe(Schema.encodeKeys({ parameterSchemas: "parameter_schemas" })),
                Schema.Struct({
                    thresholds: Schema.optional(Schema.Union([
                        Schema.Struct({
                            authIdTokens: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            dataPoints: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            p50: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            p90: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            p99: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            periodSeconds: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            requests: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            suggestedThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        }).pipe(Schema.encodeKeys({
                            authIdTokens: "auth_id_tokens",
                            dataPoints: "data_points",
                            lastUpdated: "last_updated",
                            p50: "p50",
                            p90: "p90",
                            p99: "p99",
                            periodSeconds: "period_seconds",
                            requests: "requests",
                            suggestedThreshold: "suggested_threshold",
                        })),
                        Schema.Null,
                    ])),
                }),
                Schema.Struct({
                    apiRouting: Schema.optional(Schema.Union([
                        Schema.Struct({
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            route: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        }).pipe(Schema.encodeKeys({
                            lastUpdated: "last_updated",
                            route: "route",
                        })),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({ apiRouting: "api_routing" })),
                Schema.Struct({
                    confidenceIntervals: Schema.optional(Schema.Union([
                        Schema.Struct({
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            suggestedThreshold: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    confidenceIntervals: Schema.optional(Schema.Union([
                                        Schema.Struct({
                                            p90: Schema.optional(Schema.Union([
                                                Schema.Struct({
                                                    lower: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                    upper: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                }),
                                                Schema.Null,
                                            ])),
                                            p95: Schema.optional(Schema.Union([
                                                Schema.Struct({
                                                    lower: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                    upper: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                }),
                                                Schema.Null,
                                            ])),
                                            p99: Schema.optional(Schema.Union([
                                                Schema.Struct({
                                                    lower: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                    upper: Schema.optional(Schema.Union([
                                                        Schema.Number,
                                                        Schema.Null,
                                                    ])),
                                                }),
                                                Schema.Null,
                                            ])),
                                        }),
                                        Schema.Null,
                                    ])),
                                    mean: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                }).pipe(Schema.encodeKeys({
                                    confidenceIntervals: "confidence_intervals",
                                    mean: "mean",
                                })),
                                Schema.Null,
                            ])),
                        }).pipe(Schema.encodeKeys({
                            lastUpdated: "last_updated",
                            suggestedThreshold: "suggested_threshold",
                        })),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({
                    confidenceIntervals: "confidence_intervals",
                })),
                Schema.Struct({
                    schemaInfo: Schema.optional(Schema.Union([
                        Schema.Struct({
                            activeSchema: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                    createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                    isLearned: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                                    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                }).pipe(Schema.encodeKeys({
                                    id: "id",
                                    createdAt: "created_at",
                                    isLearned: "is_learned",
                                    name: "name",
                                })),
                                Schema.Null,
                            ])),
                            learnedAvailable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                            mitigationAction: Schema.optional(Schema.Union([
                                Schema.Literal("none"),
                                Schema.Literal("log"),
                                Schema.Literal("block"),
                                Schema.Null,
                            ])),
                        }).pipe(Schema.encodeKeys({
                            activeSchema: "active_schema",
                            learnedAvailable: "learned_available",
                            mitigationAction: "mitigation_action",
                        })),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({ schemaInfo: "schema_info" })),
            ]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        endpoint: "endpoint",
        host: "host",
        lastUpdated: "last_updated",
        method: "method",
        operationId: "operation_id",
        features: "features",
    }))),
});
export const bulkCreateOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkCreateOperationsRequest,
    output: BulkCreateOperationsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const BulkDeleteOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/api_gateway/operations",
}));
export const BulkDeleteOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    errors: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    messages: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    success: Schema.Literal(true),
});
export const bulkDeleteOperations = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BulkDeleteOperationsRequest,
    output: BulkDeleteOperationsResponse,
    errors: [InvalidObjectIdentifier],
}));
export const GetOperationSchemaValidationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/operations/{operationId}/schema_validation",
}));
export const GetOperationSchemaValidationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mitigationAction: Schema.optional(Schema.Union([
        Schema.Literal("log"),
        Schema.Literal("block"),
        Schema.Literal("none"),
        Schema.Null,
    ])),
    operationId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    mitigationAction: "mitigation_action",
    operationId: "operation_id",
}));
export const getOperationSchemaValidation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOperationSchemaValidationRequest,
    output: GetOperationSchemaValidationResponse,
    errors: [InvalidObjectIdentifier, OperationNotFound],
}));
export const PutOperationSchemaValidationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    mitigationAction: Schema.optional(Schema.Union([
        Schema.Literal("log"),
        Schema.Literal("block"),
        Schema.Literal("none"),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ mitigationAction: "mitigation_action" }), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/api_gateway/operations/{operationId}/schema_validation",
}));
export const PutOperationSchemaValidationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mitigationAction: Schema.optional(Schema.Union([
        Schema.Literal("log"),
        Schema.Literal("block"),
        Schema.Literal("none"),
        Schema.Null,
    ])),
    operationId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    mitigationAction: "mitigation_action",
    operationId: "operation_id",
}));
export const putOperationSchemaValidation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutOperationSchemaValidationRequest,
    output: PutOperationSchemaValidationResponse,
    errors: [InvalidObjectIdentifier, OperationNotFound],
}));
export const PatchOperationSchemaValidationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    settingsMultipleRequest: Schema.Record(Schema.String, Schema.Unknown),
}).pipe(Schema.encodeKeys({ settingsMultipleRequest: "settings_multiple_request" }), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/api_gateway/operations/schema_validation",
}));
export const PatchOperationSchemaValidationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Record(Schema.String, Schema.Unknown).pipe(T.ResponsePath("result"));
export const patchOperationSchemaValidation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchOperationSchemaValidationRequest,
    output: PatchOperationSchemaValidationResponse,
    errors: [InvalidObjectIdentifier],
}));
export const ListSchemasRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    feature: Schema.optional(Schema.Array(Schema.Literals(["thresholds", "parameter_schemas", "schema_info"]))).pipe(T.HttpQuery("feature")),
    host: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("host")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/api_gateway/schemas" }));
export const ListSchemasResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemas: Schema.optional(Schema.Union([Schema.Array(Schema.Unknown), Schema.Null])),
    timestamp: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const listSchemas = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListSchemasRequest,
    output: ListSchemasResponse,
    errors: [InvalidObjectIdentifier],
}));
export const GetSettingSchemaValidationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/settings/schema_validation",
}));
export const GetSettingSchemaValidationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    validationDefaultMitigationAction: Schema.optional(Schema.Union([Schema.Literals(["none", "log", "block"]), Schema.Null])),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}));
export const getSettingSchemaValidation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingSchemaValidationRequest,
    output: GetSettingSchemaValidationResponse,
    errors: [InvalidObjectIdentifier],
}));
export const PutSettingSchemaValidationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    validationDefaultMitigationAction: Schema.Literals([
        "none",
        "log",
        "block",
    ]),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("disable_override"),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/api_gateway/settings/schema_validation",
}));
export const PutSettingSchemaValidationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    validationDefaultMitigationAction: Schema.optional(Schema.Union([Schema.Literals(["none", "log", "block"]), Schema.Null])),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}));
export const putSettingSchemaValidation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutSettingSchemaValidationRequest,
    output: PutSettingSchemaValidationResponse,
    errors: [InvalidObjectIdentifier],
}));
export const PatchSettingSchemaValidationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    validationDefaultMitigationAction: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("log"),
        Schema.Literal("block"),
        Schema.Null,
    ])),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("disable_override"),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/api_gateway/settings/schema_validation",
}));
export const PatchSettingSchemaValidationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    validationDefaultMitigationAction: Schema.optional(Schema.Union([Schema.Literals(["none", "log", "block"]), Schema.Null])),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}));
export const patchSettingSchemaValidation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingSchemaValidationRequest,
    output: PatchSettingSchemaValidationResponse,
    errors: [InvalidObjectIdentifier],
}));
export const GetUserSchemaRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    omitSource: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("omit_source")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/user_schemas/{schemaId}",
}));
export const GetUserSchemaResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    createdAt: Schema.String,
    kind: Schema.Literal("openapi_v3"),
    name: Schema.String,
    schemaId: Schema.String,
    source: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    createdAt: "created_at",
    kind: "kind",
    name: "name",
    schemaId: "schema_id",
    source: "source",
    validationEnabled: "validation_enabled",
}))
    .pipe(T.ResponsePath("result"));
export const getUserSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetUserSchemaRequest,
    output: GetUserSchemaResponse,
    errors: [InvalidObjectIdentifier, SchemaNotFound],
}));
export const ListUserSchemasRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    omitSource: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("omit_source")),
    validationEnabled: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("validation_enabled")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/api_gateway/user_schemas" }));
export const ListUserSchemasResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        createdAt: Schema.String,
        kind: Schema.Literal("openapi_v3"),
        name: Schema.String,
        schemaId: Schema.String,
        source: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        createdAt: "created_at",
        kind: "kind",
        name: "name",
        schemaId: "schema_id",
        source: "source",
        validationEnabled: "validation_enabled",
    }))),
    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 listUserSchemas = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListUserSchemasRequest,
    output: ListUserSchemasResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateUserSchemaRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    file: UploadableSchema.pipe(T.HttpFormDataFile()),
    kind: Schema.Literal("openapi_v3"),
    name: Schema.optional(Schema.String),
    validationEnabled: Schema.optional(Schema.Literals([true, false])),
}).pipe(Schema.encodeKeys({
    file: "file",
    kind: "kind",
    name: "name",
    validationEnabled: "validation_enabled",
}), T.Http({
    method: "POST",
    path: "/zones/{zone_id}/api_gateway/user_schemas",
    contentType: "multipart",
}));
export const CreateUserSchemaResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schema: Schema.Struct({
        createdAt: Schema.String,
        kind: Schema.Literal("openapi_v3"),
        name: Schema.String,
        schemaId: Schema.String,
        source: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        createdAt: "created_at",
        kind: "kind",
        name: "name",
        schemaId: "schema_id",
        source: "source",
        validationEnabled: "validation_enabled",
    })),
    uploadDetails: Schema.optional(Schema.Union([
        Schema.Struct({
            warnings: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    code: Schema.Number,
                    locations: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    message: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                })),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({ schema: "schema", uploadDetails: "upload_details" }))
    .pipe(T.ResponsePath("result"));
export const createUserSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateUserSchemaRequest,
    output: CreateUserSchemaResponse,
    errors: [InvalidObjectIdentifier],
}));
export const PatchUserSchemaRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    validationEnabled: Schema.optional(Schema.Literal(true)),
}).pipe(Schema.encodeKeys({ validationEnabled: "validation_enabled" }), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/api_gateway/user_schemas/{schemaId}",
}));
export const PatchUserSchemaResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    createdAt: Schema.String,
    kind: Schema.Literal("openapi_v3"),
    name: Schema.String,
    schemaId: Schema.String,
    source: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    createdAt: "created_at",
    kind: "kind",
    name: "name",
    schemaId: "schema_id",
    source: "source",
    validationEnabled: "validation_enabled",
}))
    .pipe(T.ResponsePath("result"));
export const patchUserSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchUserSchemaRequest,
    output: PatchUserSchemaResponse,
    errors: [InvalidObjectIdentifier, SchemaNotFound],
}));
export const DeleteUserSchemaRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/api_gateway/user_schemas/{schemaId}",
}));
export const DeleteUserSchemaResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    errors: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    messages: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    success: Schema.Literal(true),
});
export const deleteUserSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteUserSchemaRequest,
    output: DeleteUserSchemaResponse,
    errors: [InvalidObjectIdentifier, SchemaNotFound],
}));
export const ListUserSchemaHostsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/user_schemas/hosts",
}));
export const ListUserSchemaHostsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        createdAt: Schema.String,
        hosts: Schema.Array(Schema.String),
        name: Schema.String,
        schemaId: Schema.String,
    }).pipe(Schema.encodeKeys({
        createdAt: "created_at",
        hosts: "hosts",
        name: "name",
        schemaId: "schema_id",
    }))),
    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 listUserSchemaHosts = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListUserSchemaHostsRequest,
    output: ListUserSchemaHostsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const ListUserSchemaOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    endpoint: Schema.optional(Schema.String).pipe(T.HttpQuery("endpoint")),
    feature: Schema.optional(Schema.Array(Schema.Literals(["thresholds", "parameter_schemas", "schema_info"]))).pipe(T.HttpQuery("feature")),
    host: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("host")),
    method: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("method")),
    operationStatus: Schema.optional(Schema.Literals(["new", "existing"])).pipe(T.HttpQuery("operation_status")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/api_gateway/user_schemas/{schemaId}/operations",
}));
export const ListUserSchemaOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Union([
        Schema.Struct({
            endpoint: Schema.String,
            host: Schema.String,
            lastUpdated: Schema.String,
            method: Schema.Literals([
                "GET",
                "POST",
                "HEAD",
                "OPTIONS",
                "PUT",
                "DELETE",
                "CONNECT",
                "PATCH",
                "TRACE",
            ]),
            operationId: Schema.String,
            features: Schema.optional(Schema.Union([
                Schema.Union([
                    Schema.Struct({
                        parameterSchemas: Schema.Struct({
                            lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            parameterSchemas: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    parameters: Schema.optional(Schema.Union([
                                        Schema.Array(Schema.Unknown),
                                        Schema.Null,
                                    ])),
                                    responses: Schema.optional(Schema.Null),
                                }),
                                Schema.Null,
                            ])),
                        }).pipe(Schema.encodeKeys({
                            lastUpdated: "last_updated",
                            parameterSchemas: "parameter_schemas",
                        })),
                    }).pipe(Schema.encodeKeys({ parameterSchemas: "parameter_schemas" })),
                    Schema.Struct({
                        thresholds: Schema.optional(Schema.Union([
                            Schema.Struct({
                                authIdTokens: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                dataPoints: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                p50: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                p90: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                p99: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                periodSeconds: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                requests: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                suggestedThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                authIdTokens: "auth_id_tokens",
                                dataPoints: "data_points",
                                lastUpdated: "last_updated",
                                p50: "p50",
                                p90: "p90",
                                p99: "p99",
                                periodSeconds: "period_seconds",
                                requests: "requests",
                                suggestedThreshold: "suggested_threshold",
                            })),
                            Schema.Null,
                        ])),
                    }),
                    Schema.Struct({
                        apiRouting: Schema.optional(Schema.Union([
                            Schema.Struct({
                                lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                route: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                lastUpdated: "last_updated",
                                route: "route",
                            })),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({ apiRouting: "api_routing" })),
                    Schema.Struct({
                        confidenceIntervals: Schema.optional(Schema.Union([
                            Schema.Struct({
                                lastUpdated: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                suggestedThreshold: Schema.optional(Schema.Union([
                                    Schema.Struct({
                                        confidenceIntervals: Schema.optional(Schema.Union([
                                            Schema.Struct({
                                                p90: Schema.optional(Schema.Union([
                                                    Schema.Struct({
                                                        lower: Schema.optional(Schema.Union([
                                                            Schema.Number,
                                                            Schema.Null,
                                                        ])),
                                                        upper: Schema.optional(Schema.Union([
                                                            Schema.Number,
                                                            Schema.Null,
                                                        ])),
                                                    }),
                                                    Schema.Null,
                                                ])),
                                                p95: Schema.optional(Schema.Union([
                                                    Schema.Struct({
                                                        lower: Schema.optional(Schema.Union([
                                                            Schema.Number,
                                                            Schema.Null,
                                                        ])),
                                                        upper: Schema.optional(Schema.Union([
                                                            Schema.Number,
                                                            Schema.Null,
                                                        ])),
                                                    }),
                                                    Schema.Null,
                                                ])),
                                                p99: Schema.optional(Schema.Union([
                                                    Schema.Struct({
                                                        lower: Schema.optional(Schema.Union([
                                                            Schema.Number,
                                                            Schema.Null,
                                                        ])),
                                                        upper: Schema.optional(Schema.Union([
                                                            Schema.Number,
                                                            Schema.Null,
                                                        ])),
                                                    }),
                                                    Schema.Null,
                                                ])),
                                            }),
                                            Schema.Null,
                                        ])),
                                        mean: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                                    }).pipe(Schema.encodeKeys({
                                        confidenceIntervals: "confidence_intervals",
                                        mean: "mean",
                                    })),
                                    Schema.Null,
                                ])),
                            }).pipe(Schema.encodeKeys({
                                lastUpdated: "last_updated",
                                suggestedThreshold: "suggested_threshold",
                            })),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        confidenceIntervals: "confidence_intervals",
                    })),
                    Schema.Struct({
                        schemaInfo: Schema.optional(Schema.Union([
                            Schema.Struct({
                                activeSchema: Schema.optional(Schema.Union([
                                    Schema.Struct({
                                        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                        createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                        isLearned: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                                        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                    }).pipe(Schema.encodeKeys({
                                        id: "id",
                                        createdAt: "created_at",
                                        isLearned: "is_learned",
                                        name: "name",
                                    })),
                                    Schema.Null,
                                ])),
                                learnedAvailable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                                mitigationAction: Schema.optional(Schema.Union([
                                    Schema.Literal("none"),
                                    Schema.Literal("log"),
                                    Schema.Literal("block"),
                                    Schema.Null,
                                ])),
                            }).pipe(Schema.encodeKeys({
                                activeSchema: "active_schema",
                                learnedAvailable: "learned_available",
                                mitigationAction: "mitigation_action",
                            })),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({ schemaInfo: "schema_info" })),
                ]),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            endpoint: "endpoint",
            host: "host",
            lastUpdated: "last_updated",
            method: "method",
            operationId: "operation_id",
            features: "features",
        })),
        Schema.Struct({
            endpoint: Schema.String,
            host: Schema.String,
            method: Schema.Literals([
                "GET",
                "POST",
                "HEAD",
                "OPTIONS",
                "PUT",
                "DELETE",
                "CONNECT",
                "PATCH",
                "TRACE",
            ]),
        }),
    ])),
    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 listUserSchemaOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListUserSchemaOperationsRequest,
    output: ListUserSchemaOperationsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
//# sourceMappingURL=api-gateway.js.map