/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type = {
    Internal: "internal",
};
export const GetDrainsDeliveryDrainsTarget = {
    VercelOtelTracesDb: "vercel-otel-traces-db",
};
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType = {
    Clickhouse: "clickhouse",
};
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType = {
    Otlphttp: "otlphttp",
};
export const GetDrainsDeliveryDrainsResponse200Encoding = {
    Json: "json",
    Proto: "proto",
};
export const GetDrainsSecretDrainsResponse200Kind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONType = {
    Http: "http",
};
export const GetDrainsDeliveryDrainsResponseEncoding = {
    Json: "json",
    Ndjson: "ndjson",
};
export const GetDrainsDeliveryDrainsCompression = {
    Gzip: "gzip",
    None: "none",
};
export const GetDrainsSecretDrainsResponseKind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainsDrainsType = {
    HeadSampling: "head_sampling",
};
export const GetDrainsDrainsEnv = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainsDrainsStatus = {
    Enabled: "enabled",
    Disabled: "disabled",
    Errored: "errored",
};
export const GetDrainsDrainsDisabledReason = {
    DisabledByOwner: "disabled-by-owner",
    FeatureNotAvailable: "feature-not-available",
    AccountPlanDowngrade: "account-plan-downgrade",
    DisabledByAdmin: "disabled-by-admin",
};
export const GetDrainsSourceDrainsResponse200Kind = {
    Integration: "integration",
};
export const GetDrainsSourceDrainsResponseKind = {
    SelfServed: "self-served",
};
export const GetDrainsFilterV2DrainsResponse200Version = {
    V2: "v2",
};
export const GetDrainsFilterDrainsResponse200Type = {
    Odata: "odata",
};
export const GetDrainsFilterDrainsResponseType = {
    Basic: "basic",
};
export const GetDrainsFilterDrainsSources = {
    Build: "build",
    Edge: "edge",
    Lambda: "lambda",
    Static: "static",
    External: "external",
    Firewall: "firewall",
    Redirect: "redirect",
};
export const GetDrainsFilterDrainsEnvironments = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainsFilterV2DrainsResponseVersion = {
    V1: "v1",
};
export const GetDrainsProjectAccessDrainsAccess = {
    Some: "some",
};
export const GetDrainsProjectAccessAccess = {
    All: "all",
};
export const GetDrainsDeliveryDrainsResponse200Type = {
    Internal: "internal",
};
export const GetDrainsDeliveryTarget = {
    VercelOtelTracesDb: "vercel-otel-traces-db",
};
export const GetDrainsDeliveryDrainsResponseType = {
    Clickhouse: "clickhouse",
};
export const GetDrainsDeliveryDrainsType = {
    Otlphttp: "otlphttp",
};
export const GetDrainsDeliveryDrainsEncoding = {
    Json: "json",
    Proto: "proto",
};
export const GetDrainsSecretDrainsKind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainsDeliveryType = {
    Http: "http",
};
export const GetDrainsDeliveryEncoding = {
    Json: "json",
    Ndjson: "ndjson",
};
export const GetDrainsDeliveryCompression = {
    Gzip: "gzip",
    None: "none",
};
export const GetDrainsSecretKind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const DrainsType = {
    HeadSampling: "head_sampling",
};
export const DrainsEnv = {
    Production: "production",
    Preview: "preview",
};
export const DrainsStatus = {
    Enabled: "enabled",
    Disabled: "disabled",
    Errored: "errored",
};
export const DrainsDisabledReason = {
    DisabledByOwner: "disabled-by-owner",
    FeatureNotAvailable: "feature-not-available",
    AccountPlanDowngrade: "account-plan-downgrade",
    DisabledByAdmin: "disabled-by-admin",
};
export const GetDrainsSourceDrainsKind = {
    Integration: "integration",
};
export const GetDrainsSourceKind = {
    SelfServed: "self-served",
};
export const GetDrainsFilterV2DrainsVersion = {
    V2: "v2",
};
export const GetDrainsFilterDrainsType = {
    Odata: "odata",
};
export const GetDrainsFilterType = {
    Basic: "basic",
};
export const GetDrainsFilterSources = {
    Build: "build",
    Edge: "edge",
    Lambda: "lambda",
    Static: "static",
    External: "external",
    Firewall: "firewall",
    Redirect: "redirect",
};
export const GetDrainsFilterEnvironments = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainsFilterV2Version = {
    V1: "v1",
};
/** @internal */
export const GetDrainsRequest$inboundSchema = z.object({
    projectId: z.string().optional(),
    includeMetadata: z.boolean().default(false),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
/** @internal */
export const GetDrainsRequest$outboundSchema = z.object({
    projectId: z.string().optional(),
    includeMetadata: z.boolean().default(false),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
export function getDrainsRequestToJSON(getDrainsRequest) {
    return JSON.stringify(GetDrainsRequest$outboundSchema.parse(getDrainsRequest));
}
export function getDrainsRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsRequest' from JSON`);
}
/** @internal */
export const GetDrainsDrainsLog$inboundSchema = z.object({});
/** @internal */
export const GetDrainsDrainsLog$outboundSchema = z.object({});
export function getDrainsDrainsLogToJSON(getDrainsDrainsLog) {
    return JSON.stringify(GetDrainsDrainsLog$outboundSchema.parse(getDrainsDrainsLog));
}
export function getDrainsDrainsLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsLog' from JSON`);
}
/** @internal */
export const GetDrainsDrainsTrace$inboundSchema = z.object({});
/** @internal */
export const GetDrainsDrainsTrace$outboundSchema = z.object({});
export function getDrainsDrainsTraceToJSON(getDrainsDrainsTrace) {
    return JSON.stringify(GetDrainsDrainsTrace$outboundSchema.parse(getDrainsDrainsTrace));
}
export function getDrainsDrainsTraceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsTrace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsTrace' from JSON`);
}
/** @internal */
export const GetDrainsDrainsAnalytics$inboundSchema = z.object({});
/** @internal */
export const GetDrainsDrainsAnalytics$outboundSchema = z.object({});
export function getDrainsDrainsAnalyticsToJSON(getDrainsDrainsAnalytics) {
    return JSON.stringify(GetDrainsDrainsAnalytics$outboundSchema.parse(getDrainsDrainsAnalytics));
}
export function getDrainsDrainsAnalyticsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsAnalytics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsAnalytics' from JSON`);
}
/** @internal */
export const GetDrainsDrainsSpeedInsights$inboundSchema = z.object({});
/** @internal */
export const GetDrainsDrainsSpeedInsights$outboundSchema = z.object({});
export function getDrainsDrainsSpeedInsightsToJSON(getDrainsDrainsSpeedInsights) {
    return JSON.stringify(GetDrainsDrainsSpeedInsights$outboundSchema.parse(getDrainsDrainsSpeedInsights));
}
export function getDrainsDrainsSpeedInsightsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsSpeedInsights$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsSpeedInsights' from JSON`);
}
/** @internal */
export const GetDrainsDrainsSchemas$inboundSchema = z.object({
    log: z.lazy(() => GetDrainsDrainsLog$inboundSchema).optional(),
    trace: z.lazy(() => GetDrainsDrainsTrace$inboundSchema).optional(),
    analytics: z.lazy(() => GetDrainsDrainsAnalytics$inboundSchema).optional(),
    speed_insights: z.lazy(() => GetDrainsDrainsSpeedInsights$inboundSchema)
        .optional(),
}).transform((v) => {
    return remap$(v, {
        "speed_insights": "speedInsights",
    });
});
/** @internal */
export const GetDrainsDrainsSchemas$outboundSchema = z.object({
    log: z.lazy(() => GetDrainsDrainsLog$outboundSchema).optional(),
    trace: z.lazy(() => GetDrainsDrainsTrace$outboundSchema).optional(),
    analytics: z.lazy(() => GetDrainsDrainsAnalytics$outboundSchema).optional(),
    speedInsights: z.lazy(() => GetDrainsDrainsSpeedInsights$outboundSchema)
        .optional(),
}).transform((v) => {
    return remap$(v, {
        speedInsights: "speed_insights",
    });
});
export function getDrainsDrainsSchemasToJSON(getDrainsDrainsSchemas) {
    return JSON.stringify(GetDrainsDrainsSchemas$outboundSchema.parse(getDrainsDrainsSchemas));
}
export function getDrainsDrainsSchemasFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsSchemas' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type$outboundSchema = GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type$inboundSchema;
/** @internal */
export const GetDrainsDeliveryDrainsTarget$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsTarget);
/** @internal */
export const GetDrainsDeliveryDrainsTarget$outboundSchema = GetDrainsDeliveryDrainsTarget$inboundSchema;
/** @internal */
export const GetDrainsDeliveryDrains4$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type$inboundSchema,
    target: GetDrainsDeliveryDrainsTarget$inboundSchema,
});
/** @internal */
export const GetDrainsDeliveryDrains4$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrains2Type$outboundSchema,
    target: GetDrainsDeliveryDrainsTarget$outboundSchema,
});
export function getDrainsDeliveryDrains4ToJSON(getDrainsDeliveryDrains4) {
    return JSON.stringify(GetDrainsDeliveryDrains4$outboundSchema.parse(getDrainsDeliveryDrains4));
}
export function getDrainsDeliveryDrains4FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrains4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrains4' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType$outboundSchema = GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType$inboundSchema;
/** @internal */
export const GetDrainsDeliveryDrains3$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType$inboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
/** @internal */
export const GetDrainsDeliveryDrains3$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyDrainsType$outboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
export function getDrainsDeliveryDrains3ToJSON(getDrainsDeliveryDrains3) {
    return JSON.stringify(GetDrainsDeliveryDrains3$outboundSchema.parse(getDrainsDeliveryDrains3));
}
export function getDrainsDeliveryDrains3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrains3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrains3' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType$outboundSchema = GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType$inboundSchema;
/** @internal */
export const GetDrainsDeliveryDrainsEndpoint$inboundSchema = z.object({
    traces: z.string(),
});
/** @internal */
export const GetDrainsDeliveryDrainsEndpoint$outboundSchema = z.object({
    traces: z.string(),
});
export function getDrainsDeliveryDrainsEndpointToJSON(getDrainsDeliveryDrainsEndpoint) {
    return JSON.stringify(GetDrainsDeliveryDrainsEndpoint$outboundSchema.parse(getDrainsDeliveryDrainsEndpoint));
}
export function getDrainsDeliveryDrainsEndpointFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrainsEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrainsEndpoint' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200Encoding$inboundSchema = z
    .nativeEnum(GetDrainsDeliveryDrainsResponse200Encoding);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200Encoding$outboundSchema = GetDrainsDeliveryDrainsResponse200Encoding$inboundSchema;
