/* * 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 GetClipsRequest = { /** * ID of the parent stream or playbackId of parent stream */ id: string; }; export type GetClipsResponse = { /** * 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; /** * Success */ data?: Array | undefined; /** * Error */ error?: components.ErrorT | undefined; }; /** @internal */ export const GetClipsRequest$inboundSchema: z.ZodType< GetClipsRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), }); /** @internal */ export type GetClipsRequest$Outbound = { id: string; }; /** @internal */ export const GetClipsRequest$outboundSchema: z.ZodType< GetClipsRequest$Outbound, z.ZodTypeDef, GetClipsRequest > = 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 GetClipsRequest$ { /** @deprecated use `GetClipsRequest$inboundSchema` instead. */ export const inboundSchema = GetClipsRequest$inboundSchema; /** @deprecated use `GetClipsRequest$outboundSchema` instead. */ export const outboundSchema = GetClipsRequest$outboundSchema; /** @deprecated use `GetClipsRequest$Outbound` instead. */ export type Outbound = GetClipsRequest$Outbound; } export function getClipsRequestToJSON( getClipsRequest: GetClipsRequest, ): string { return JSON.stringify(GetClipsRequest$outboundSchema.parse(getClipsRequest)); } export function getClipsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetClipsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetClipsRequest' from JSON`, ); } /** @internal */ export const GetClipsResponse$inboundSchema: z.ZodType< GetClipsResponse, z.ZodTypeDef, unknown > = z.object({ ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), data: z.array(components.Asset$inboundSchema).optional(), error: components.ErrorT$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "ContentType": "contentType", "StatusCode": "statusCode", "RawResponse": "rawResponse", }); }); /** @internal */ export type GetClipsResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; data?: Array | undefined; error?: components.ErrorT$Outbound | undefined; }; /** @internal */ export const GetClipsResponse$outboundSchema: z.ZodType< GetClipsResponse$Outbound, z.ZodTypeDef, GetClipsResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), data: z.array(components.Asset$outboundSchema).optional(), 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 GetClipsResponse$ { /** @deprecated use `GetClipsResponse$inboundSchema` instead. */ export const inboundSchema = GetClipsResponse$inboundSchema; /** @deprecated use `GetClipsResponse$outboundSchema` instead. */ export const outboundSchema = GetClipsResponse$outboundSchema; /** @deprecated use `GetClipsResponse$Outbound` instead. */ export type Outbound = GetClipsResponse$Outbound; } export function getClipsResponseToJSON( getClipsResponse: GetClipsResponse, ): string { return JSON.stringify( GetClipsResponse$outboundSchema.parse(getClipsResponse), ); } export function getClipsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetClipsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetClipsResponse' from JSON`, ); }