/* * 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 DeleteTeamRequest = { orgId: string; teamId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** * OK */ export type DeleteTeamResponseBody = { id: string; deleted: boolean; }; /** @internal */ export const DeleteTeamRequest$inboundSchema: z.ZodType< DeleteTeamRequest, 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 DeleteTeamRequest$Outbound = { orgId: string; teamId: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const DeleteTeamRequest$outboundSchema: z.ZodType< DeleteTeamRequest$Outbound, z.ZodTypeDef, DeleteTeamRequest > = z.object({ orgId: z.string(), teamId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function deleteTeamRequestToJSON( deleteTeamRequest: DeleteTeamRequest, ): string { return JSON.stringify( DeleteTeamRequest$outboundSchema.parse(deleteTeamRequest), ); } export function deleteTeamRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteTeamRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteTeamRequest' from JSON`, ); } /** @internal */ export const DeleteTeamResponseBody$inboundSchema: z.ZodType< DeleteTeamResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.string(), deleted: z.boolean(), }); /** @internal */ export type DeleteTeamResponseBody$Outbound = { id: string; deleted: boolean; }; /** @internal */ export const DeleteTeamResponseBody$outboundSchema: z.ZodType< DeleteTeamResponseBody$Outbound, z.ZodTypeDef, DeleteTeamResponseBody > = z.object({ id: z.string(), deleted: z.boolean(), }); export function deleteTeamResponseBodyToJSON( deleteTeamResponseBody: DeleteTeamResponseBody, ): string { return JSON.stringify( DeleteTeamResponseBody$outboundSchema.parse(deleteTeamResponseBody), ); } export function deleteTeamResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteTeamResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteTeamResponseBody' from JSON`, ); }