/** @internal */
export const GetDrainsSecretDrainsResponse200Kind$inboundSchema = z.nativeEnum(GetDrainsSecretDrainsResponse200Kind);
/** @internal */
export const GetDrainsSecretDrainsResponse200Kind$outboundSchema = GetDrainsSecretDrainsResponse200Kind$inboundSchema;
/** @internal */
export const GetDrainsSecretDrainsResponse2002$inboundSchema = z.object({
    kind: GetDrainsSecretDrainsResponse200Kind$inboundSchema,
});
/** @internal */
export const GetDrainsSecretDrainsResponse2002$outboundSchema = z.object({
    kind: GetDrainsSecretDrainsResponse200Kind$outboundSchema,
});
export function getDrainsSecretDrainsResponse2002ToJSON(getDrainsSecretDrainsResponse2002) {
    return JSON.stringify(GetDrainsSecretDrainsResponse2002$outboundSchema.parse(getDrainsSecretDrainsResponse2002));
}
export function getDrainsSecretDrainsResponse2002FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSecretDrainsResponse2002$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSecretDrainsResponse2002' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200Secret$inboundSchema = z.union([
    z.lazy(() => GetDrainsSecretDrainsResponse2002$inboundSchema),
    z.string(),
]);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200Secret$outboundSchema = z.union([
    z.lazy(() => GetDrainsSecretDrainsResponse2002$outboundSchema),
    z.string(),
]);
export function getDrainsDeliveryDrainsResponse200SecretToJSON(getDrainsDeliveryDrainsResponse200Secret) {
    return JSON.stringify(GetDrainsDeliveryDrainsResponse200Secret$outboundSchema.parse(getDrainsDeliveryDrainsResponse200Secret));
}
export function getDrainsDeliveryDrainsResponse200SecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrainsResponse200Secret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrainsResponse200Secret' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrains2$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType$inboundSchema,
    endpoint: z.lazy(() => GetDrainsDeliveryDrainsEndpoint$inboundSchema),
    encoding: GetDrainsDeliveryDrainsResponse200Encoding$inboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainsSecretDrainsResponse2002$inboundSchema),
        z.string(),
    ]).optional(),
});
/** @internal */
export const GetDrainsDeliveryDrains2$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONResponseBodyType$outboundSchema,
    endpoint: z.lazy(() => GetDrainsDeliveryDrainsEndpoint$outboundSchema),
    encoding: GetDrainsDeliveryDrainsResponse200Encoding$outboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainsSecretDrainsResponse2002$outboundSchema),
        z.string(),
    ]).optional(),
});
export function getDrainsDeliveryDrains2ToJSON(getDrainsDeliveryDrains2) {
    return JSON.stringify(GetDrainsDeliveryDrains2$outboundSchema.parse(getDrainsDeliveryDrains2));
}
export function getDrainsDeliveryDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrains2' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONType$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsResponse200ApplicationJSONType);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200ApplicationJSONType$outboundSchema = GetDrainsDeliveryDrainsResponse200ApplicationJSONType$inboundSchema;
/** @internal */
export const GetDrainsDeliveryDrainsResponseEncoding$inboundSchema = z
    .nativeEnum(GetDrainsDeliveryDrainsResponseEncoding);
