/* * 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"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateTenantDestinationRequest = { /** * The ID of the tenant. Required when using AdminApiKey authentication. */ tenantId: string; body: components.DestinationCreate; }; /** @internal */ export const CreateTenantDestinationRequest$inboundSchema: z.ZodType< CreateTenantDestinationRequest, z.ZodTypeDef, unknown > = z.object({ tenant_id: z.string(), body: components.DestinationCreate$inboundSchema, }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", }); }); /** @internal */ export type CreateTenantDestinationRequest$Outbound = { tenant_id: string; body: components.DestinationCreate$Outbound; }; /** @internal */ export const CreateTenantDestinationRequest$outboundSchema: z.ZodType< CreateTenantDestinationRequest$Outbound, z.ZodTypeDef, CreateTenantDestinationRequest > = z.object({ tenantId: z.string(), body: components.DestinationCreate$outboundSchema, }).transform((v) => { return remap$(v, { tenantId: "tenant_id", }); }); export function createTenantDestinationRequestToJSON( createTenantDestinationRequest: CreateTenantDestinationRequest, ): string { return JSON.stringify( CreateTenantDestinationRequest$outboundSchema.parse( createTenantDestinationRequest, ), ); } export function createTenantDestinationRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateTenantDestinationRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTenantDestinationRequest' from JSON`, ); }