/*
 * 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 GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type = {
    Internal: "internal",
};
export const GetDrainDeliveryDrainsTarget = {
    VercelOtelTracesDb: "vercel-otel-traces-db",
};
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type = {
    Clickhouse: "clickhouse",
};
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType = {
    Otlphttp: "otlphttp",
};
export const GetDrainDeliveryDrainsResponse200Encoding = {
    Json: "json",
    Proto: "proto",
};
export const GetDrainSecretDrainsResponse200Kind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainDeliveryDrainsResponse200ApplicationJSONType = {
    Http: "http",
};
export const GetDrainDeliveryDrainsResponseEncoding = {
    Json: "json",
    Ndjson: "ndjson",
};
export const GetDrainDeliveryDrainsCompression = {
    Gzip: "gzip",
    None: "none",
};
export const GetDrainSecretDrainsResponseKind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainResponseBodyDrainsType = {
    HeadSampling: "head_sampling",
};
export const GetDrainResponseBodyDrainsEnv = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainResponseBodyDrainsStatus = {
    Enabled: "enabled",
    Disabled: "disabled",
    Errored: "errored",
};
export const GetDrainResponseBodyDrainsDisabledReason = {
    DisabledByOwner: "disabled-by-owner",
    FeatureNotAvailable: "feature-not-available",
    AccountPlanDowngrade: "account-plan-downgrade",
    DisabledByAdmin: "disabled-by-admin",
};
export const GetDrainSourceDrainsResponse200Kind = {
    Integration: "integration",
};
export const GetDrainSourceDrainsResponseKind = {
    SelfServed: "self-served",
};
export const GetDrainFilterV2DrainsResponse200Version = {
    V2: "v2",
};
export const GetDrainFilterDrainsResponse200Type = {
    Odata: "odata",
};
export const GetDrainFilterDrainsResponseType = {
    Basic: "basic",
};
export const GetDrainFilterDrainsSources = {
    Build: "build",
    Edge: "edge",
    Lambda: "lambda",
    Static: "static",
    External: "external",
    Firewall: "firewall",
    Redirect: "redirect",
};
export const GetDrainFilterDrainsEnvironments = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainFilterV2DrainsResponseVersion = {
    V1: "v1",
};
export const GetDrainProjectAccessDrainsAccess = {
    Some: "some",
};
export const GetDrainProjectAccessAccess = {
    All: "all",
};
export const GetDrainDeliveryDrainsResponse200Type = {
    Internal: "internal",
};
export const GetDrainDeliveryTarget = {
    VercelOtelTracesDb: "vercel-otel-traces-db",
};
export const GetDrainDeliveryDrainsResponseType = {
    Clickhouse: "clickhouse",
};
export const GetDrainDeliveryDrainsType = {
    Otlphttp: "otlphttp",
};
export const GetDrainDeliveryDrainsEncoding = {
    Json: "json",
    Proto: "proto",
};
export const GetDrainSecretDrainsKind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainDeliveryType = {
    Http: "http",
};
export const GetDrainDeliveryEncoding = {
    Json: "json",
    Ndjson: "ndjson",
};
export const GetDrainDeliveryCompression = {
    Gzip: "gzip",
    None: "none",
};
export const GetDrainSecretKind = {
    IntegrationSecret: "INTEGRATION_SECRET",
};
export const GetDrainResponseBodyType = {
    HeadSampling: "head_sampling",
};
export const GetDrainResponseBodyEnv = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainResponseBodyStatus = {
    Enabled: "enabled",
    Disabled: "disabled",
    Errored: "errored",
};
export const GetDrainResponseBodyDisabledReason = {
    DisabledByOwner: "disabled-by-owner",
    FeatureNotAvailable: "feature-not-available",
    AccountPlanDowngrade: "account-plan-downgrade",
    DisabledByAdmin: "disabled-by-admin",
};
export const GetDrainSourceDrainsKind = {
    Integration: "integration",
};
export const GetDrainSourceKind = {
    SelfServed: "self-served",
};
export const GetDrainFilterV2DrainsVersion = {
    V2: "v2",
};
export const GetDrainFilterDrainsType = {
    Odata: "odata",
};
export const GetDrainFilterType = {
    Basic: "basic",
};
export const GetDrainFilterSources = {
    Build: "build",
    Edge: "edge",
    Lambda: "lambda",
    Static: "static",
    External: "external",
    Firewall: "firewall",
    Redirect: "redirect",
};
export const GetDrainFilterEnvironments = {
    Production: "production",
    Preview: "preview",
};
export const GetDrainFilterV2Version = {
    V1: "v1",
};
/** @internal */
export const GetDrainRequest$inboundSchema = z.object({
    id: z.string(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
/** @internal */
export const GetDrainRequest$outboundSchema = z.object({
    id: z.string(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
export function getDrainRequestToJSON(getDrainRequest) {
    return JSON.stringify(GetDrainRequest$outboundSchema.parse(getDrainRequest));
}
export function getDrainRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainRequest' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsLog$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyDrainsLog$outboundSchema = z.object({});
export function getDrainResponseBodyDrainsLogToJSON(getDrainResponseBodyDrainsLog) {
    return JSON.stringify(GetDrainResponseBodyDrainsLog$outboundSchema.parse(getDrainResponseBodyDrainsLog));
}
export function getDrainResponseBodyDrainsLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsLog' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsTrace$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyDrainsTrace$outboundSchema = z.object({});
export function getDrainResponseBodyDrainsTraceToJSON(getDrainResponseBodyDrainsTrace) {
    return JSON.stringify(GetDrainResponseBodyDrainsTrace$outboundSchema.parse(getDrainResponseBodyDrainsTrace));
}
export function getDrainResponseBodyDrainsTraceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsTrace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsTrace' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsAnalytics$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyDrainsAnalytics$outboundSchema = z.object({});
export function getDrainResponseBodyDrainsAnalyticsToJSON(getDrainResponseBodyDrainsAnalytics) {
    return JSON.stringify(GetDrainResponseBodyDrainsAnalytics$outboundSchema.parse(getDrainResponseBodyDrainsAnalytics));
}
export function getDrainResponseBodyDrainsAnalyticsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsAnalytics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsAnalytics' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsSpeedInsights$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyDrainsSpeedInsights$outboundSchema = z.object({});
export function getDrainResponseBodyDrainsSpeedInsightsToJSON(getDrainResponseBodyDrainsSpeedInsights) {
    return JSON.stringify(GetDrainResponseBodyDrainsSpeedInsights$outboundSchema.parse(getDrainResponseBodyDrainsSpeedInsights));
}
export function getDrainResponseBodyDrainsSpeedInsightsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsSpeedInsights$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsSpeedInsights' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsSchemas$inboundSchema = z.object({
    log: z.lazy(() => GetDrainResponseBodyDrainsLog$inboundSchema).optional(),
    trace: z.lazy(() => GetDrainResponseBodyDrainsTrace$inboundSchema).optional(),
    analytics: z.lazy(() => GetDrainResponseBodyDrainsAnalytics$inboundSchema)
        .optional(),
    speed_insights: z.lazy(() => GetDrainResponseBodyDrainsSpeedInsights$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "speed_insights": "speedInsights",
    });
});
/** @internal */
export const GetDrainResponseBodyDrainsSchemas$outboundSchema = z.object({
    log: z.lazy(() => GetDrainResponseBodyDrainsLog$outboundSchema).optional(),
    trace: z.lazy(() => GetDrainResponseBodyDrainsTrace$outboundSchema)
        .optional(),
    analytics: z.lazy(() => GetDrainResponseBodyDrainsAnalytics$outboundSchema)
        .optional(),
    speedInsights: z.lazy(() => GetDrainResponseBodyDrainsSpeedInsights$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        speedInsights: "speed_insights",
    });
});
export function getDrainResponseBodyDrainsSchemasToJSON(getDrainResponseBodyDrainsSchemas) {
    return JSON.stringify(GetDrainResponseBodyDrainsSchemas$outboundSchema.parse(getDrainResponseBodyDrainsSchemas));
}
export function getDrainResponseBodyDrainsSchemasFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsSchemas' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type);
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type$outboundSchema = GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type$inboundSchema;
/** @internal */
export const GetDrainDeliveryDrainsTarget$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsTarget);
/** @internal */
export const GetDrainDeliveryDrainsTarget$outboundSchema = GetDrainDeliveryDrainsTarget$inboundSchema;
/** @internal */
export const GetDrainDeliveryDrains4$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type$inboundSchema,
    target: GetDrainDeliveryDrainsTarget$inboundSchema,
});
/** @internal */
export const GetDrainDeliveryDrains4$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody24Type$outboundSchema,
    target: GetDrainDeliveryDrainsTarget$outboundSchema,
});
export function getDrainDeliveryDrains4ToJSON(getDrainDeliveryDrains4) {
    return JSON.stringify(GetDrainDeliveryDrains4$outboundSchema.parse(getDrainDeliveryDrains4));
}
export function getDrainDeliveryDrains4FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrains4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrains4' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type);
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type$outboundSchema = GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type$inboundSchema;
/** @internal */
export const GetDrainDeliveryDrains3$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type$inboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
/** @internal */
export const GetDrainDeliveryDrains3$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBody2Type$outboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
export function getDrainDeliveryDrains3ToJSON(getDrainDeliveryDrains3) {
    return JSON.stringify(GetDrainDeliveryDrains3$outboundSchema.parse(getDrainDeliveryDrains3));
}
export function getDrainDeliveryDrains3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrains3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrains3' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType);
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType$outboundSchema = GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType$inboundSchema;
/** @internal */
export const GetDrainDeliveryDrainsEndpoint$inboundSchema = z.object({
    traces: z.string(),
});
/** @internal */
export const GetDrainDeliveryDrainsEndpoint$outboundSchema = z.object({
    traces: z.string(),
});
export function getDrainDeliveryDrainsEndpointToJSON(getDrainDeliveryDrainsEndpoint) {
    return JSON.stringify(GetDrainDeliveryDrainsEndpoint$outboundSchema.parse(getDrainDeliveryDrainsEndpoint));
}
export function getDrainDeliveryDrainsEndpointFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrainsEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrainsEndpoint' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200Encoding$inboundSchema = z
    .nativeEnum(GetDrainDeliveryDrainsResponse200Encoding);