/** @internal */
export const GetDrainsDeliveryDrainsResponseEncoding$outboundSchema = GetDrainsDeliveryDrainsResponseEncoding$inboundSchema;
/** @internal */
export const GetDrainsDeliveryDrainsCompression$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsCompression);
/** @internal */
export const GetDrainsDeliveryDrainsCompression$outboundSchema = GetDrainsDeliveryDrainsCompression$inboundSchema;
/** @internal */
export const GetDrainsSecretDrainsResponseKind$inboundSchema = z.nativeEnum(GetDrainsSecretDrainsResponseKind);
/** @internal */
export const GetDrainsSecretDrainsResponseKind$outboundSchema = GetDrainsSecretDrainsResponseKind$inboundSchema;
/** @internal */
export const GetDrainsSecretDrainsResponse2$inboundSchema = z.object({
    kind: GetDrainsSecretDrainsResponseKind$inboundSchema,
});
/** @internal */
export const GetDrainsSecretDrainsResponse2$outboundSchema = z.object({
    kind: GetDrainsSecretDrainsResponseKind$outboundSchema,
});
export function getDrainsSecretDrainsResponse2ToJSON(getDrainsSecretDrainsResponse2) {
    return JSON.stringify(GetDrainsSecretDrainsResponse2$outboundSchema.parse(getDrainsSecretDrainsResponse2));
}
export function getDrainsSecretDrainsResponse2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSecretDrainsResponse2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSecretDrainsResponse2' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponseSecret$inboundSchema = z.union([
    z.lazy(() => GetDrainsSecretDrainsResponse2$inboundSchema),
    z.string(),
]);
/** @internal */
export const GetDrainsDeliveryDrainsResponseSecret$outboundSchema = z.union([
    z.lazy(() => GetDrainsSecretDrainsResponse2$outboundSchema),
    z.string(),
]);
export function getDrainsDeliveryDrainsResponseSecretToJSON(getDrainsDeliveryDrainsResponseSecret) {
    return JSON.stringify(GetDrainsDeliveryDrainsResponseSecret$outboundSchema.parse(getDrainsDeliveryDrainsResponseSecret));
}
export function getDrainsDeliveryDrainsResponseSecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrainsResponseSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrainsResponseSecret' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrains1$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONType$inboundSchema,
    endpoint: z.string(),
    encoding: GetDrainsDeliveryDrainsResponseEncoding$inboundSchema,
    compression: GetDrainsDeliveryDrainsCompression$inboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainsSecretDrainsResponse2$inboundSchema),
        z.string(),
    ]).optional(),
});
/** @internal */
export const GetDrainsDeliveryDrains1$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200ApplicationJSONType$outboundSchema,
    endpoint: z.string(),
    encoding: GetDrainsDeliveryDrainsResponseEncoding$outboundSchema,
    compression: GetDrainsDeliveryDrainsCompression$outboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainsSecretDrainsResponse2$outboundSchema),
        z.string(),
    ]).optional(),
});
export function getDrainsDeliveryDrains1ToJSON(getDrainsDeliveryDrains1) {
    return JSON.stringify(GetDrainsDeliveryDrains1$outboundSchema.parse(getDrainsDeliveryDrains1));
}
export function getDrainsDeliveryDrains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrains1' from JSON`);
}
/** @internal */
export const GetDrainsDrainsDelivery$inboundSchema = z.union([
    z.lazy(() => GetDrainsDeliveryDrains1$inboundSchema),
    z.lazy(() => GetDrainsDeliveryDrains2$inboundSchema),
    z.lazy(() => GetDrainsDeliveryDrains3$inboundSchema),
    z.lazy(() => GetDrainsDeliveryDrains4$inboundSchema),
]);
/** @internal */
export const GetDrainsDrainsDelivery$outboundSchema = z.union([
    z.lazy(() => GetDrainsDeliveryDrains1$outboundSchema),
    z.lazy(() => GetDrainsDeliveryDrains2$outboundSchema),
    z.lazy(() => GetDrainsDeliveryDrains3$outboundSchema),
    z.lazy(() => GetDrainsDeliveryDrains4$outboundSchema),
]);
export function getDrainsDrainsDeliveryToJSON(getDrainsDrainsDelivery) {
    return JSON.stringify(GetDrainsDrainsDelivery$outboundSchema.parse(getDrainsDrainsDelivery));
}
export function getDrainsDrainsDeliveryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsDelivery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsDelivery' from JSON`);
}
/** @internal */
export const GetDrainsDrainsType$inboundSchema = z.nativeEnum(GetDrainsDrainsType);
/** @internal */
export const GetDrainsDrainsType$outboundSchema = GetDrainsDrainsType$inboundSchema;
/** @internal */
export const GetDrainsDrainsEnv$inboundSchema = z.nativeEnum(GetDrainsDrainsEnv);
/** @internal */
export const GetDrainsDrainsEnv$outboundSchema = GetDrainsDrainsEnv$inboundSchema;
/** @internal */
export const GetDrainsDrainsSampling$inboundSchema = z.object({
    type: GetDrainsDrainsType$inboundSchema,
    rate: z.number(),
    env: GetDrainsDrainsEnv$inboundSchema.optional(),
    requestPath: z.string().optional(),
});
/** @internal */
export const GetDrainsDrainsSampling$outboundSchema = z.object({
    type: GetDrainsDrainsType$outboundSchema,
    rate: z.number(),
    env: GetDrainsDrainsEnv$outboundSchema.optional(),
    requestPath: z.string().optional(),
});
export function getDrainsDrainsSamplingToJSON(getDrainsDrainsSampling) {
    return JSON.stringify(GetDrainsDrainsSampling$outboundSchema.parse(getDrainsDrainsSampling));
}
export function getDrainsDrainsSamplingFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsSampling$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsSampling' from JSON`);
}
/** @internal */
export const GetDrainsDrainsStatus$inboundSchema = z.nativeEnum(GetDrainsDrainsStatus);
/** @internal */
export const GetDrainsDrainsStatus$outboundSchema = GetDrainsDrainsStatus$inboundSchema;
/** @internal */
export const GetDrainsDrainsDisabledReason$inboundSchema = z.nativeEnum(GetDrainsDrainsDisabledReason);
/** @internal */
export const GetDrainsDrainsDisabledReason$outboundSchema = GetDrainsDrainsDisabledReason$inboundSchema;
/** @internal */
export const GetDrainsSourceDrainsResponse200Kind$inboundSchema = z.nativeEnum(GetDrainsSourceDrainsResponse200Kind);
/** @internal */
export const GetDrainsSourceDrainsResponse200Kind$outboundSchema = GetDrainsSourceDrainsResponse200Kind$inboundSchema;
/** @internal */
export const GetDrainsSourceDrains2$inboundSchema = z.object({
    kind: GetDrainsSourceDrainsResponse200Kind$inboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
/** @internal */
export const GetDrainsSourceDrains2$outboundSchema = z.object({
    kind: GetDrainsSourceDrainsResponse200Kind$outboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
export function getDrainsSourceDrains2ToJSON(getDrainsSourceDrains2) {
    return JSON.stringify(GetDrainsSourceDrains2$outboundSchema.parse(getDrainsSourceDrains2));
}
export function getDrainsSourceDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSourceDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSourceDrains2' from JSON`);
}
/** @internal */
export const GetDrainsSourceDrainsResponseKind$inboundSchema = z.nativeEnum(GetDrainsSourceDrainsResponseKind);
/** @internal */
export const GetDrainsSourceDrainsResponseKind$outboundSchema = GetDrainsSourceDrainsResponseKind$inboundSchema;
/** @internal */
export const GetDrainsSourceDrains1$inboundSchema = z.object({
    kind: GetDrainsSourceDrainsResponseKind$inboundSchema,
});
/** @internal */
export const GetDrainsSourceDrains1$outboundSchema = z.object({
    kind: GetDrainsSourceDrainsResponseKind$outboundSchema,
});
export function getDrainsSourceDrains1ToJSON(getDrainsSourceDrains1) {
    return JSON.stringify(GetDrainsSourceDrains1$outboundSchema.parse(getDrainsSourceDrains1));
}
export function getDrainsSourceDrains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSourceDrains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSourceDrains1' from JSON`);
}
/** @internal */
export const GetDrainsDrainsSource$inboundSchema = z.union([
    z.lazy(() => GetDrainsSourceDrains2$inboundSchema),
    z.lazy(() => GetDrainsSourceDrains1$inboundSchema),
]);
/** @internal */
export const GetDrainsDrainsSource$outboundSchema = z.union([
    z.lazy(() => GetDrainsSourceDrains2$outboundSchema),
    z.lazy(() => GetDrainsSourceDrains1$outboundSchema),
]);
export function getDrainsDrainsSourceToJSON(getDrainsDrainsSource) {
    return JSON.stringify(GetDrainsDrainsSource$outboundSchema.parse(getDrainsDrainsSource));
}
export function getDrainsDrainsSourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsSource' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2DrainsResponse200Version$inboundSchema = z
    .nativeEnum(GetDrainsFilterV2DrainsResponse200Version);
/** @internal */
export const GetDrainsFilterV2DrainsResponse200Version$outboundSchema = GetDrainsFilterV2DrainsResponse200Version$inboundSchema;
/** @internal */
export const GetDrainsFilterDrainsResponse200Type$inboundSchema = z.nativeEnum(GetDrainsFilterDrainsResponse200Type);
/** @internal */
export const GetDrainsFilterDrainsResponse200Type$outboundSchema = GetDrainsFilterDrainsResponse200Type$inboundSchema;
/** @internal */
export const GetDrainsFilterDrains2$inboundSchema = z.object({
    type: GetDrainsFilterDrainsResponse200Type$inboundSchema,
    text: z.string(),
});
/** @internal */
export const GetDrainsFilterDrains2$outboundSchema = z.object({
    type: GetDrainsFilterDrainsResponse200Type$outboundSchema,
    text: z.string(),
});
export function getDrainsFilterDrains2ToJSON(getDrainsFilterDrains2) {
    return JSON.stringify(GetDrainsFilterDrains2$outboundSchema.parse(getDrainsFilterDrains2));
}
export function getDrainsFilterDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterDrains2' from JSON`);
}
/** @internal */
export const GetDrainsFilterDrainsResponseType$inboundSchema = z.nativeEnum(GetDrainsFilterDrainsResponseType);
/** @internal */
export const GetDrainsFilterDrainsResponseType$outboundSchema = GetDrainsFilterDrainsResponseType$inboundSchema;
/** @internal */
export const GetDrainsFilterDrainsProject$inboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
/** @internal */
export const GetDrainsFilterDrainsProject$outboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
export function getDrainsFilterDrainsProjectToJSON(getDrainsFilterDrainsProject) {
    return JSON.stringify(GetDrainsFilterDrainsProject$outboundSchema.parse(getDrainsFilterDrainsProject));
}
export function getDrainsFilterDrainsProjectFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterDrainsProject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterDrainsProject' from JSON`);
}
/** @internal */
export const GetDrainsFilterDrainsSources$inboundSchema = z.nativeEnum(GetDrainsFilterDrainsSources);
/** @internal */
export const GetDrainsFilterDrainsSources$outboundSchema = GetDrainsFilterDrainsSources$inboundSchema;
/** @internal */
export const GetDrainsFilterDrainsLog$inboundSchema = z.object({
    sources: z.array(GetDrainsFilterDrainsSources$inboundSchema).optional(),
    legacy_excludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        "legacy_excludeCachedStaticAssetLogs": "legacyExcludeCachedStaticAssetLogs",
    });
});
/** @internal */
export const GetDrainsFilterDrainsLog$outboundSchema = z.object({
    sources: z.array(GetDrainsFilterDrainsSources$outboundSchema).optional(),
    legacyExcludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        legacyExcludeCachedStaticAssetLogs: "legacy_excludeCachedStaticAssetLogs",
    });
});
export function getDrainsFilterDrainsLogToJSON(getDrainsFilterDrainsLog) {
    return JSON.stringify(GetDrainsFilterDrainsLog$outboundSchema.parse(getDrainsFilterDrainsLog));
}
export function getDrainsFilterDrainsLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterDrainsLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterDrainsLog' from JSON`);
}
/** @internal */
export const GetDrainsFilterDrainsEnvironments$inboundSchema = z.nativeEnum(GetDrainsFilterDrainsEnvironments);
/** @internal */
export const GetDrainsFilterDrainsEnvironments$outboundSchema = GetDrainsFilterDrainsEnvironments$inboundSchema;
/** @internal */
export const GetDrainsFilterDrainsDeployment$inboundSchema = z.object({
    environments: z.array(GetDrainsFilterDrainsEnvironments$inboundSchema)
        .optional(),
});
/** @internal */
export const GetDrainsFilterDrainsDeployment$outboundSchema = z.object({
    environments: z.array(GetDrainsFilterDrainsEnvironments$outboundSchema)
        .optional(),
});
export function getDrainsFilterDrainsDeploymentToJSON(getDrainsFilterDrainsDeployment) {
    return JSON.stringify(GetDrainsFilterDrainsDeployment$outboundSchema.parse(getDrainsFilterDrainsDeployment));
}
export function getDrainsFilterDrainsDeploymentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterDrainsDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterDrainsDeployment' from JSON`);
}
/** @internal */
export const GetDrainsFilterDrains1$inboundSchema = z.object({
    type: GetDrainsFilterDrainsResponseType$inboundSchema,
    project: z.lazy(() => GetDrainsFilterDrainsProject$inboundSchema).optional(),
    log: z.lazy(() => GetDrainsFilterDrainsLog$inboundSchema).optional(),
    deployment: z.lazy(() => GetDrainsFilterDrainsDeployment$inboundSchema)
        .optional(),
});
/** @internal */
export const GetDrainsFilterDrains1$outboundSchema = z.object({
    type: GetDrainsFilterDrainsResponseType$outboundSchema,
    project: z.lazy(() => GetDrainsFilterDrainsProject$outboundSchema).optional(),
    log: z.lazy(() => GetDrainsFilterDrainsLog$outboundSchema).optional(),
    deployment: z.lazy(() => GetDrainsFilterDrainsDeployment$outboundSchema)
        .optional(),
});
export function getDrainsFilterDrains1ToJSON(getDrainsFilterDrains1) {
    return JSON.stringify(GetDrainsFilterDrains1$outboundSchema.parse(getDrainsFilterDrains1));
}
export function getDrainsFilterDrains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterDrains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterDrains1' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2DrainsFilter$inboundSchema = z.union([
    z.lazy(() => GetDrainsFilterDrains2$inboundSchema),
    z.lazy(() => GetDrainsFilterDrains1$inboundSchema),
]);
/** @internal */
export const GetDrainsFilterV2DrainsFilter$outboundSchema = z.union([
    z.lazy(() => GetDrainsFilterDrains2$outboundSchema),
    z.lazy(() => GetDrainsFilterDrains1$outboundSchema),
]);
export function getDrainsFilterV2DrainsFilterToJSON(getDrainsFilterV2DrainsFilter) {
    return JSON.stringify(GetDrainsFilterV2DrainsFilter$outboundSchema.parse(getDrainsFilterV2DrainsFilter));
}
export function getDrainsFilterV2DrainsFilterFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterV2DrainsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterV2DrainsFilter' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2Drains2$inboundSchema = z.object({
    version: GetDrainsFilterV2DrainsResponse200Version$inboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainsFilterDrains2$inboundSchema),
        z.lazy(() => GetDrainsFilterDrains1$inboundSchema),
    ]),
});
/** @internal */
export const GetDrainsFilterV2Drains2$outboundSchema = z.object({
    version: GetDrainsFilterV2DrainsResponse200Version$outboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainsFilterDrains2$outboundSchema),
        z.lazy(() => GetDrainsFilterDrains1$outboundSchema),
    ]),
});
export function getDrainsFilterV2Drains2ToJSON(getDrainsFilterV2Drains2) {
    return JSON.stringify(GetDrainsFilterV2Drains2$outboundSchema.parse(getDrainsFilterV2Drains2));
}
export function getDrainsFilterV2Drains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterV2Drains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterV2Drains2' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2DrainsResponseVersion$inboundSchema = z.nativeEnum(GetDrainsFilterV2DrainsResponseVersion);
/** @internal */
export const GetDrainsFilterV2DrainsResponseVersion$outboundSchema = GetDrainsFilterV2DrainsResponseVersion$inboundSchema;
/** @internal */
export const GetDrainsFilterV2Drains1$inboundSchema = z.object({
    version: GetDrainsFilterV2DrainsResponseVersion$inboundSchema,
});
/** @internal */
export const GetDrainsFilterV2Drains1$outboundSchema = z.object({
    version: GetDrainsFilterV2DrainsResponseVersion$outboundSchema,
});
export function getDrainsFilterV2Drains1ToJSON(getDrainsFilterV2Drains1) {
    return JSON.stringify(GetDrainsFilterV2Drains1$outboundSchema.parse(getDrainsFilterV2Drains1));
}
export function getDrainsFilterV2Drains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterV2Drains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterV2Drains1' from JSON`);
}
/** @internal */
export const GetDrainsDrainsFilterV2$inboundSchema = z.union([
    z.lazy(() => GetDrainsFilterV2Drains2$inboundSchema),
    z.lazy(() => GetDrainsFilterV2Drains1$inboundSchema),
]);
/** @internal */
export const GetDrainsDrainsFilterV2$outboundSchema = z.union([
    z.lazy(() => GetDrainsFilterV2Drains2$outboundSchema),
    z.lazy(() => GetDrainsFilterV2Drains1$outboundSchema),
]);
export function getDrainsDrainsFilterV2ToJSON(getDrainsDrainsFilterV2) {
    return JSON.stringify(GetDrainsDrainsFilterV2$outboundSchema.parse(getDrainsDrainsFilterV2));
}
export function getDrainsDrainsFilterV2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDrainsFilterV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDrainsFilterV2' from JSON`);
}
/** @internal */
export const GetDrainsProjectAccessDrainsAccess$inboundSchema = z.nativeEnum(GetDrainsProjectAccessDrainsAccess);
/** @internal */
export const GetDrainsProjectAccessDrainsAccess$outboundSchema = GetDrainsProjectAccessDrainsAccess$inboundSchema;
/** @internal */
export const GetDrainsProjectAccess2$inboundSchema = z.object({
    access: GetDrainsProjectAccessDrainsAccess$inboundSchema,
    projectIds: z.array(z.string()),
});
/** @internal */
export const GetDrainsProjectAccess2$outboundSchema = z.object({
    access: GetDrainsProjectAccessDrainsAccess$outboundSchema,
    projectIds: z.array(z.string()),
});
export function getDrainsProjectAccess2ToJSON(getDrainsProjectAccess2) {
    return JSON.stringify(GetDrainsProjectAccess2$outboundSchema.parse(getDrainsProjectAccess2));
}
export function getDrainsProjectAccess2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsProjectAccess2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsProjectAccess2' from JSON`);
}
/** @internal */
export const GetDrainsProjectAccessAccess$inboundSchema = z.nativeEnum(GetDrainsProjectAccessAccess);
/** @internal */
export const GetDrainsProjectAccessAccess$outboundSchema = GetDrainsProjectAccessAccess$inboundSchema;
/** @internal */
export const GetDrainsProjectAccess1$inboundSchema = z.object({
    access: GetDrainsProjectAccessAccess$inboundSchema,
});
/** @internal */
export const GetDrainsProjectAccess1$outboundSchema = z.object({
    access: GetDrainsProjectAccessAccess$outboundSchema,
});
export function getDrainsProjectAccess1ToJSON(getDrainsProjectAccess1) {
    return JSON.stringify(GetDrainsProjectAccess1$outboundSchema.parse(getDrainsProjectAccess1));
}
export function getDrainsProjectAccess1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsProjectAccess1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsProjectAccess1' from JSON`);
}
/** @internal */
export const DrainsProjectAccess$inboundSchema = z.union([
    z.lazy(() => GetDrainsProjectAccess2$inboundSchema),
    z.lazy(() => GetDrainsProjectAccess1$inboundSchema),
]);
/** @internal */
export const DrainsProjectAccess$outboundSchema = z.union([
    z.lazy(() => GetDrainsProjectAccess2$outboundSchema),
    z.lazy(() => GetDrainsProjectAccess1$outboundSchema),
]);
export function drainsProjectAccessToJSON(drainsProjectAccess) {
    return JSON.stringify(DrainsProjectAccess$outboundSchema.parse(drainsProjectAccess));
}
export function drainsProjectAccessFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsProjectAccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsProjectAccess' from JSON`);
}
/** @internal */
export const Drains2$inboundSchema = z.object({
    id: z.string(),
    ownerId: z.string(),
    name: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
    schemas: z.lazy(() => GetDrainsDrainsSchemas$inboundSchema).optional(),
    delivery: z.union([
        z.lazy(() => GetDrainsDeliveryDrains1$inboundSchema),
        z.lazy(() => GetDrainsDeliveryDrains2$inboundSchema),
        z.lazy(() => GetDrainsDeliveryDrains3$inboundSchema),
        z.lazy(() => GetDrainsDeliveryDrains4$inboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => GetDrainsDrainsSampling$inboundSchema))
        .optional(),
    teamId: z.nullable(z.string()).optional(),
    status: GetDrainsDrainsStatus$inboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: GetDrainsDrainsDisabledReason$inboundSchema.optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainsSourceDrains2$inboundSchema),
        z.lazy(() => GetDrainsSourceDrains1$inboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainsFilterV2Drains2$inboundSchema),
        z.lazy(() => GetDrainsFilterV2Drains1$inboundSchema),
    ]).optional(),
    integrationIcon: z.string().optional(),
    integrationConfigurationUri: z.string().optional(),
    integrationWebsite: z.string().optional(),
    projectAccess: z.union([
        z.lazy(() => GetDrainsProjectAccess2$inboundSchema),
        z.lazy(() => GetDrainsProjectAccess1$inboundSchema),
    ]).optional(),
});
/** @internal */
export const Drains2$outboundSchema = z.object({
    id: z.string(),
    ownerId: z.string(),
    name: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
    schemas: z.lazy(() => GetDrainsDrainsSchemas$outboundSchema).optional(),
    delivery: z.union([
        z.lazy(() => GetDrainsDeliveryDrains1$outboundSchema),
        z.lazy(() => GetDrainsDeliveryDrains2$outboundSchema),
        z.lazy(() => GetDrainsDeliveryDrains3$outboundSchema),
        z.lazy(() => GetDrainsDeliveryDrains4$outboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => GetDrainsDrainsSampling$outboundSchema))
        .optional(),
    teamId: z.nullable(z.string()).optional(),
    status: GetDrainsDrainsStatus$outboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: GetDrainsDrainsDisabledReason$outboundSchema.optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainsSourceDrains2$outboundSchema),
        z.lazy(() => GetDrainsSourceDrains1$outboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainsFilterV2Drains2$outboundSchema),
        z.lazy(() => GetDrainsFilterV2Drains1$outboundSchema),
    ]).optional(),
    integrationIcon: z.string().optional(),
    integrationConfigurationUri: z.string().optional(),
    integrationWebsite: z.string().optional(),
    projectAccess: z.union([
        z.lazy(() => GetDrainsProjectAccess2$outboundSchema),
        z.lazy(() => GetDrainsProjectAccess1$outboundSchema),
    ]).optional(),
});
export function drains2ToJSON(drains2) {
    return JSON.stringify(Drains2$outboundSchema.parse(drains2));
}
export function drains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => Drains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Drains2' from JSON`);
}
/** @internal */
export const DrainsLog$inboundSchema = z.object({});
/** @internal */
export const DrainsLog$outboundSchema = z.object({});
export function drainsLogToJSON(drainsLog) {
    return JSON.stringify(DrainsLog$outboundSchema.parse(drainsLog));
}
export function drainsLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsLog' from JSON`);
}
/** @internal */
export const DrainsTrace$inboundSchema = z.object({});
/** @internal */
export const DrainsTrace$outboundSchema = z.object({});
export function drainsTraceToJSON(drainsTrace) {
    return JSON.stringify(DrainsTrace$outboundSchema.parse(drainsTrace));
}
export function drainsTraceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsTrace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsTrace' from JSON`);
}
/** @internal */
export const DrainsAnalytics$inboundSchema = z.object({});
/** @internal */
export const DrainsAnalytics$outboundSchema = z.object({});
export function drainsAnalyticsToJSON(drainsAnalytics) {
    return JSON.stringify(DrainsAnalytics$outboundSchema.parse(drainsAnalytics));
}
export function drainsAnalyticsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsAnalytics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsAnalytics' from JSON`);
}
/** @internal */
export const DrainsSpeedInsights$inboundSchema = z.object({});
/** @internal */
export const DrainsSpeedInsights$outboundSchema = z.object({});
export function drainsSpeedInsightsToJSON(drainsSpeedInsights) {
    return JSON.stringify(DrainsSpeedInsights$outboundSchema.parse(drainsSpeedInsights));
}
export function drainsSpeedInsightsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsSpeedInsights$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsSpeedInsights' from JSON`);
}
/** @internal */
export const DrainsSchemas$inboundSchema = z.object({
    log: z.lazy(() => DrainsLog$inboundSchema).optional(),
    trace: z.lazy(() => DrainsTrace$inboundSchema).optional(),
    analytics: z.lazy(() => DrainsAnalytics$inboundSchema).optional(),
    speed_insights: z.lazy(() => DrainsSpeedInsights$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "speed_insights": "speedInsights",
    });
});
/** @internal */
export const DrainsSchemas$outboundSchema = z.object({
    log: z.lazy(() => DrainsLog$outboundSchema).optional(),
    trace: z.lazy(() => DrainsTrace$outboundSchema).optional(),
    analytics: z.lazy(() => DrainsAnalytics$outboundSchema).optional(),
    speedInsights: z.lazy(() => DrainsSpeedInsights$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        speedInsights: "speed_insights",
    });
});
export function drainsSchemasToJSON(drainsSchemas) {
    return JSON.stringify(DrainsSchemas$outboundSchema.parse(drainsSchemas));
}
export function drainsSchemasFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsSchemas' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponse200Type$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsResponse200Type);
/** @internal */
export const GetDrainsDeliveryDrainsResponse200Type$outboundSchema = GetDrainsDeliveryDrainsResponse200Type$inboundSchema;
/** @internal */
export const GetDrainsDeliveryTarget$inboundSchema = z.nativeEnum(GetDrainsDeliveryTarget);
/** @internal */
export const GetDrainsDeliveryTarget$outboundSchema = GetDrainsDeliveryTarget$inboundSchema;
/** @internal */
export const GetDrainsDelivery4$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200Type$inboundSchema,
    target: GetDrainsDeliveryTarget$inboundSchema,
});
/** @internal */
export const GetDrainsDelivery4$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponse200Type$outboundSchema,
    target: GetDrainsDeliveryTarget$outboundSchema,
});
export function getDrainsDelivery4ToJSON(getDrainsDelivery4) {
    return JSON.stringify(GetDrainsDelivery4$outboundSchema.parse(getDrainsDelivery4));
}
export function getDrainsDelivery4FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDelivery4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDelivery4' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsResponseType$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsResponseType);
/** @internal */
export const GetDrainsDeliveryDrainsResponseType$outboundSchema = GetDrainsDeliveryDrainsResponseType$inboundSchema;
/** @internal */
export const GetDrainsDelivery3$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponseType$inboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
/** @internal */
export const GetDrainsDelivery3$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsResponseType$outboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
export function getDrainsDelivery3ToJSON(getDrainsDelivery3) {
    return JSON.stringify(GetDrainsDelivery3$outboundSchema.parse(getDrainsDelivery3));
}
export function getDrainsDelivery3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDelivery3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDelivery3' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsType$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsType);
/** @internal */
export const GetDrainsDeliveryDrainsType$outboundSchema = GetDrainsDeliveryDrainsType$inboundSchema;
/** @internal */
export const GetDrainsDeliveryEndpoint$inboundSchema = z.object({
    traces: z.string(),
});
/** @internal */
export const GetDrainsDeliveryEndpoint$outboundSchema = z.object({
    traces: z.string(),
});
export function getDrainsDeliveryEndpointToJSON(getDrainsDeliveryEndpoint) {
    return JSON.stringify(GetDrainsDeliveryEndpoint$outboundSchema.parse(getDrainsDeliveryEndpoint));
}
export function getDrainsDeliveryEndpointFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryEndpoint' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsEncoding$inboundSchema = z.nativeEnum(GetDrainsDeliveryDrainsEncoding);
/** @internal */
export const GetDrainsDeliveryDrainsEncoding$outboundSchema = GetDrainsDeliveryDrainsEncoding$inboundSchema;
/** @internal */
export const GetDrainsSecretDrainsKind$inboundSchema = z.nativeEnum(GetDrainsSecretDrainsKind);
/** @internal */
export const GetDrainsSecretDrainsKind$outboundSchema = GetDrainsSecretDrainsKind$inboundSchema;
/** @internal */
export const GetDrainsSecretDrains2$inboundSchema = z.object({
    kind: GetDrainsSecretDrainsKind$inboundSchema,
});
/** @internal */
export const GetDrainsSecretDrains2$outboundSchema = z.object({
    kind: GetDrainsSecretDrainsKind$outboundSchema,
});
export function getDrainsSecretDrains2ToJSON(getDrainsSecretDrains2) {
    return JSON.stringify(GetDrainsSecretDrains2$outboundSchema.parse(getDrainsSecretDrains2));
}
export function getDrainsSecretDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSecretDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSecretDrains2' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryDrainsSecret$inboundSchema = z.union([z.lazy(() => GetDrainsSecretDrains2$inboundSchema), z.string()]);
/** @internal */
export const GetDrainsDeliveryDrainsSecret$outboundSchema = z.union([z.lazy(() => GetDrainsSecretDrains2$outboundSchema), z.string()]);
export function getDrainsDeliveryDrainsSecretToJSON(getDrainsDeliveryDrainsSecret) {
    return JSON.stringify(GetDrainsDeliveryDrainsSecret$outboundSchema.parse(getDrainsDeliveryDrainsSecret));
}
export function getDrainsDeliveryDrainsSecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliveryDrainsSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliveryDrainsSecret' from JSON`);
}
/** @internal */
export const GetDrainsDelivery2$inboundSchema = z.object({
    type: GetDrainsDeliveryDrainsType$inboundSchema,
    endpoint: z.lazy(() => GetDrainsDeliveryEndpoint$inboundSchema),
    encoding: GetDrainsDeliveryDrainsEncoding$inboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainsSecretDrains2$inboundSchema),
        z.string(),
    ]).optional(),
});
/** @internal */
export const GetDrainsDelivery2$outboundSchema = z.object({
    type: GetDrainsDeliveryDrainsType$outboundSchema,
    endpoint: z.lazy(() => GetDrainsDeliveryEndpoint$outboundSchema),
    encoding: GetDrainsDeliveryDrainsEncoding$outboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainsSecretDrains2$outboundSchema),
        z.string(),
    ]).optional(),
});
export function getDrainsDelivery2ToJSON(getDrainsDelivery2) {
    return JSON.stringify(GetDrainsDelivery2$outboundSchema.parse(getDrainsDelivery2));
}
export function getDrainsDelivery2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDelivery2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDelivery2' from JSON`);
}
/** @internal */
export const GetDrainsDeliveryType$inboundSchema = z.nativeEnum(GetDrainsDeliveryType);
/** @internal */
export const GetDrainsDeliveryType$outboundSchema = GetDrainsDeliveryType$inboundSchema;
/** @internal */
export const GetDrainsDeliveryEncoding$inboundSchema = z.nativeEnum(GetDrainsDeliveryEncoding);
/** @internal */
export const GetDrainsDeliveryEncoding$outboundSchema = GetDrainsDeliveryEncoding$inboundSchema;
/** @internal */
export const GetDrainsDeliveryCompression$inboundSchema = z.nativeEnum(GetDrainsDeliveryCompression);
/** @internal */
export const GetDrainsDeliveryCompression$outboundSchema = GetDrainsDeliveryCompression$inboundSchema;
/** @internal */
export const GetDrainsSecretKind$inboundSchema = z.nativeEnum(GetDrainsSecretKind);
/** @internal */
export const GetDrainsSecretKind$outboundSchema = GetDrainsSecretKind$inboundSchema;
/** @internal */
export const GetDrainsSecret2$inboundSchema = z.object({
    kind: GetDrainsSecretKind$inboundSchema,
});
/** @internal */
export const GetDrainsSecret2$outboundSchema = z.object({
    kind: GetDrainsSecretKind$outboundSchema,
});
export function getDrainsSecret2ToJSON(getDrainsSecret2) {
    return JSON.stringify(GetDrainsSecret2$outboundSchema.parse(getDrainsSecret2));
}
export function getDrainsSecret2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSecret2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSecret2' from JSON`);
}
/** @internal */
export const GetDrainsDeliverySecret$inboundSchema = z.union([z.lazy(() => GetDrainsSecret2$inboundSchema), z.string()]);
/** @internal */
export const GetDrainsDeliverySecret$outboundSchema = z.union([z.lazy(() => GetDrainsSecret2$outboundSchema), z.string()]);
export function getDrainsDeliverySecretToJSON(getDrainsDeliverySecret) {
    return JSON.stringify(GetDrainsDeliverySecret$outboundSchema.parse(getDrainsDeliverySecret));
}
export function getDrainsDeliverySecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDeliverySecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDeliverySecret' from JSON`);
}
/** @internal */
export const GetDrainsDelivery1$inboundSchema = z.object({
    type: GetDrainsDeliveryType$inboundSchema,
    endpoint: z.string(),
    encoding: GetDrainsDeliveryEncoding$inboundSchema,
    compression: GetDrainsDeliveryCompression$inboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([z.lazy(() => GetDrainsSecret2$inboundSchema), z.string()])
        .optional(),
});
/** @internal */
export const GetDrainsDelivery1$outboundSchema = z.object({
    type: GetDrainsDeliveryType$outboundSchema,
    endpoint: z.string(),
    encoding: GetDrainsDeliveryEncoding$outboundSchema,
    compression: GetDrainsDeliveryCompression$outboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([z.lazy(() => GetDrainsSecret2$outboundSchema), z.string()])
        .optional(),
});
export function getDrainsDelivery1ToJSON(getDrainsDelivery1) {
    return JSON.stringify(GetDrainsDelivery1$outboundSchema.parse(getDrainsDelivery1));
}
export function getDrainsDelivery1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsDelivery1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsDelivery1' from JSON`);
}
/** @internal */
export const DrainsDelivery$inboundSchema = z.union([
    z.lazy(() => GetDrainsDelivery1$inboundSchema),
    z.lazy(() => GetDrainsDelivery2$inboundSchema),
    z.lazy(() => GetDrainsDelivery3$inboundSchema),
    z.lazy(() => GetDrainsDelivery4$inboundSchema),
]);
/** @internal */
export const DrainsDelivery$outboundSchema = z.union([
    z.lazy(() => GetDrainsDelivery1$outboundSchema),
    z.lazy(() => GetDrainsDelivery2$outboundSchema),
    z.lazy(() => GetDrainsDelivery3$outboundSchema),
    z.lazy(() => GetDrainsDelivery4$outboundSchema),
]);
export function drainsDeliveryToJSON(drainsDelivery) {
    return JSON.stringify(DrainsDelivery$outboundSchema.parse(drainsDelivery));
}
export function drainsDeliveryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsDelivery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsDelivery' from JSON`);
}
/** @internal */
export const DrainsType$inboundSchema = z
    .nativeEnum(DrainsType);
