/* * 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 UpdateMultistreamTargetRequest = { /** * ID of the multistream target */ id: string; multistreamTargetPatchPayload: components.MultistreamTargetPatchPayload; }; export type UpdateMultistreamTargetResponse = { /** * 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 UpdateMultistreamTargetRequest$inboundSchema: z.ZodType< UpdateMultistreamTargetRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), "multistream-target-patch-payload": components.MultistreamTargetPatchPayload$inboundSchema, }).transform((v) => { return remap$(v, { "multistream-target-patch-payload": "multistreamTargetPatchPayload", }); }); /** @internal */ export type UpdateMultistreamTargetRequest$Outbound = { id: string; "multistream-target-patch-payload": components.MultistreamTargetPatchPayload$Outbound; }; /** @internal */ export const UpdateMultistreamTargetRequest$outboundSchema: z.ZodType< UpdateMultistreamTargetRequest$Outbound, z.ZodTypeDef, UpdateMultistreamTargetRequest > = z.object({ id: z.string(), multistreamTargetPatchPayload: components.MultistreamTargetPatchPayload$outboundSchema, }).transform((v) => { return remap$(v, { multistreamTargetPatchPayload: "multistream-target-patch-payload", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateMultistreamTargetRequest$ { /** @deprecated use `UpdateMultistreamTargetRequest$inboundSchema` instead. */ export const inboundSchema = UpdateMultistreamTargetRequest$inboundSchema; /** @deprecated use `UpdateMultistreamTargetRequest$outboundSchema` instead. */ export const outboundSchema = UpdateMultistreamTargetRequest$outboundSchema; /** @deprecated use `UpdateMultistreamTargetRequest$Outbound` instead. */ export type Outbound = UpdateMultistreamTargetRequest$Outbound; } export function updateMultistreamTargetRequestToJSON( updateMultistreamTargetRequest: UpdateMultistreamTargetRequest, ): string { return JSON.stringify( UpdateMultistreamTargetRequest$outboundSchema.parse( updateMultistreamTargetRequest, ), ); } export function updateMultistreamTargetRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateMultistreamTargetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMultistreamTargetRequest' from JSON`, ); } /** @internal */ export const UpdateMultistreamTargetResponse$inboundSchema: z.ZodType< UpdateMultistreamTargetResponse, 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 UpdateMultistreamTargetResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; error?: components.ErrorT$Outbound | undefined; }; /** @internal */ export const UpdateMultistreamTargetResponse$outboundSchema: z.ZodType< UpdateMultistreamTargetResponse$Outbound, z.ZodTypeDef, UpdateMultistreamTargetResponse > = 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 UpdateMultistreamTargetResponse$ { /** @deprecated use `UpdateMultistreamTargetResponse$inboundSchema` instead. */ export const inboundSchema = UpdateMultistreamTargetResponse$inboundSchema; /** @deprecated use `UpdateMultistreamTargetResponse$outboundSchema` instead. */ export const outboundSchema = UpdateMultistreamTargetResponse$outboundSchema; /** @deprecated use `UpdateMultistreamTargetResponse$Outbound` instead. */ export type Outbound = UpdateMultistreamTargetResponse$Outbound; } export function updateMultistreamTargetResponseToJSON( updateMultistreamTargetResponse: UpdateMultistreamTargetResponse, ): string { return JSON.stringify( UpdateMultistreamTargetResponse$outboundSchema.parse( updateMultistreamTargetResponse, ), ); } export function updateMultistreamTargetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateMultistreamTargetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMultistreamTargetResponse' from JSON`, ); }