/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SuspendClusterOrgRequest = { id: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** * OK */ export type SuspendClusterOrgResponseBody = { message: string; }; /** @internal */ export const SuspendClusterOrgRequest$inboundSchema: z.ZodType< SuspendClusterOrgRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type SuspendClusterOrgRequest$Outbound = { id: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const SuspendClusterOrgRequest$outboundSchema: z.ZodType< SuspendClusterOrgRequest$Outbound, z.ZodTypeDef, SuspendClusterOrgRequest > = z.object({ id: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function suspendClusterOrgRequestToJSON( suspendClusterOrgRequest: SuspendClusterOrgRequest, ): string { return JSON.stringify( SuspendClusterOrgRequest$outboundSchema.parse(suspendClusterOrgRequest), ); } export function suspendClusterOrgRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SuspendClusterOrgRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SuspendClusterOrgRequest' from JSON`, ); } /** @internal */ export const SuspendClusterOrgResponseBody$inboundSchema: z.ZodType< SuspendClusterOrgResponseBody, z.ZodTypeDef, unknown > = z.object({ message: z.string(), }); /** @internal */ export type SuspendClusterOrgResponseBody$Outbound = { message: string; }; /** @internal */ export const SuspendClusterOrgResponseBody$outboundSchema: z.ZodType< SuspendClusterOrgResponseBody$Outbound, z.ZodTypeDef, SuspendClusterOrgResponseBody > = z.object({ message: z.string(), }); export function suspendClusterOrgResponseBodyToJSON( suspendClusterOrgResponseBody: SuspendClusterOrgResponseBody, ): string { return JSON.stringify( SuspendClusterOrgResponseBody$outboundSchema.parse( suspendClusterOrgResponseBody, ), ); } export function suspendClusterOrgResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SuspendClusterOrgResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SuspendClusterOrgResponseBody' from JSON`, ); }