/** @internal */
export const DrainsType$outboundSchema = DrainsType$inboundSchema;
/** @internal */
export const DrainsEnv$inboundSchema = z
    .nativeEnum(DrainsEnv);
/** @internal */
export const DrainsEnv$outboundSchema = DrainsEnv$inboundSchema;
/** @internal */
export const DrainsSampling$inboundSchema = z.object({
    type: DrainsType$inboundSchema,
    rate: z.number(),
    env: DrainsEnv$inboundSchema.optional(),
    requestPath: z.string().optional(),
});
/** @internal */
export const DrainsSampling$outboundSchema = z.object({
    type: DrainsType$outboundSchema,
    rate: z.number(),
    env: DrainsEnv$outboundSchema.optional(),
    requestPath: z.string().optional(),
});
export function drainsSamplingToJSON(drainsSampling) {
    return JSON.stringify(DrainsSampling$outboundSchema.parse(drainsSampling));
}
export function drainsSamplingFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsSampling$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsSampling' from JSON`);
}
/** @internal */
export const DrainsStatus$inboundSchema = z.nativeEnum(DrainsStatus);
/** @internal */
export const DrainsStatus$outboundSchema = DrainsStatus$inboundSchema;
/** @internal */
export const DrainsDisabledReason$inboundSchema = z.nativeEnum(DrainsDisabledReason);
/** @internal */
export const DrainsDisabledReason$outboundSchema = DrainsDisabledReason$inboundSchema;
/** @internal */
export const GetDrainsSourceDrainsKind$inboundSchema = z.nativeEnum(GetDrainsSourceDrainsKind);
/** @internal */
export const GetDrainsSourceDrainsKind$outboundSchema = GetDrainsSourceDrainsKind$inboundSchema;
/** @internal */
export const GetDrainsSource2$inboundSchema = z.object({
    kind: GetDrainsSourceDrainsKind$inboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
/** @internal */
export const GetDrainsSource2$outboundSchema = z.object({
    kind: GetDrainsSourceDrainsKind$outboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
export function getDrainsSource2ToJSON(getDrainsSource2) {
    return JSON.stringify(GetDrainsSource2$outboundSchema.parse(getDrainsSource2));
}
export function getDrainsSource2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSource2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSource2' from JSON`);
}
/** @internal */
export const GetDrainsSourceKind$inboundSchema = z.nativeEnum(GetDrainsSourceKind);
/** @internal */
export const GetDrainsSourceKind$outboundSchema = GetDrainsSourceKind$inboundSchema;
/** @internal */
export const GetDrainsSource1$inboundSchema = z.object({
    kind: GetDrainsSourceKind$inboundSchema,
});
/** @internal */
export const GetDrainsSource1$outboundSchema = z.object({
    kind: GetDrainsSourceKind$outboundSchema,
});
export function getDrainsSource1ToJSON(getDrainsSource1) {
    return JSON.stringify(GetDrainsSource1$outboundSchema.parse(getDrainsSource1));
}
export function getDrainsSource1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsSource1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsSource1' from JSON`);
}
/** @internal */
export const DrainsSource$inboundSchema = z.union([
    z.lazy(() => GetDrainsSource2$inboundSchema),
    z.lazy(() => GetDrainsSource1$inboundSchema),
]);
/** @internal */
export const DrainsSource$outboundSchema = z.union([
    z.lazy(() => GetDrainsSource2$outboundSchema),
    z.lazy(() => GetDrainsSource1$outboundSchema),
]);
export function drainsSourceToJSON(drainsSource) {
    return JSON.stringify(DrainsSource$outboundSchema.parse(drainsSource));
}
export function drainsSourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsSource' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2DrainsVersion$inboundSchema = z.nativeEnum(GetDrainsFilterV2DrainsVersion);
/** @internal */
export const GetDrainsFilterV2DrainsVersion$outboundSchema = GetDrainsFilterV2DrainsVersion$inboundSchema;
/** @internal */
export const GetDrainsFilterDrainsType$inboundSchema = z.nativeEnum(GetDrainsFilterDrainsType);
/** @internal */
export const GetDrainsFilterDrainsType$outboundSchema = GetDrainsFilterDrainsType$inboundSchema;
/** @internal */
export const GetDrainsFilter2$inboundSchema = z.object({
    type: GetDrainsFilterDrainsType$inboundSchema,
    text: z.string(),
});
/** @internal */
export const GetDrainsFilter2$outboundSchema = z.object({
    type: GetDrainsFilterDrainsType$outboundSchema,
    text: z.string(),
});
export function getDrainsFilter2ToJSON(getDrainsFilter2) {
    return JSON.stringify(GetDrainsFilter2$outboundSchema.parse(getDrainsFilter2));
}
export function getDrainsFilter2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilter2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilter2' from JSON`);
}
/** @internal */
export const GetDrainsFilterType$inboundSchema = z.nativeEnum(GetDrainsFilterType);
/** @internal */
export const GetDrainsFilterType$outboundSchema = GetDrainsFilterType$inboundSchema;
/** @internal */
export const GetDrainsFilterProject$inboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
/** @internal */
export const GetDrainsFilterProject$outboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
export function getDrainsFilterProjectToJSON(getDrainsFilterProject) {
    return JSON.stringify(GetDrainsFilterProject$outboundSchema.parse(getDrainsFilterProject));
}
export function getDrainsFilterProjectFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterProject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterProject' from JSON`);
}
/** @internal */
export const GetDrainsFilterSources$inboundSchema = z.nativeEnum(GetDrainsFilterSources);
/** @internal */
export const GetDrainsFilterSources$outboundSchema = GetDrainsFilterSources$inboundSchema;
/** @internal */
export const GetDrainsFilterLog$inboundSchema = z.object({
    sources: z.array(GetDrainsFilterSources$inboundSchema).optional(),
    legacy_excludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        "legacy_excludeCachedStaticAssetLogs": "legacyExcludeCachedStaticAssetLogs",
    });
});
/** @internal */
export const GetDrainsFilterLog$outboundSchema = z.object({
    sources: z.array(GetDrainsFilterSources$outboundSchema).optional(),
    legacyExcludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        legacyExcludeCachedStaticAssetLogs: "legacy_excludeCachedStaticAssetLogs",
    });
});
export function getDrainsFilterLogToJSON(getDrainsFilterLog) {
    return JSON.stringify(GetDrainsFilterLog$outboundSchema.parse(getDrainsFilterLog));
}
export function getDrainsFilterLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterLog' from JSON`);
}
/** @internal */
export const GetDrainsFilterEnvironments$inboundSchema = z.nativeEnum(GetDrainsFilterEnvironments);
/** @internal */
export const GetDrainsFilterEnvironments$outboundSchema = GetDrainsFilterEnvironments$inboundSchema;
/** @internal */
export const GetDrainsFilterDeployment$inboundSchema = z.object({
    environments: z.array(GetDrainsFilterEnvironments$inboundSchema).optional(),
});
/** @internal */
export const GetDrainsFilterDeployment$outboundSchema = z.object({
    environments: z.array(GetDrainsFilterEnvironments$outboundSchema).optional(),
});
export function getDrainsFilterDeploymentToJSON(getDrainsFilterDeployment) {
    return JSON.stringify(GetDrainsFilterDeployment$outboundSchema.parse(getDrainsFilterDeployment));
}
export function getDrainsFilterDeploymentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterDeployment' from JSON`);
}
/** @internal */
export const GetDrainsFilter1$inboundSchema = z.object({
    type: GetDrainsFilterType$inboundSchema,
    project: z.lazy(() => GetDrainsFilterProject$inboundSchema).optional(),
    log: z.lazy(() => GetDrainsFilterLog$inboundSchema).optional(),
    deployment: z.lazy(() => GetDrainsFilterDeployment$inboundSchema).optional(),
});
/** @internal */
export const GetDrainsFilter1$outboundSchema = z.object({
    type: GetDrainsFilterType$outboundSchema,
    project: z.lazy(() => GetDrainsFilterProject$outboundSchema).optional(),
    log: z.lazy(() => GetDrainsFilterLog$outboundSchema).optional(),
    deployment: z.lazy(() => GetDrainsFilterDeployment$outboundSchema).optional(),
});
export function getDrainsFilter1ToJSON(getDrainsFilter1) {
    return JSON.stringify(GetDrainsFilter1$outboundSchema.parse(getDrainsFilter1));
}
export function getDrainsFilter1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilter1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilter1' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2Filter$inboundSchema = z.union([
    z.lazy(() => GetDrainsFilter2$inboundSchema),
    z.lazy(() => GetDrainsFilter1$inboundSchema),
]);
/** @internal */
export const GetDrainsFilterV2Filter$outboundSchema = z.union([
    z.lazy(() => GetDrainsFilter2$outboundSchema),
    z.lazy(() => GetDrainsFilter1$outboundSchema),
]);
export function getDrainsFilterV2FilterToJSON(getDrainsFilterV2Filter) {
    return JSON.stringify(GetDrainsFilterV2Filter$outboundSchema.parse(getDrainsFilterV2Filter));
}
export function getDrainsFilterV2FilterFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterV2Filter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterV2Filter' from JSON`);
}
/** @internal */
export const GetDrainsFilterV22$inboundSchema = z.object({
    version: GetDrainsFilterV2DrainsVersion$inboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainsFilter2$inboundSchema),
        z.lazy(() => GetDrainsFilter1$inboundSchema),
    ]),
});
/** @internal */
export const GetDrainsFilterV22$outboundSchema = z.object({
    version: GetDrainsFilterV2DrainsVersion$outboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainsFilter2$outboundSchema),
        z.lazy(() => GetDrainsFilter1$outboundSchema),
    ]),
});
export function getDrainsFilterV22ToJSON(getDrainsFilterV22) {
    return JSON.stringify(GetDrainsFilterV22$outboundSchema.parse(getDrainsFilterV22));
}
export function getDrainsFilterV22FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterV22$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterV22' from JSON`);
}
/** @internal */
export const GetDrainsFilterV2Version$inboundSchema = z.nativeEnum(GetDrainsFilterV2Version);
/** @internal */
export const GetDrainsFilterV2Version$outboundSchema = GetDrainsFilterV2Version$inboundSchema;
/** @internal */
export const GetDrainsFilterV21$inboundSchema = z.object({
    version: GetDrainsFilterV2Version$inboundSchema,
});
/** @internal */
export const GetDrainsFilterV21$outboundSchema = z.object({
    version: GetDrainsFilterV2Version$outboundSchema,
});
export function getDrainsFilterV21ToJSON(getDrainsFilterV21) {
    return JSON.stringify(GetDrainsFilterV21$outboundSchema.parse(getDrainsFilterV21));
}
export function getDrainsFilterV21FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsFilterV21$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsFilterV21' from JSON`);
}
/** @internal */
export const DrainsFilterV2$inboundSchema = z.union([
    z.lazy(() => GetDrainsFilterV22$inboundSchema),
    z.lazy(() => GetDrainsFilterV21$inboundSchema),
]);
/** @internal */
export const DrainsFilterV2$outboundSchema = z.union([
    z.lazy(() => GetDrainsFilterV22$outboundSchema),
    z.lazy(() => GetDrainsFilterV21$outboundSchema),
]);
export function drainsFilterV2ToJSON(drainsFilterV2) {
    return JSON.stringify(DrainsFilterV2$outboundSchema.parse(drainsFilterV2));
}
export function drainsFilterV2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => DrainsFilterV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DrainsFilterV2' from JSON`);
}
/** @internal */
export const Drains1$inboundSchema = z.object({
    id: z.string(),
    ownerId: z.string(),
    name: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
    schemas: z.lazy(() => DrainsSchemas$inboundSchema).optional(),
    delivery: z.union([
        z.lazy(() => GetDrainsDelivery1$inboundSchema),
        z.lazy(() => GetDrainsDelivery2$inboundSchema),
        z.lazy(() => GetDrainsDelivery3$inboundSchema),
        z.lazy(() => GetDrainsDelivery4$inboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => DrainsSampling$inboundSchema)).optional(),
    teamId: z.nullable(z.string()).optional(),
    status: DrainsStatus$inboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: DrainsDisabledReason$inboundSchema.optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainsSource2$inboundSchema),
        z.lazy(() => GetDrainsSource1$inboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainsFilterV22$inboundSchema),
        z.lazy(() => GetDrainsFilterV21$inboundSchema),
    ]).optional(),
});
/** @internal */
export const Drains1$outboundSchema = z.object({
    id: z.string(),
    ownerId: z.string(),
    name: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
    schemas: z.lazy(() => DrainsSchemas$outboundSchema).optional(),
    delivery: z.union([
        z.lazy(() => GetDrainsDelivery1$outboundSchema),
        z.lazy(() => GetDrainsDelivery2$outboundSchema),
        z.lazy(() => GetDrainsDelivery3$outboundSchema),
        z.lazy(() => GetDrainsDelivery4$outboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => DrainsSampling$outboundSchema)).optional(),
    teamId: z.nullable(z.string()).optional(),
    status: DrainsStatus$outboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: DrainsDisabledReason$outboundSchema.optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainsSource2$outboundSchema),
        z.lazy(() => GetDrainsSource1$outboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainsFilterV22$outboundSchema),
        z.lazy(() => GetDrainsFilterV21$outboundSchema),
    ]).optional(),
});
export function drains1ToJSON(drains1) {
    return JSON.stringify(Drains1$outboundSchema.parse(drains1));
}
export function drains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => Drains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Drains1' from JSON`);
}
/** @internal */
export const Drains$inboundSchema = z
    .union([
    z.array(z.lazy(() => Drains1$inboundSchema)),
    z.array(z.lazy(() => Drains2$inboundSchema)),
]);
/** @internal */
export const Drains$outboundSchema = z.union([
    z.array(z.lazy(() => Drains1$outboundSchema)),
    z.array(z.lazy(() => Drains2$outboundSchema)),
]);
export function drainsToJSON(drains) {
    return JSON.stringify(Drains$outboundSchema.parse(drains));
}
export function drainsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Drains$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Drains' from JSON`);
}
/** @internal */
export const GetDrainsResponseBody$inboundSchema = z.object({
    drains: z.union([
        z.array(z.lazy(() => Drains1$inboundSchema)),
        z.array(z.lazy(() => Drains2$inboundSchema)),
    ]),
});
/** @internal */
export const GetDrainsResponseBody$outboundSchema = z.object({
    drains: z.union([
        z.array(z.lazy(() => Drains1$outboundSchema)),
        z.array(z.lazy(() => Drains2$outboundSchema)),
    ]),
});
export function getDrainsResponseBodyToJSON(getDrainsResponseBody) {
    return JSON.stringify(GetDrainsResponseBody$outboundSchema.parse(getDrainsResponseBody));
}
export function getDrainsResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainsResponseBody' from JSON`);
}
//# sourceMappingURL=getdrainsop.js.map