/** @internal */
export const GetDrainDeliveryDrainsResponse200Encoding$outboundSchema = GetDrainDeliveryDrainsResponse200Encoding$inboundSchema;
/** @internal */
export const GetDrainSecretDrainsResponse200Kind$inboundSchema = z.nativeEnum(GetDrainSecretDrainsResponse200Kind);
/** @internal */
export const GetDrainSecretDrainsResponse200Kind$outboundSchema = GetDrainSecretDrainsResponse200Kind$inboundSchema;
/** @internal */
export const GetDrainSecretDrainsResponse2002$inboundSchema = z.object({
    kind: GetDrainSecretDrainsResponse200Kind$inboundSchema,
});
/** @internal */
export const GetDrainSecretDrainsResponse2002$outboundSchema = z.object({
    kind: GetDrainSecretDrainsResponse200Kind$outboundSchema,
});
export function getDrainSecretDrainsResponse2002ToJSON(getDrainSecretDrainsResponse2002) {
    return JSON.stringify(GetDrainSecretDrainsResponse2002$outboundSchema.parse(getDrainSecretDrainsResponse2002));
}
export function getDrainSecretDrainsResponse2002FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSecretDrainsResponse2002$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSecretDrainsResponse2002' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200Secret$inboundSchema = z.union([
    z.lazy(() => GetDrainSecretDrainsResponse2002$inboundSchema),
    z.string(),
]);
/** @internal */
export const GetDrainDeliveryDrainsResponse200Secret$outboundSchema = z.union([
    z.lazy(() => GetDrainSecretDrainsResponse2002$outboundSchema),
    z.string(),
]);
export function getDrainDeliveryDrainsResponse200SecretToJSON(getDrainDeliveryDrainsResponse200Secret) {
    return JSON.stringify(GetDrainDeliveryDrainsResponse200Secret$outboundSchema.parse(getDrainDeliveryDrainsResponse200Secret));
}
export function getDrainDeliveryDrainsResponse200SecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrainsResponse200Secret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrainsResponse200Secret' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrains2$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType$inboundSchema,
    endpoint: z.lazy(() => GetDrainDeliveryDrainsEndpoint$inboundSchema),
    encoding: GetDrainDeliveryDrainsResponse200Encoding$inboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainSecretDrainsResponse2002$inboundSchema),
        z.string(),
    ]).optional(),
});
/** @internal */
export const GetDrainDeliveryDrains2$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONResponseBodyType$outboundSchema,
    endpoint: z.lazy(() => GetDrainDeliveryDrainsEndpoint$outboundSchema),
    encoding: GetDrainDeliveryDrainsResponse200Encoding$outboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainSecretDrainsResponse2002$outboundSchema),
        z.string(),
    ]).optional(),
});
export function getDrainDeliveryDrains2ToJSON(getDrainDeliveryDrains2) {
    return JSON.stringify(GetDrainDeliveryDrains2$outboundSchema.parse(getDrainDeliveryDrains2));
}
export function getDrainDeliveryDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrains2' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONType$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponse200ApplicationJSONType);
/** @internal */
export const GetDrainDeliveryDrainsResponse200ApplicationJSONType$outboundSchema = GetDrainDeliveryDrainsResponse200ApplicationJSONType$inboundSchema;
/** @internal */
export const GetDrainDeliveryDrainsResponseEncoding$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponseEncoding);
/** @internal */
export const GetDrainDeliveryDrainsResponseEncoding$outboundSchema = GetDrainDeliveryDrainsResponseEncoding$inboundSchema;
/** @internal */
export const GetDrainDeliveryDrainsCompression$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsCompression);
/** @internal */
export const GetDrainDeliveryDrainsCompression$outboundSchema = GetDrainDeliveryDrainsCompression$inboundSchema;
/** @internal */
export const GetDrainSecretDrainsResponseKind$inboundSchema = z.nativeEnum(GetDrainSecretDrainsResponseKind);
/** @internal */
export const GetDrainSecretDrainsResponseKind$outboundSchema = GetDrainSecretDrainsResponseKind$inboundSchema;
/** @internal */
export const GetDrainSecretDrainsResponse2$inboundSchema = z.object({
    kind: GetDrainSecretDrainsResponseKind$inboundSchema,
});
/** @internal */
export const GetDrainSecretDrainsResponse2$outboundSchema = z.object({
    kind: GetDrainSecretDrainsResponseKind$outboundSchema,
});
export function getDrainSecretDrainsResponse2ToJSON(getDrainSecretDrainsResponse2) {
    return JSON.stringify(GetDrainSecretDrainsResponse2$outboundSchema.parse(getDrainSecretDrainsResponse2));
}
export function getDrainSecretDrainsResponse2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSecretDrainsResponse2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSecretDrainsResponse2' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponseSecret$inboundSchema = z.union([
    z.lazy(() => GetDrainSecretDrainsResponse2$inboundSchema),
    z.string(),
]);
/** @internal */
export const GetDrainDeliveryDrainsResponseSecret$outboundSchema = z.union([
    z.lazy(() => GetDrainSecretDrainsResponse2$outboundSchema),
    z.string(),
]);
export function getDrainDeliveryDrainsResponseSecretToJSON(getDrainDeliveryDrainsResponseSecret) {
    return JSON.stringify(GetDrainDeliveryDrainsResponseSecret$outboundSchema.parse(getDrainDeliveryDrainsResponseSecret));
}
export function getDrainDeliveryDrainsResponseSecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrainsResponseSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrainsResponseSecret' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrains1$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONType$inboundSchema,
    endpoint: z.string(),
    encoding: GetDrainDeliveryDrainsResponseEncoding$inboundSchema,
    compression: GetDrainDeliveryDrainsCompression$inboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainSecretDrainsResponse2$inboundSchema),
        z.string(),
    ]).optional(),
});
/** @internal */
export const GetDrainDeliveryDrains1$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200ApplicationJSONType$outboundSchema,
    endpoint: z.string(),
    encoding: GetDrainDeliveryDrainsResponseEncoding$outboundSchema,
    compression: GetDrainDeliveryDrainsCompression$outboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainSecretDrainsResponse2$outboundSchema),
        z.string(),
    ]).optional(),
});
export function getDrainDeliveryDrains1ToJSON(getDrainDeliveryDrains1) {
    return JSON.stringify(GetDrainDeliveryDrains1$outboundSchema.parse(getDrainDeliveryDrains1));
}
export function getDrainDeliveryDrains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrains1' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsDelivery$inboundSchema = z.union([
    z.lazy(() => GetDrainDeliveryDrains1$inboundSchema),
    z.lazy(() => GetDrainDeliveryDrains2$inboundSchema),
    z.lazy(() => GetDrainDeliveryDrains3$inboundSchema),
    z.lazy(() => GetDrainDeliveryDrains4$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBodyDrainsDelivery$outboundSchema = z.union([
    z.lazy(() => GetDrainDeliveryDrains1$outboundSchema),
    z.lazy(() => GetDrainDeliveryDrains2$outboundSchema),
    z.lazy(() => GetDrainDeliveryDrains3$outboundSchema),
    z.lazy(() => GetDrainDeliveryDrains4$outboundSchema),
]);
export function getDrainResponseBodyDrainsDeliveryToJSON(getDrainResponseBodyDrainsDelivery) {
    return JSON.stringify(GetDrainResponseBodyDrainsDelivery$outboundSchema.parse(getDrainResponseBodyDrainsDelivery));
}
export function getDrainResponseBodyDrainsDeliveryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsDelivery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsDelivery' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsType$inboundSchema = z.nativeEnum(GetDrainResponseBodyDrainsType);
/** @internal */
export const GetDrainResponseBodyDrainsType$outboundSchema = GetDrainResponseBodyDrainsType$inboundSchema;
/** @internal */
export const GetDrainResponseBodyDrainsEnv$inboundSchema = z.nativeEnum(GetDrainResponseBodyDrainsEnv);
/** @internal */
export const GetDrainResponseBodyDrainsEnv$outboundSchema = GetDrainResponseBodyDrainsEnv$inboundSchema;
/** @internal */
export const GetDrainResponseBodyDrainsSampling$inboundSchema = z.object({
    type: GetDrainResponseBodyDrainsType$inboundSchema,
    rate: z.number(),
    env: GetDrainResponseBodyDrainsEnv$inboundSchema.optional(),
    requestPath: z.string().optional(),
});
/** @internal */
export const GetDrainResponseBodyDrainsSampling$outboundSchema = z.object({
    type: GetDrainResponseBodyDrainsType$outboundSchema,
    rate: z.number(),
    env: GetDrainResponseBodyDrainsEnv$outboundSchema.optional(),
    requestPath: z.string().optional(),
});
export function getDrainResponseBodyDrainsSamplingToJSON(getDrainResponseBodyDrainsSampling) {
    return JSON.stringify(GetDrainResponseBodyDrainsSampling$outboundSchema.parse(getDrainResponseBodyDrainsSampling));
}
export function getDrainResponseBodyDrainsSamplingFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsSampling$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsSampling' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsStatus$inboundSchema = z.nativeEnum(GetDrainResponseBodyDrainsStatus);
/** @internal */
export const GetDrainResponseBodyDrainsStatus$outboundSchema = GetDrainResponseBodyDrainsStatus$inboundSchema;
/** @internal */
export const GetDrainResponseBodyDrainsDisabledReason$inboundSchema = z
    .nativeEnum(GetDrainResponseBodyDrainsDisabledReason);
/** @internal */
export const GetDrainResponseBodyDrainsDisabledReason$outboundSchema = GetDrainResponseBodyDrainsDisabledReason$inboundSchema;
/** @internal */
export const GetDrainSourceDrainsResponse200Kind$inboundSchema = z.nativeEnum(GetDrainSourceDrainsResponse200Kind);
/** @internal */
export const GetDrainSourceDrainsResponse200Kind$outboundSchema = GetDrainSourceDrainsResponse200Kind$inboundSchema;
/** @internal */
export const GetDrainSourceDrains2$inboundSchema = z.object({
    kind: GetDrainSourceDrainsResponse200Kind$inboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
/** @internal */
export const GetDrainSourceDrains2$outboundSchema = z.object({
    kind: GetDrainSourceDrainsResponse200Kind$outboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
export function getDrainSourceDrains2ToJSON(getDrainSourceDrains2) {
    return JSON.stringify(GetDrainSourceDrains2$outboundSchema.parse(getDrainSourceDrains2));
}
export function getDrainSourceDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSourceDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSourceDrains2' from JSON`);
}
/** @internal */
export const GetDrainSourceDrainsResponseKind$inboundSchema = z.nativeEnum(GetDrainSourceDrainsResponseKind);
/** @internal */
export const GetDrainSourceDrainsResponseKind$outboundSchema = GetDrainSourceDrainsResponseKind$inboundSchema;
/** @internal */
export const GetDrainSourceDrains1$inboundSchema = z.object({
    kind: GetDrainSourceDrainsResponseKind$inboundSchema,
});
/** @internal */
export const GetDrainSourceDrains1$outboundSchema = z.object({
    kind: GetDrainSourceDrainsResponseKind$outboundSchema,
});
export function getDrainSourceDrains1ToJSON(getDrainSourceDrains1) {
    return JSON.stringify(GetDrainSourceDrains1$outboundSchema.parse(getDrainSourceDrains1));
}
export function getDrainSourceDrains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSourceDrains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSourceDrains1' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsSource$inboundSchema = z.union([
    z.lazy(() => GetDrainSourceDrains2$inboundSchema),
    z.lazy(() => GetDrainSourceDrains1$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBodyDrainsSource$outboundSchema = z.union([
    z.lazy(() => GetDrainSourceDrains2$outboundSchema),
    z.lazy(() => GetDrainSourceDrains1$outboundSchema),
]);
export function getDrainResponseBodyDrainsSourceToJSON(getDrainResponseBodyDrainsSource) {
    return JSON.stringify(GetDrainResponseBodyDrainsSource$outboundSchema.parse(getDrainResponseBodyDrainsSource));
}
export function getDrainResponseBodyDrainsSourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsSource' from JSON`);
}
/** @internal */
export const GetDrainFilterV2DrainsResponse200Version$inboundSchema = z
    .nativeEnum(GetDrainFilterV2DrainsResponse200Version);
/** @internal */
export const GetDrainFilterV2DrainsResponse200Version$outboundSchema = GetDrainFilterV2DrainsResponse200Version$inboundSchema;
/** @internal */
export const GetDrainFilterDrainsResponse200Type$inboundSchema = z.nativeEnum(GetDrainFilterDrainsResponse200Type);
/** @internal */
export const GetDrainFilterDrainsResponse200Type$outboundSchema = GetDrainFilterDrainsResponse200Type$inboundSchema;
/** @internal */
export const GetDrainFilterDrains2$inboundSchema = z.object({
    type: GetDrainFilterDrainsResponse200Type$inboundSchema,
    text: z.string(),
});
/** @internal */
export const GetDrainFilterDrains2$outboundSchema = z.object({
    type: GetDrainFilterDrainsResponse200Type$outboundSchema,
    text: z.string(),
});
export function getDrainFilterDrains2ToJSON(getDrainFilterDrains2) {
    return JSON.stringify(GetDrainFilterDrains2$outboundSchema.parse(getDrainFilterDrains2));
}
export function getDrainFilterDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterDrains2' from JSON`);
}
/** @internal */
export const GetDrainFilterDrainsResponseType$inboundSchema = z.nativeEnum(GetDrainFilterDrainsResponseType);
/** @internal */
export const GetDrainFilterDrainsResponseType$outboundSchema = GetDrainFilterDrainsResponseType$inboundSchema;
/** @internal */
export const GetDrainFilterDrainsProject$inboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
/** @internal */
export const GetDrainFilterDrainsProject$outboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
export function getDrainFilterDrainsProjectToJSON(getDrainFilterDrainsProject) {
    return JSON.stringify(GetDrainFilterDrainsProject$outboundSchema.parse(getDrainFilterDrainsProject));
}
export function getDrainFilterDrainsProjectFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterDrainsProject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterDrainsProject' from JSON`);
}
/** @internal */
export const GetDrainFilterDrainsSources$inboundSchema = z.nativeEnum(GetDrainFilterDrainsSources);
/** @internal */
export const GetDrainFilterDrainsSources$outboundSchema = GetDrainFilterDrainsSources$inboundSchema;
/** @internal */
export const GetDrainFilterDrainsLog$inboundSchema = z.object({
    sources: z.array(GetDrainFilterDrainsSources$inboundSchema).optional(),
    legacy_excludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        "legacy_excludeCachedStaticAssetLogs": "legacyExcludeCachedStaticAssetLogs",
    });
});
/** @internal */
export const GetDrainFilterDrainsLog$outboundSchema = z.object({
    sources: z.array(GetDrainFilterDrainsSources$outboundSchema).optional(),
    legacyExcludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        legacyExcludeCachedStaticAssetLogs: "legacy_excludeCachedStaticAssetLogs",
    });
});
export function getDrainFilterDrainsLogToJSON(getDrainFilterDrainsLog) {
    return JSON.stringify(GetDrainFilterDrainsLog$outboundSchema.parse(getDrainFilterDrainsLog));
}
export function getDrainFilterDrainsLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterDrainsLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterDrainsLog' from JSON`);
}
/** @internal */
export const GetDrainFilterDrainsEnvironments$inboundSchema = z.nativeEnum(GetDrainFilterDrainsEnvironments);
/** @internal */
export const GetDrainFilterDrainsEnvironments$outboundSchema = GetDrainFilterDrainsEnvironments$inboundSchema;
/** @internal */
export const GetDrainFilterDrainsDeployment$inboundSchema = z.object({
    environments: z.array(GetDrainFilterDrainsEnvironments$inboundSchema)
        .optional(),
});
/** @internal */
export const GetDrainFilterDrainsDeployment$outboundSchema = z.object({
    environments: z.array(GetDrainFilterDrainsEnvironments$outboundSchema)
        .optional(),
});
export function getDrainFilterDrainsDeploymentToJSON(getDrainFilterDrainsDeployment) {
    return JSON.stringify(GetDrainFilterDrainsDeployment$outboundSchema.parse(getDrainFilterDrainsDeployment));
}
export function getDrainFilterDrainsDeploymentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterDrainsDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterDrainsDeployment' from JSON`);
}
/** @internal */
export const GetDrainFilterDrains1$inboundSchema = z.object({
    type: GetDrainFilterDrainsResponseType$inboundSchema,
    project: z.lazy(() => GetDrainFilterDrainsProject$inboundSchema).optional(),
    log: z.lazy(() => GetDrainFilterDrainsLog$inboundSchema).optional(),
    deployment: z.lazy(() => GetDrainFilterDrainsDeployment$inboundSchema)
        .optional(),
});
/** @internal */
export const GetDrainFilterDrains1$outboundSchema = z.object({
    type: GetDrainFilterDrainsResponseType$outboundSchema,
    project: z.lazy(() => GetDrainFilterDrainsProject$outboundSchema).optional(),
    log: z.lazy(() => GetDrainFilterDrainsLog$outboundSchema).optional(),
    deployment: z.lazy(() => GetDrainFilterDrainsDeployment$outboundSchema)
        .optional(),
});
export function getDrainFilterDrains1ToJSON(getDrainFilterDrains1) {
    return JSON.stringify(GetDrainFilterDrains1$outboundSchema.parse(getDrainFilterDrains1));
}
export function getDrainFilterDrains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterDrains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterDrains1' from JSON`);
}
/** @internal */
export const GetDrainFilterV2DrainsFilter$inboundSchema = z.union([
    z.lazy(() => GetDrainFilterDrains2$inboundSchema),
    z.lazy(() => GetDrainFilterDrains1$inboundSchema),
]);
/** @internal */
export const GetDrainFilterV2DrainsFilter$outboundSchema = z.union([
    z.lazy(() => GetDrainFilterDrains2$outboundSchema),
    z.lazy(() => GetDrainFilterDrains1$outboundSchema),
]);
export function getDrainFilterV2DrainsFilterToJSON(getDrainFilterV2DrainsFilter) {
    return JSON.stringify(GetDrainFilterV2DrainsFilter$outboundSchema.parse(getDrainFilterV2DrainsFilter));
}
export function getDrainFilterV2DrainsFilterFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterV2DrainsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterV2DrainsFilter' from JSON`);
}
/** @internal */
export const GetDrainFilterV2Drains2$inboundSchema = z.object({
    version: GetDrainFilterV2DrainsResponse200Version$inboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainFilterDrains2$inboundSchema),
        z.lazy(() => GetDrainFilterDrains1$inboundSchema),
    ]),
});
/** @internal */
export const GetDrainFilterV2Drains2$outboundSchema = z.object({
    version: GetDrainFilterV2DrainsResponse200Version$outboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainFilterDrains2$outboundSchema),
        z.lazy(() => GetDrainFilterDrains1$outboundSchema),
    ]),
});
export function getDrainFilterV2Drains2ToJSON(getDrainFilterV2Drains2) {
    return JSON.stringify(GetDrainFilterV2Drains2$outboundSchema.parse(getDrainFilterV2Drains2));
}
export function getDrainFilterV2Drains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterV2Drains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterV2Drains2' from JSON`);
}
/** @internal */
export const GetDrainFilterV2DrainsResponseVersion$inboundSchema = z.nativeEnum(GetDrainFilterV2DrainsResponseVersion);
/** @internal */
export const GetDrainFilterV2DrainsResponseVersion$outboundSchema = GetDrainFilterV2DrainsResponseVersion$inboundSchema;
/** @internal */
export const GetDrainFilterV2Drains1$inboundSchema = z.object({
    version: GetDrainFilterV2DrainsResponseVersion$inboundSchema,
});
/** @internal */
export const GetDrainFilterV2Drains1$outboundSchema = z.object({
    version: GetDrainFilterV2DrainsResponseVersion$outboundSchema,
});
export function getDrainFilterV2Drains1ToJSON(getDrainFilterV2Drains1) {
    return JSON.stringify(GetDrainFilterV2Drains1$outboundSchema.parse(getDrainFilterV2Drains1));
}
export function getDrainFilterV2Drains1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterV2Drains1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterV2Drains1' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDrainsFilterV2$inboundSchema = z.union([
    z.lazy(() => GetDrainFilterV2Drains2$inboundSchema),
    z.lazy(() => GetDrainFilterV2Drains1$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBodyDrainsFilterV2$outboundSchema = z.union([
    z.lazy(() => GetDrainFilterV2Drains2$outboundSchema),
    z.lazy(() => GetDrainFilterV2Drains1$outboundSchema),
]);
export function getDrainResponseBodyDrainsFilterV2ToJSON(getDrainResponseBodyDrainsFilterV2) {
    return JSON.stringify(GetDrainResponseBodyDrainsFilterV2$outboundSchema.parse(getDrainResponseBodyDrainsFilterV2));
}
export function getDrainResponseBodyDrainsFilterV2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDrainsFilterV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDrainsFilterV2' from JSON`);
}
/** @internal */
export const GetDrainProjectAccessDrainsAccess$inboundSchema = z.nativeEnum(GetDrainProjectAccessDrainsAccess);
/** @internal */
export const GetDrainProjectAccessDrainsAccess$outboundSchema = GetDrainProjectAccessDrainsAccess$inboundSchema;
/** @internal */
export const GetDrainProjectAccess2$inboundSchema = z.object({
    access: GetDrainProjectAccessDrainsAccess$inboundSchema,
    projectIds: z.array(z.string()),
});
/** @internal */
export const GetDrainProjectAccess2$outboundSchema = z.object({
    access: GetDrainProjectAccessDrainsAccess$outboundSchema,
    projectIds: z.array(z.string()),
});
export function getDrainProjectAccess2ToJSON(getDrainProjectAccess2) {
    return JSON.stringify(GetDrainProjectAccess2$outboundSchema.parse(getDrainProjectAccess2));
}
export function getDrainProjectAccess2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainProjectAccess2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainProjectAccess2' from JSON`);
}
/** @internal */
export const GetDrainProjectAccessAccess$inboundSchema = z.nativeEnum(GetDrainProjectAccessAccess);
/** @internal */
export const GetDrainProjectAccessAccess$outboundSchema = GetDrainProjectAccessAccess$inboundSchema;
/** @internal */
export const GetDrainProjectAccess1$inboundSchema = z.object({
    access: GetDrainProjectAccessAccess$inboundSchema,
});
/** @internal */
export const GetDrainProjectAccess1$outboundSchema = z.object({
    access: GetDrainProjectAccessAccess$outboundSchema,
});
export function getDrainProjectAccess1ToJSON(getDrainProjectAccess1) {
    return JSON.stringify(GetDrainProjectAccess1$outboundSchema.parse(getDrainProjectAccess1));
}
export function getDrainProjectAccess1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainProjectAccess1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainProjectAccess1' from JSON`);
}
/** @internal */
export const ResponseBodyProjectAccess$inboundSchema = z.union([
    z.lazy(() => GetDrainProjectAccess2$inboundSchema),
    z.lazy(() => GetDrainProjectAccess1$inboundSchema),
]);
/** @internal */
export const ResponseBodyProjectAccess$outboundSchema = z.union([
    z.lazy(() => GetDrainProjectAccess2$outboundSchema),
    z.lazy(() => GetDrainProjectAccess1$outboundSchema),
]);
export function responseBodyProjectAccessToJSON(responseBodyProjectAccess) {
    return JSON.stringify(ResponseBodyProjectAccess$outboundSchema.parse(responseBodyProjectAccess));
}
export function responseBodyProjectAccessFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResponseBodyProjectAccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyProjectAccess' from JSON`);
}
/** @internal */
export const GetDrainResponseBody2$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(() => GetDrainResponseBodyDrainsSchemas$inboundSchema)
        .optional(),
    delivery: z.union([
        z.lazy(() => GetDrainDeliveryDrains1$inboundSchema),
        z.lazy(() => GetDrainDeliveryDrains2$inboundSchema),
        z.lazy(() => GetDrainDeliveryDrains3$inboundSchema),
        z.lazy(() => GetDrainDeliveryDrains4$inboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => GetDrainResponseBodyDrainsSampling$inboundSchema)).optional(),
    teamId: z.nullable(z.string()).optional(),
    status: GetDrainResponseBodyDrainsStatus$inboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: GetDrainResponseBodyDrainsDisabledReason$inboundSchema
        .optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainSourceDrains2$inboundSchema),
        z.lazy(() => GetDrainSourceDrains1$inboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainFilterV2Drains2$inboundSchema),
        z.lazy(() => GetDrainFilterV2Drains1$inboundSchema),
    ]).optional(),
    integrationIcon: z.string().optional(),
    integrationConfigurationUri: z.string().optional(),
    integrationWebsite: z.string().optional(),
    projectAccess: z.union([
        z.lazy(() => GetDrainProjectAccess2$inboundSchema),
        z.lazy(() => GetDrainProjectAccess1$inboundSchema),
    ]).optional(),
});
/** @internal */
export const GetDrainResponseBody2$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(() => GetDrainResponseBodyDrainsSchemas$outboundSchema)
        .optional(),
    delivery: z.union([
        z.lazy(() => GetDrainDeliveryDrains1$outboundSchema),
        z.lazy(() => GetDrainDeliveryDrains2$outboundSchema),
        z.lazy(() => GetDrainDeliveryDrains3$outboundSchema),
        z.lazy(() => GetDrainDeliveryDrains4$outboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => GetDrainResponseBodyDrainsSampling$outboundSchema)).optional(),
    teamId: z.nullable(z.string()).optional(),
    status: GetDrainResponseBodyDrainsStatus$outboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: GetDrainResponseBodyDrainsDisabledReason$outboundSchema
        .optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainSourceDrains2$outboundSchema),
        z.lazy(() => GetDrainSourceDrains1$outboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainFilterV2Drains2$outboundSchema),
        z.lazy(() => GetDrainFilterV2Drains1$outboundSchema),
    ]).optional(),
    integrationIcon: z.string().optional(),
    integrationConfigurationUri: z.string().optional(),
    integrationWebsite: z.string().optional(),
    projectAccess: z.union([
        z.lazy(() => GetDrainProjectAccess2$outboundSchema),
        z.lazy(() => GetDrainProjectAccess1$outboundSchema),
    ]).optional(),
});
export function getDrainResponseBody2ToJSON(getDrainResponseBody2) {
    return JSON.stringify(GetDrainResponseBody2$outboundSchema.parse(getDrainResponseBody2));
}
export function getDrainResponseBody2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBody2' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyLog$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyLog$outboundSchema = z.object({});
export function getDrainResponseBodyLogToJSON(getDrainResponseBodyLog) {
    return JSON.stringify(GetDrainResponseBodyLog$outboundSchema.parse(getDrainResponseBodyLog));
}
export function getDrainResponseBodyLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyLog' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyTrace$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyTrace$outboundSchema = z.object({});
export function getDrainResponseBodyTraceToJSON(getDrainResponseBodyTrace) {
    return JSON.stringify(GetDrainResponseBodyTrace$outboundSchema.parse(getDrainResponseBodyTrace));
}
export function getDrainResponseBodyTraceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyTrace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyTrace' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyAnalytics$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodyAnalytics$outboundSchema = z.object({});
export function getDrainResponseBodyAnalyticsToJSON(getDrainResponseBodyAnalytics) {
    return JSON.stringify(GetDrainResponseBodyAnalytics$outboundSchema.parse(getDrainResponseBodyAnalytics));
}
export function getDrainResponseBodyAnalyticsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyAnalytics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyAnalytics' from JSON`);
}
/** @internal */
export const GetDrainResponseBodySpeedInsights$inboundSchema = z.object({});
/** @internal */
export const GetDrainResponseBodySpeedInsights$outboundSchema = z.object({});
export function getDrainResponseBodySpeedInsightsToJSON(getDrainResponseBodySpeedInsights) {
    return JSON.stringify(GetDrainResponseBodySpeedInsights$outboundSchema.parse(getDrainResponseBodySpeedInsights));
}
export function getDrainResponseBodySpeedInsightsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodySpeedInsights$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodySpeedInsights' from JSON`);
}
/** @internal */
export const GetDrainResponseBodySchemas$inboundSchema = z.object({
    log: z.lazy(() => GetDrainResponseBodyLog$inboundSchema).optional(),
    trace: z.lazy(() => GetDrainResponseBodyTrace$inboundSchema).optional(),
    analytics: z.lazy(() => GetDrainResponseBodyAnalytics$inboundSchema)
        .optional(),
    speed_insights: z.lazy(() => GetDrainResponseBodySpeedInsights$inboundSchema)
        .optional(),
}).transform((v) => {
    return remap$(v, {
        "speed_insights": "speedInsights",
    });
});
/** @internal */
export const GetDrainResponseBodySchemas$outboundSchema = z.object({
    log: z.lazy(() => GetDrainResponseBodyLog$outboundSchema).optional(),
    trace: z.lazy(() => GetDrainResponseBodyTrace$outboundSchema).optional(),
    analytics: z.lazy(() => GetDrainResponseBodyAnalytics$outboundSchema)
        .optional(),
    speedInsights: z.lazy(() => GetDrainResponseBodySpeedInsights$outboundSchema)
        .optional(),
}).transform((v) => {
    return remap$(v, {
        speedInsights: "speed_insights",
    });
});
export function getDrainResponseBodySchemasToJSON(getDrainResponseBodySchemas) {
    return JSON.stringify(GetDrainResponseBodySchemas$outboundSchema.parse(getDrainResponseBodySchemas));
}
export function getDrainResponseBodySchemasFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodySchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodySchemas' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponse200Type$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponse200Type);
/** @internal */
export const GetDrainDeliveryDrainsResponse200Type$outboundSchema = GetDrainDeliveryDrainsResponse200Type$inboundSchema;
/** @internal */
export const GetDrainDeliveryTarget$inboundSchema = z.nativeEnum(GetDrainDeliveryTarget);
/** @internal */
export const GetDrainDeliveryTarget$outboundSchema = GetDrainDeliveryTarget$inboundSchema;
/** @internal */
export const GetDrainDelivery4$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200Type$inboundSchema,
    target: GetDrainDeliveryTarget$inboundSchema,
});
/** @internal */
export const GetDrainDelivery4$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponse200Type$outboundSchema,
    target: GetDrainDeliveryTarget$outboundSchema,
});
export function getDrainDelivery4ToJSON(getDrainDelivery4) {
    return JSON.stringify(GetDrainDelivery4$outboundSchema.parse(getDrainDelivery4));
}
export function getDrainDelivery4FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDelivery4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDelivery4' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsResponseType$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsResponseType);
/** @internal */
export const GetDrainDeliveryDrainsResponseType$outboundSchema = GetDrainDeliveryDrainsResponseType$inboundSchema;
/** @internal */
export const GetDrainDelivery3$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponseType$inboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
/** @internal */
export const GetDrainDelivery3$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsResponseType$outboundSchema,
    endpoint: z.string(),
    table: z.string(),
});
export function getDrainDelivery3ToJSON(getDrainDelivery3) {
    return JSON.stringify(GetDrainDelivery3$outboundSchema.parse(getDrainDelivery3));
}
export function getDrainDelivery3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDelivery3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDelivery3' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsType$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsType);
/** @internal */
export const GetDrainDeliveryDrainsType$outboundSchema = GetDrainDeliveryDrainsType$inboundSchema;
/** @internal */
export const GetDrainDeliveryEndpoint$inboundSchema = z.object({
    traces: z.string(),
});
/** @internal */
export const GetDrainDeliveryEndpoint$outboundSchema = z.object({
    traces: z.string(),
});
export function getDrainDeliveryEndpointToJSON(getDrainDeliveryEndpoint) {
    return JSON.stringify(GetDrainDeliveryEndpoint$outboundSchema.parse(getDrainDeliveryEndpoint));
}
export function getDrainDeliveryEndpointFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryEndpoint' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsEncoding$inboundSchema = z.nativeEnum(GetDrainDeliveryDrainsEncoding);
/** @internal */
export const GetDrainDeliveryDrainsEncoding$outboundSchema = GetDrainDeliveryDrainsEncoding$inboundSchema;
/** @internal */
export const GetDrainSecretDrainsKind$inboundSchema = z.nativeEnum(GetDrainSecretDrainsKind);
/** @internal */
export const GetDrainSecretDrainsKind$outboundSchema = GetDrainSecretDrainsKind$inboundSchema;
/** @internal */
export const GetDrainSecretDrains2$inboundSchema = z.object({
    kind: GetDrainSecretDrainsKind$inboundSchema,
});
/** @internal */
export const GetDrainSecretDrains2$outboundSchema = z.object({
    kind: GetDrainSecretDrainsKind$outboundSchema,
});
export function getDrainSecretDrains2ToJSON(getDrainSecretDrains2) {
    return JSON.stringify(GetDrainSecretDrains2$outboundSchema.parse(getDrainSecretDrains2));
}
export function getDrainSecretDrains2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSecretDrains2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSecretDrains2' from JSON`);
}
/** @internal */
export const GetDrainDeliveryDrainsSecret$inboundSchema = z.union([z.lazy(() => GetDrainSecretDrains2$inboundSchema), z.string()]);
/** @internal */
export const GetDrainDeliveryDrainsSecret$outboundSchema = z.union([z.lazy(() => GetDrainSecretDrains2$outboundSchema), z.string()]);
export function getDrainDeliveryDrainsSecretToJSON(getDrainDeliveryDrainsSecret) {
    return JSON.stringify(GetDrainDeliveryDrainsSecret$outboundSchema.parse(getDrainDeliveryDrainsSecret));
}
export function getDrainDeliveryDrainsSecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliveryDrainsSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliveryDrainsSecret' from JSON`);
}
/** @internal */
export const GetDrainDelivery2$inboundSchema = z.object({
    type: GetDrainDeliveryDrainsType$inboundSchema,
    endpoint: z.lazy(() => GetDrainDeliveryEndpoint$inboundSchema),
    encoding: GetDrainDeliveryDrainsEncoding$inboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainSecretDrains2$inboundSchema),
        z.string(),
    ]).optional(),
});
/** @internal */
export const GetDrainDelivery2$outboundSchema = z.object({
    type: GetDrainDeliveryDrainsType$outboundSchema,
    endpoint: z.lazy(() => GetDrainDeliveryEndpoint$outboundSchema),
    encoding: GetDrainDeliveryDrainsEncoding$outboundSchema,
    headers: z.record(z.string()),
    secret: z.union([
        z.lazy(() => GetDrainSecretDrains2$outboundSchema),
        z.string(),
    ]).optional(),
});
export function getDrainDelivery2ToJSON(getDrainDelivery2) {
    return JSON.stringify(GetDrainDelivery2$outboundSchema.parse(getDrainDelivery2));
}
export function getDrainDelivery2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDelivery2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDelivery2' from JSON`);
}
/** @internal */
export const GetDrainDeliveryType$inboundSchema = z.nativeEnum(GetDrainDeliveryType);
/** @internal */
export const GetDrainDeliveryType$outboundSchema = GetDrainDeliveryType$inboundSchema;
/** @internal */
export const GetDrainDeliveryEncoding$inboundSchema = z.nativeEnum(GetDrainDeliveryEncoding);
/** @internal */
export const GetDrainDeliveryEncoding$outboundSchema = GetDrainDeliveryEncoding$inboundSchema;
/** @internal */
export const GetDrainDeliveryCompression$inboundSchema = z.nativeEnum(GetDrainDeliveryCompression);
/** @internal */
export const GetDrainDeliveryCompression$outboundSchema = GetDrainDeliveryCompression$inboundSchema;
/** @internal */
export const GetDrainSecretKind$inboundSchema = z.nativeEnum(GetDrainSecretKind);
/** @internal */
export const GetDrainSecretKind$outboundSchema = GetDrainSecretKind$inboundSchema;
/** @internal */
export const GetDrainSecret2$inboundSchema = z.object({
    kind: GetDrainSecretKind$inboundSchema,
});
/** @internal */
export const GetDrainSecret2$outboundSchema = z.object({
    kind: GetDrainSecretKind$outboundSchema,
});
export function getDrainSecret2ToJSON(getDrainSecret2) {
    return JSON.stringify(GetDrainSecret2$outboundSchema.parse(getDrainSecret2));
}
export function getDrainSecret2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSecret2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSecret2' from JSON`);
}
/** @internal */
export const GetDrainDeliverySecret$inboundSchema = z.union([z.lazy(() => GetDrainSecret2$inboundSchema), z.string()]);
/** @internal */
export const GetDrainDeliverySecret$outboundSchema = z.union([z.lazy(() => GetDrainSecret2$outboundSchema), z.string()]);
export function getDrainDeliverySecretToJSON(getDrainDeliverySecret) {
    return JSON.stringify(GetDrainDeliverySecret$outboundSchema.parse(getDrainDeliverySecret));
}
export function getDrainDeliverySecretFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDeliverySecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDeliverySecret' from JSON`);
}
/** @internal */
export const GetDrainDelivery1$inboundSchema = z.object({
    type: GetDrainDeliveryType$inboundSchema,
    endpoint: z.string(),
    encoding: GetDrainDeliveryEncoding$inboundSchema,
    compression: GetDrainDeliveryCompression$inboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([z.lazy(() => GetDrainSecret2$inboundSchema), z.string()])
        .optional(),
});
/** @internal */
export const GetDrainDelivery1$outboundSchema = z.object({
    type: GetDrainDeliveryType$outboundSchema,
    endpoint: z.string(),
    encoding: GetDrainDeliveryEncoding$outboundSchema,
    compression: GetDrainDeliveryCompression$outboundSchema.optional(),
    headers: z.record(z.string()),
    secret: z.union([z.lazy(() => GetDrainSecret2$outboundSchema), z.string()])
        .optional(),
});
export function getDrainDelivery1ToJSON(getDrainDelivery1) {
    return JSON.stringify(GetDrainDelivery1$outboundSchema.parse(getDrainDelivery1));
}
export function getDrainDelivery1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainDelivery1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainDelivery1' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyDelivery$inboundSchema = z.union([
    z.lazy(() => GetDrainDelivery1$inboundSchema),
    z.lazy(() => GetDrainDelivery2$inboundSchema),
    z.lazy(() => GetDrainDelivery3$inboundSchema),
    z.lazy(() => GetDrainDelivery4$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBodyDelivery$outboundSchema = z.union([
    z.lazy(() => GetDrainDelivery1$outboundSchema),
    z.lazy(() => GetDrainDelivery2$outboundSchema),
    z.lazy(() => GetDrainDelivery3$outboundSchema),
    z.lazy(() => GetDrainDelivery4$outboundSchema),
]);
export function getDrainResponseBodyDeliveryToJSON(getDrainResponseBodyDelivery) {
    return JSON.stringify(GetDrainResponseBodyDelivery$outboundSchema.parse(getDrainResponseBodyDelivery));
}
export function getDrainResponseBodyDeliveryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyDelivery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyDelivery' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyType$inboundSchema = z.nativeEnum(GetDrainResponseBodyType);
/** @internal */
export const GetDrainResponseBodyType$outboundSchema = GetDrainResponseBodyType$inboundSchema;
/** @internal */
export const GetDrainResponseBodyEnv$inboundSchema = z.nativeEnum(GetDrainResponseBodyEnv);
/** @internal */
export const GetDrainResponseBodyEnv$outboundSchema = GetDrainResponseBodyEnv$inboundSchema;
/** @internal */
export const GetDrainResponseBodySampling$inboundSchema = z.object({
    type: GetDrainResponseBodyType$inboundSchema,
    rate: z.number(),
    env: GetDrainResponseBodyEnv$inboundSchema.optional(),
    requestPath: z.string().optional(),
});
/** @internal */
export const GetDrainResponseBodySampling$outboundSchema = z.object({
    type: GetDrainResponseBodyType$outboundSchema,
    rate: z.number(),
    env: GetDrainResponseBodyEnv$outboundSchema.optional(),
    requestPath: z.string().optional(),
});
export function getDrainResponseBodySamplingToJSON(getDrainResponseBodySampling) {
    return JSON.stringify(GetDrainResponseBodySampling$outboundSchema.parse(getDrainResponseBodySampling));
}
export function getDrainResponseBodySamplingFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodySampling$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodySampling' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyStatus$inboundSchema = z.nativeEnum(GetDrainResponseBodyStatus);
/** @internal */
export const GetDrainResponseBodyStatus$outboundSchema = GetDrainResponseBodyStatus$inboundSchema;
/** @internal */
export const GetDrainResponseBodyDisabledReason$inboundSchema = z.nativeEnum(GetDrainResponseBodyDisabledReason);
/** @internal */
export const GetDrainResponseBodyDisabledReason$outboundSchema = GetDrainResponseBodyDisabledReason$inboundSchema;
/** @internal */
export const GetDrainSourceDrainsKind$inboundSchema = z.nativeEnum(GetDrainSourceDrainsKind);
/** @internal */
export const GetDrainSourceDrainsKind$outboundSchema = GetDrainSourceDrainsKind$inboundSchema;
/** @internal */
export const GetDrainSource2$inboundSchema = z.object({
    kind: GetDrainSourceDrainsKind$inboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
/** @internal */
export const GetDrainSource2$outboundSchema = z.object({
    kind: GetDrainSourceDrainsKind$outboundSchema,
    resourceId: z.string().optional(),
    externalResourceId: z.string().optional(),
    integrationId: z.string(),
    integrationConfigurationId: z.string(),
});
export function getDrainSource2ToJSON(getDrainSource2) {
    return JSON.stringify(GetDrainSource2$outboundSchema.parse(getDrainSource2));
}
export function getDrainSource2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSource2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSource2' from JSON`);
}
/** @internal */
export const GetDrainSourceKind$inboundSchema = z.nativeEnum(GetDrainSourceKind);
/** @internal */
export const GetDrainSourceKind$outboundSchema = GetDrainSourceKind$inboundSchema;
/** @internal */
export const GetDrainSource1$inboundSchema = z.object({
    kind: GetDrainSourceKind$inboundSchema,
});
/** @internal */
export const GetDrainSource1$outboundSchema = z.object({
    kind: GetDrainSourceKind$outboundSchema,
});
export function getDrainSource1ToJSON(getDrainSource1) {
    return JSON.stringify(GetDrainSource1$outboundSchema.parse(getDrainSource1));
}
export function getDrainSource1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainSource1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainSource1' from JSON`);
}
/** @internal */
export const GetDrainResponseBodySource$inboundSchema = z.union([
    z.lazy(() => GetDrainSource2$inboundSchema),
    z.lazy(() => GetDrainSource1$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBodySource$outboundSchema = z.union([
    z.lazy(() => GetDrainSource2$outboundSchema),
    z.lazy(() => GetDrainSource1$outboundSchema),
]);
export function getDrainResponseBodySourceToJSON(getDrainResponseBodySource) {
    return JSON.stringify(GetDrainResponseBodySource$outboundSchema.parse(getDrainResponseBodySource));
}
export function getDrainResponseBodySourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodySource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodySource' from JSON`);
}
/** @internal */
export const GetDrainFilterV2DrainsVersion$inboundSchema = z.nativeEnum(GetDrainFilterV2DrainsVersion);
/** @internal */
export const GetDrainFilterV2DrainsVersion$outboundSchema = GetDrainFilterV2DrainsVersion$inboundSchema;
/** @internal */
export const GetDrainFilterDrainsType$inboundSchema = z.nativeEnum(GetDrainFilterDrainsType);
/** @internal */
export const GetDrainFilterDrainsType$outboundSchema = GetDrainFilterDrainsType$inboundSchema;
/** @internal */
export const GetDrainFilter2$inboundSchema = z.object({
    type: GetDrainFilterDrainsType$inboundSchema,
    text: z.string(),
});
/** @internal */
export const GetDrainFilter2$outboundSchema = z.object({
    type: GetDrainFilterDrainsType$outboundSchema,
    text: z.string(),
});
export function getDrainFilter2ToJSON(getDrainFilter2) {
    return JSON.stringify(GetDrainFilter2$outboundSchema.parse(getDrainFilter2));
}
export function getDrainFilter2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilter2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilter2' from JSON`);
}
/** @internal */
export const GetDrainFilterType$inboundSchema = z.nativeEnum(GetDrainFilterType);
/** @internal */
export const GetDrainFilterType$outboundSchema = GetDrainFilterType$inboundSchema;
/** @internal */
export const GetDrainFilterProject$inboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
/** @internal */
export const GetDrainFilterProject$outboundSchema = z.object({
    ids: z.array(z.string()).optional(),
});
export function getDrainFilterProjectToJSON(getDrainFilterProject) {
    return JSON.stringify(GetDrainFilterProject$outboundSchema.parse(getDrainFilterProject));
}
export function getDrainFilterProjectFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterProject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterProject' from JSON`);
}
/** @internal */
export const GetDrainFilterSources$inboundSchema = z.nativeEnum(GetDrainFilterSources);
/** @internal */
export const GetDrainFilterSources$outboundSchema = GetDrainFilterSources$inboundSchema;
/** @internal */
export const GetDrainFilterLog$inboundSchema = z.object({
    sources: z.array(GetDrainFilterSources$inboundSchema).optional(),
    legacy_excludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        "legacy_excludeCachedStaticAssetLogs": "legacyExcludeCachedStaticAssetLogs",
    });
});
/** @internal */
export const GetDrainFilterLog$outboundSchema = z.object({
    sources: z.array(GetDrainFilterSources$outboundSchema).optional(),
    legacyExcludeCachedStaticAssetLogs: z.boolean().optional(),
}).transform((v) => {
    return remap$(v, {
        legacyExcludeCachedStaticAssetLogs: "legacy_excludeCachedStaticAssetLogs",
    });
});
export function getDrainFilterLogToJSON(getDrainFilterLog) {
    return JSON.stringify(GetDrainFilterLog$outboundSchema.parse(getDrainFilterLog));
}
export function getDrainFilterLogFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterLog' from JSON`);
}
/** @internal */
export const GetDrainFilterEnvironments$inboundSchema = z.nativeEnum(GetDrainFilterEnvironments);
/** @internal */
export const GetDrainFilterEnvironments$outboundSchema = GetDrainFilterEnvironments$inboundSchema;
/** @internal */
export const GetDrainFilterDeployment$inboundSchema = z.object({
    environments: z.array(GetDrainFilterEnvironments$inboundSchema).optional(),
});
/** @internal */
export const GetDrainFilterDeployment$outboundSchema = z.object({
    environments: z.array(GetDrainFilterEnvironments$outboundSchema).optional(),
});
export function getDrainFilterDeploymentToJSON(getDrainFilterDeployment) {
    return JSON.stringify(GetDrainFilterDeployment$outboundSchema.parse(getDrainFilterDeployment));
}
export function getDrainFilterDeploymentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterDeployment' from JSON`);
}
/** @internal */
export const GetDrainFilter1$inboundSchema = z.object({
    type: GetDrainFilterType$inboundSchema,
    project: z.lazy(() => GetDrainFilterProject$inboundSchema).optional(),
    log: z.lazy(() => GetDrainFilterLog$inboundSchema).optional(),
    deployment: z.lazy(() => GetDrainFilterDeployment$inboundSchema).optional(),
});
/** @internal */
export const GetDrainFilter1$outboundSchema = z.object({
    type: GetDrainFilterType$outboundSchema,
    project: z.lazy(() => GetDrainFilterProject$outboundSchema).optional(),
    log: z.lazy(() => GetDrainFilterLog$outboundSchema).optional(),
    deployment: z.lazy(() => GetDrainFilterDeployment$outboundSchema).optional(),
});
export function getDrainFilter1ToJSON(getDrainFilter1) {
    return JSON.stringify(GetDrainFilter1$outboundSchema.parse(getDrainFilter1));
}
export function getDrainFilter1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilter1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilter1' from JSON`);
}
/** @internal */
export const GetDrainFilterV2Filter$inboundSchema = z.union([
    z.lazy(() => GetDrainFilter2$inboundSchema),
    z.lazy(() => GetDrainFilter1$inboundSchema),
]);
/** @internal */
export const GetDrainFilterV2Filter$outboundSchema = z.union([
    z.lazy(() => GetDrainFilter2$outboundSchema),
    z.lazy(() => GetDrainFilter1$outboundSchema),
]);
export function getDrainFilterV2FilterToJSON(getDrainFilterV2Filter) {
    return JSON.stringify(GetDrainFilterV2Filter$outboundSchema.parse(getDrainFilterV2Filter));
}
export function getDrainFilterV2FilterFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterV2Filter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterV2Filter' from JSON`);
}
/** @internal */
export const GetDrainFilterV22$inboundSchema = z.object({
    version: GetDrainFilterV2DrainsVersion$inboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainFilter2$inboundSchema),
        z.lazy(() => GetDrainFilter1$inboundSchema),
    ]),
});
/** @internal */
export const GetDrainFilterV22$outboundSchema = z.object({
    version: GetDrainFilterV2DrainsVersion$outboundSchema,
    filter: z.union([
        z.lazy(() => GetDrainFilter2$outboundSchema),
        z.lazy(() => GetDrainFilter1$outboundSchema),
    ]),
});
export function getDrainFilterV22ToJSON(getDrainFilterV22) {
    return JSON.stringify(GetDrainFilterV22$outboundSchema.parse(getDrainFilterV22));
}
export function getDrainFilterV22FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterV22$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterV22' from JSON`);
}
/** @internal */
export const GetDrainFilterV2Version$inboundSchema = z.nativeEnum(GetDrainFilterV2Version);
/** @internal */
export const GetDrainFilterV2Version$outboundSchema = GetDrainFilterV2Version$inboundSchema;
/** @internal */
export const GetDrainFilterV21$inboundSchema = z.object({
    version: GetDrainFilterV2Version$inboundSchema,
});
/** @internal */
export const GetDrainFilterV21$outboundSchema = z.object({
    version: GetDrainFilterV2Version$outboundSchema,
});
export function getDrainFilterV21ToJSON(getDrainFilterV21) {
    return JSON.stringify(GetDrainFilterV21$outboundSchema.parse(getDrainFilterV21));
}
export function getDrainFilterV21FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainFilterV21$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainFilterV21' from JSON`);
}
/** @internal */
export const GetDrainResponseBodyFilterV2$inboundSchema = z.union([
    z.lazy(() => GetDrainFilterV22$inboundSchema),
    z.lazy(() => GetDrainFilterV21$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBodyFilterV2$outboundSchema = z.union([
    z.lazy(() => GetDrainFilterV22$outboundSchema),
    z.lazy(() => GetDrainFilterV21$outboundSchema),
]);
export function getDrainResponseBodyFilterV2ToJSON(getDrainResponseBodyFilterV2) {
    return JSON.stringify(GetDrainResponseBodyFilterV2$outboundSchema.parse(getDrainResponseBodyFilterV2));
}
export function getDrainResponseBodyFilterV2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBodyFilterV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBodyFilterV2' from JSON`);
}
/** @internal */
export const GetDrainResponseBody1$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(() => GetDrainResponseBodySchemas$inboundSchema).optional(),
    delivery: z.union([
        z.lazy(() => GetDrainDelivery1$inboundSchema),
        z.lazy(() => GetDrainDelivery2$inboundSchema),
        z.lazy(() => GetDrainDelivery3$inboundSchema),
        z.lazy(() => GetDrainDelivery4$inboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => GetDrainResponseBodySampling$inboundSchema))
        .optional(),
    teamId: z.nullable(z.string()).optional(),
    status: GetDrainResponseBodyStatus$inboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: GetDrainResponseBodyDisabledReason$inboundSchema.optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainSource2$inboundSchema),
        z.lazy(() => GetDrainSource1$inboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainFilterV22$inboundSchema),
        z.lazy(() => GetDrainFilterV21$inboundSchema),
    ]).optional(),
});
/** @internal */
export const GetDrainResponseBody1$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(() => GetDrainResponseBodySchemas$outboundSchema).optional(),
    delivery: z.union([
        z.lazy(() => GetDrainDelivery1$outboundSchema),
        z.lazy(() => GetDrainDelivery2$outboundSchema),
        z.lazy(() => GetDrainDelivery3$outboundSchema),
        z.lazy(() => GetDrainDelivery4$outboundSchema),
    ]).optional(),
    sampling: z.array(z.lazy(() => GetDrainResponseBodySampling$outboundSchema))
        .optional(),
    teamId: z.nullable(z.string()).optional(),
    status: GetDrainResponseBodyStatus$outboundSchema.optional(),
    disabledAt: z.number().optional(),
    disabledReason: GetDrainResponseBodyDisabledReason$outboundSchema.optional(),
    disabledBy: z.string().optional(),
    firstErrorTimestamp: z.number().optional(),
    source: z.union([
        z.lazy(() => GetDrainSource2$outboundSchema),
        z.lazy(() => GetDrainSource1$outboundSchema),
    ]),
    filter: z.string().optional(),
    filterV2: z.union([
        z.lazy(() => GetDrainFilterV22$outboundSchema),
        z.lazy(() => GetDrainFilterV21$outboundSchema),
    ]).optional(),
});
export function getDrainResponseBody1ToJSON(getDrainResponseBody1) {
    return JSON.stringify(GetDrainResponseBody1$outboundSchema.parse(getDrainResponseBody1));
}
export function getDrainResponseBody1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBody1' from JSON`);
}
/** @internal */
export const GetDrainResponseBody$inboundSchema = z.union([
    z.lazy(() => GetDrainResponseBody1$inboundSchema),
    z.lazy(() => GetDrainResponseBody2$inboundSchema),
]);
/** @internal */
export const GetDrainResponseBody$outboundSchema = z.union([
    z.lazy(() => GetDrainResponseBody1$outboundSchema),
    z.lazy(() => GetDrainResponseBody2$outboundSchema),
]);
export function getDrainResponseBodyToJSON(getDrainResponseBody) {
    return JSON.stringify(GetDrainResponseBody$outboundSchema.parse(getDrainResponseBody));
}
export function getDrainResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetDrainResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDrainResponseBody' from JSON`);
}
//# sourceMappingURL=getdrainop.js.map