/* * 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 GetTeamRequest = { orgId: string; teamId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export type GetTeamTeam = { id: string; name: string; organizationId: string; createdAt: string; updatedAt: string; }; /** * OK */ export type GetTeamResponseBody = { team: GetTeamTeam; }; /** @internal */ export const GetTeamRequest$inboundSchema: z.ZodType< GetTeamRequest, z.ZodTypeDef, unknown > = z.object({ orgId: z.string(), teamId: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetTeamRequest$Outbound = { orgId: string; teamId: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetTeamRequest$outboundSchema: z.ZodType< GetTeamRequest$Outbound, z.ZodTypeDef, GetTeamRequest > = z.object({ orgId: z.string(), teamId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getTeamRequestToJSON(getTeamRequest: GetTeamRequest): string { return JSON.stringify(GetTeamRequest$outboundSchema.parse(getTeamRequest)); } export function getTeamRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTeamRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTeamRequest' from JSON`, ); } /** @internal */ export const GetTeamTeam$inboundSchema: z.ZodType< GetTeamTeam, z.ZodTypeDef, unknown > = z.object({ id: z.string(), name: z.string(), organizationId: z.string(), createdAt: z.string(), updatedAt: z.string(), }); /** @internal */ export type GetTeamTeam$Outbound = { id: string; name: string; organizationId: string; createdAt: string; updatedAt: string; }; /** @internal */ export const GetTeamTeam$outboundSchema: z.ZodType< GetTeamTeam$Outbound, z.ZodTypeDef, GetTeamTeam > = z.object({ id: z.string(), name: z.string(), organizationId: z.string(), createdAt: z.string(), updatedAt: z.string(), }); export function getTeamTeamToJSON(getTeamTeam: GetTeamTeam): string { return JSON.stringify(GetTeamTeam$outboundSchema.parse(getTeamTeam)); } export function getTeamTeamFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTeamTeam$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTeamTeam' from JSON`, ); } /** @internal */ export const GetTeamResponseBody$inboundSchema: z.ZodType< GetTeamResponseBody, z.ZodTypeDef, unknown > = z.object({ team: z.lazy(() => GetTeamTeam$inboundSchema), }); /** @internal */ export type GetTeamResponseBody$Outbound = { team: GetTeamTeam$Outbound; }; /** @internal */ export const GetTeamResponseBody$outboundSchema: z.ZodType< GetTeamResponseBody$Outbound, z.ZodTypeDef, GetTeamResponseBody > = z.object({ team: z.lazy(() => GetTeamTeam$outboundSchema), }); export function getTeamResponseBodyToJSON( getTeamResponseBody: GetTeamResponseBody, ): string { return JSON.stringify( GetTeamResponseBody$outboundSchema.parse(getTeamResponseBody), ); } export function getTeamResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTeamResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTeamResponseBody' from JSON`, ); }