/* * 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 UpdateTenantDestinationRequest = { /** * The ID of the tenant. Required when using AdminApiKey authentication. */ tenantId: string; /** * The ID of the destination. */ destinationId: string; body: components.DestinationUpdate; }; /** * Destination updated successfully or OAuth redirect needed. */ export type UpdateTenantDestinationResponse = components.Destination; /** @internal */ export const UpdateTenantDestinationRequest$inboundSchema: z.ZodType< UpdateTenantDestinationRequest, z.ZodTypeDef, unknown > = z.object({ tenant_id: z.string(), destination_id: z.string(), body: components.DestinationUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", "destination_id": "destinationId", }); }); /** @internal */ export type UpdateTenantDestinationRequest$Outbound = { tenant_id: string; destination_id: string; body: components.DestinationUpdate$Outbound; }; /** @internal */ export const UpdateTenantDestinationRequest$outboundSchema: z.ZodType< UpdateTenantDestinationRequest$Outbound, z.ZodTypeDef, UpdateTenantDestinationRequest > = z.object({ tenantId: z.string(), destinationId: z.string(), body: components.DestinationUpdate$outboundSchema, }).transform((v) => { return remap$(v, { tenantId: "tenant_id", destinationId: "destination_id", }); }); export function updateTenantDestinationRequestToJSON( updateTenantDestinationRequest: UpdateTenantDestinationRequest, ): string { return JSON.stringify( UpdateTenantDestinationRequest$outboundSchema.parse( updateTenantDestinationRequest, ), ); } export function updateTenantDestinationRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateTenantDestinationRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateTenantDestinationRequest' from JSON`, ); } /** @internal */ export const UpdateTenantDestinationResponse$inboundSchema: z.ZodType< UpdateTenantDestinationResponse, z.ZodTypeDef, unknown > = components.Destination$inboundSchema; /** @internal */ export type UpdateTenantDestinationResponse$Outbound = components.Destination$Outbound; /** @internal */ export const UpdateTenantDestinationResponse$outboundSchema: z.ZodType< UpdateTenantDestinationResponse$Outbound, z.ZodTypeDef, UpdateTenantDestinationResponse > = components.Destination$outboundSchema; export function updateTenantDestinationResponseToJSON( updateTenantDestinationResponse: UpdateTenantDestinationResponse, ): string { return JSON.stringify( UpdateTenantDestinationResponse$outboundSchema.parse( updateTenantDestinationResponse, ), ); } export function updateTenantDestinationResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateTenantDestinationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateTenantDestinationResponse' from JSON`, ); }