/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DestinationCreateAWSKinesis, DestinationCreateAWSKinesis$inboundSchema, DestinationCreateAWSKinesis$Outbound, DestinationCreateAWSKinesis$outboundSchema, } from "./destinationcreateawskinesis.js"; import { DestinationCreateAwss3, DestinationCreateAwss3$inboundSchema, DestinationCreateAwss3$Outbound, DestinationCreateAwss3$outboundSchema, } from "./destinationcreateawss3.js"; import { DestinationCreateAWSSQS, DestinationCreateAWSSQS$inboundSchema, DestinationCreateAWSSQS$Outbound, DestinationCreateAWSSQS$outboundSchema, } from "./destinationcreateawssqs.js"; import { DestinationCreateAzureServiceBus, DestinationCreateAzureServiceBus$inboundSchema, DestinationCreateAzureServiceBus$Outbound, DestinationCreateAzureServiceBus$outboundSchema, } from "./destinationcreateazureservicebus.js"; import { DestinationCreateGCPPubSub, DestinationCreateGCPPubSub$inboundSchema, DestinationCreateGCPPubSub$Outbound, DestinationCreateGCPPubSub$outboundSchema, } from "./destinationcreategcppubsub.js"; import { DestinationCreateHookdeck, DestinationCreateHookdeck$inboundSchema, DestinationCreateHookdeck$Outbound, DestinationCreateHookdeck$outboundSchema, } from "./destinationcreatehookdeck.js"; import { DestinationCreateRabbitMQ, DestinationCreateRabbitMQ$inboundSchema, DestinationCreateRabbitMQ$Outbound, DestinationCreateRabbitMQ$outboundSchema, } from "./destinationcreaterabbitmq.js"; import { DestinationCreateWebhook, DestinationCreateWebhook$inboundSchema, DestinationCreateWebhook$Outbound, DestinationCreateWebhook$outboundSchema, } from "./destinationcreatewebhook.js"; export type DestinationCreate = | DestinationCreateWebhook | DestinationCreateAWSSQS | DestinationCreateRabbitMQ | DestinationCreateHookdeck | DestinationCreateAWSKinesis | DestinationCreateAzureServiceBus | DestinationCreateAwss3 | DestinationCreateGCPPubSub; /** @internal */ export const DestinationCreate$inboundSchema: z.ZodType< DestinationCreate, z.ZodTypeDef, unknown > = z.union([ DestinationCreateWebhook$inboundSchema, DestinationCreateAWSSQS$inboundSchema, DestinationCreateRabbitMQ$inboundSchema, DestinationCreateHookdeck$inboundSchema, DestinationCreateAWSKinesis$inboundSchema, DestinationCreateAzureServiceBus$inboundSchema, DestinationCreateAwss3$inboundSchema, DestinationCreateGCPPubSub$inboundSchema, ]); /** @internal */ export type DestinationCreate$Outbound = | DestinationCreateWebhook$Outbound | DestinationCreateAWSSQS$Outbound | DestinationCreateRabbitMQ$Outbound | DestinationCreateHookdeck$Outbound | DestinationCreateAWSKinesis$Outbound | DestinationCreateAzureServiceBus$Outbound | DestinationCreateAwss3$Outbound | DestinationCreateGCPPubSub$Outbound; /** @internal */ export const DestinationCreate$outboundSchema: z.ZodType< DestinationCreate$Outbound, z.ZodTypeDef, DestinationCreate > = z.union([ DestinationCreateWebhook$outboundSchema, DestinationCreateAWSSQS$outboundSchema, DestinationCreateRabbitMQ$outboundSchema, DestinationCreateHookdeck$outboundSchema, DestinationCreateAWSKinesis$outboundSchema, DestinationCreateAzureServiceBus$outboundSchema, DestinationCreateAwss3$outboundSchema, DestinationCreateGCPPubSub$outboundSchema, ]); export function destinationCreateToJSON( destinationCreate: DestinationCreate, ): string { return JSON.stringify( DestinationCreate$outboundSchema.parse(destinationCreate), ); } export function destinationCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DestinationCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DestinationCreate' from JSON`, ); }