/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 StopRoomEgressRequest = { id: string; }; export type StopRoomEgressResponse = { /** * HTTP response content type for this operation */ contentType: string; /** * HTTP response status code for this operation */ statusCode: number; /** * Raw HTTP response; suitable for custom response parsing */ rawResponse: Response; /** * Error */ error?: components.ErrorT | undefined; }; /** @internal */ export const StopRoomEgressRequest$inboundSchema: z.ZodType< StopRoomEgressRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), }); /** @internal */ export type StopRoomEgressRequest$Outbound = { id: string; }; /** @internal */ export const StopRoomEgressRequest$outboundSchema: z.ZodType< StopRoomEgressRequest$Outbound, z.ZodTypeDef, StopRoomEgressRequest > = z.object({ id: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace StopRoomEgressRequest$ { /** @deprecated use `StopRoomEgressRequest$inboundSchema` instead. */ export const inboundSchema = StopRoomEgressRequest$inboundSchema; /** @deprecated use `StopRoomEgressRequest$outboundSchema` instead. */ export const outboundSchema = StopRoomEgressRequest$outboundSchema; /** @deprecated use `StopRoomEgressRequest$Outbound` instead. */ export type Outbound = StopRoomEgressRequest$Outbound; } export function stopRoomEgressRequestToJSON( stopRoomEgressRequest: StopRoomEgressRequest, ): string { return JSON.stringify( StopRoomEgressRequest$outboundSchema.parse(stopRoomEgressRequest), ); } export function stopRoomEgressRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StopRoomEgressRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopRoomEgressRequest' from JSON`, ); } /** @internal */ export const StopRoomEgressResponse$inboundSchema: z.ZodType< StopRoomEgressResponse, z.ZodTypeDef, unknown > = z.object({ ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), error: components.ErrorT$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "ContentType": "contentType", "StatusCode": "statusCode", "RawResponse": "rawResponse", }); }); /** @internal */ export type StopRoomEgressResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; error?: components.ErrorT$Outbound | undefined; }; /** @internal */ export const StopRoomEgressResponse$outboundSchema: z.ZodType< StopRoomEgressResponse$Outbound, z.ZodTypeDef, StopRoomEgressResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), error: components.ErrorT$outboundSchema.optional(), }).transform((v) => { return remap$(v, { contentType: "ContentType", statusCode: "StatusCode", rawResponse: "RawResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace StopRoomEgressResponse$ { /** @deprecated use `StopRoomEgressResponse$inboundSchema` instead. */ export const inboundSchema = StopRoomEgressResponse$inboundSchema; /** @deprecated use `StopRoomEgressResponse$outboundSchema` instead. */ export const outboundSchema = StopRoomEgressResponse$outboundSchema; /** @deprecated use `StopRoomEgressResponse$Outbound` instead. */ export type Outbound = StopRoomEgressResponse$Outbound; } export function stopRoomEgressResponseToJSON( stopRoomEgressResponse: StopRoomEgressResponse, ): string { return JSON.stringify( StopRoomEgressResponse$outboundSchema.parse(stopRoomEgressResponse), ); } export function stopRoomEgressResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StopRoomEgressResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopRoomEgressResponse' from JSON`, ); }