/* * 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 ListClusterInvitesRequest = { /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export type Invitations = { id: string; token?: string | undefined; email: string | null; suggestedOrgName: string | null; seedAvailableModels?: Array | undefined; expiresAt: string; createdAt: string; claimedAt?: string | null | undefined; createdOrgId?: string | null | undefined; emailSent?: boolean | null | undefined; }; /** * OK */ export type ListClusterInvitesResponseBody = { invitations: Array; }; /** @internal */ export const ListClusterInvitesRequest$inboundSchema: z.ZodType< ListClusterInvitesRequest, z.ZodTypeDef, unknown > = z.object({ "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListClusterInvitesRequest$Outbound = { "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListClusterInvitesRequest$outboundSchema: z.ZodType< ListClusterInvitesRequest$Outbound, z.ZodTypeDef, ListClusterInvitesRequest > = z.object({ xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listClusterInvitesRequestToJSON( listClusterInvitesRequest: ListClusterInvitesRequest, ): string { return JSON.stringify( ListClusterInvitesRequest$outboundSchema.parse(listClusterInvitesRequest), ); } export function listClusterInvitesRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListClusterInvitesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListClusterInvitesRequest' from JSON`, ); } /** @internal */ export const Invitations$inboundSchema: z.ZodType< Invitations, z.ZodTypeDef, unknown > = z.object({ id: z.string(), token: z.string().optional(), email: z.nullable(z.string()), suggestedOrgName: z.nullable(z.string()), seedAvailableModels: z.array(z.string()).optional(), expiresAt: z.string(), createdAt: z.string(), claimedAt: z.nullable(z.string()).optional(), createdOrgId: z.nullable(z.string()).optional(), emailSent: z.nullable(z.boolean()).optional(), }); /** @internal */ export type Invitations$Outbound = { id: string; token?: string | undefined; email: string | null; suggestedOrgName: string | null; seedAvailableModels?: Array | undefined; expiresAt: string; createdAt: string; claimedAt?: string | null | undefined; createdOrgId?: string | null | undefined; emailSent?: boolean | null | undefined; }; /** @internal */ export const Invitations$outboundSchema: z.ZodType< Invitations$Outbound, z.ZodTypeDef, Invitations > = z.object({ id: z.string(), token: z.string().optional(), email: z.nullable(z.string()), suggestedOrgName: z.nullable(z.string()), seedAvailableModels: z.array(z.string()).optional(), expiresAt: z.string(), createdAt: z.string(), claimedAt: z.nullable(z.string()).optional(), createdOrgId: z.nullable(z.string()).optional(), emailSent: z.nullable(z.boolean()).optional(), }); export function invitationsToJSON(invitations: Invitations): string { return JSON.stringify(Invitations$outboundSchema.parse(invitations)); } export function invitationsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Invitations$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Invitations' from JSON`, ); } /** @internal */ export const ListClusterInvitesResponseBody$inboundSchema: z.ZodType< ListClusterInvitesResponseBody, z.ZodTypeDef, unknown > = z.object({ invitations: z.array(z.lazy(() => Invitations$inboundSchema)), }); /** @internal */ export type ListClusterInvitesResponseBody$Outbound = { invitations: Array; }; /** @internal */ export const ListClusterInvitesResponseBody$outboundSchema: z.ZodType< ListClusterInvitesResponseBody$Outbound, z.ZodTypeDef, ListClusterInvitesResponseBody > = z.object({ invitations: z.array(z.lazy(() => Invitations$outboundSchema)), }); export function listClusterInvitesResponseBodyToJSON( listClusterInvitesResponseBody: ListClusterInvitesResponseBody, ): string { return JSON.stringify( ListClusterInvitesResponseBody$outboundSchema.parse( listClusterInvitesResponseBody, ), ); } export function listClusterInvitesResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListClusterInvitesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListClusterInvitesResponseBody' from JSON`, ); }