/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { InputCreatorId, InputCreatorId$inboundSchema, InputCreatorId$Outbound, InputCreatorId$outboundSchema, } from "./inputcreatorid.js"; import { PlaybackPolicy, PlaybackPolicy$inboundSchema, PlaybackPolicy$Outbound, PlaybackPolicy$outboundSchema, } from "./playbackpolicy.js"; import { Storage, Storage$inboundSchema, Storage$Outbound, Storage$outboundSchema, } from "./storage.js"; export type AssetPatchPayload = { /** * The name of the asset. This is not necessarily the filename - it can be a custom name or title. * * @remarks */ name?: string | undefined; creatorId?: InputCreatorId | undefined; /** * Whether the playback policy for an asset or stream is public or signed */ playbackPolicy?: PlaybackPolicy | null | undefined; storage?: Storage | undefined; }; /** @internal */ export const AssetPatchPayload$inboundSchema: z.ZodType< AssetPatchPayload, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), creatorId: InputCreatorId$inboundSchema.optional(), playbackPolicy: z.nullable(PlaybackPolicy$inboundSchema).optional(), storage: Storage$inboundSchema.optional(), }); /** @internal */ export type AssetPatchPayload$Outbound = { name?: string | undefined; creatorId?: InputCreatorId$Outbound | undefined; playbackPolicy?: PlaybackPolicy$Outbound | null | undefined; storage?: Storage$Outbound | undefined; }; /** @internal */ export const AssetPatchPayload$outboundSchema: z.ZodType< AssetPatchPayload$Outbound, z.ZodTypeDef, AssetPatchPayload > = z.object({ name: z.string().optional(), creatorId: InputCreatorId$outboundSchema.optional(), playbackPolicy: z.nullable(PlaybackPolicy$outboundSchema).optional(), storage: Storage$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AssetPatchPayload$ { /** @deprecated use `AssetPatchPayload$inboundSchema` instead. */ export const inboundSchema = AssetPatchPayload$inboundSchema; /** @deprecated use `AssetPatchPayload$outboundSchema` instead. */ export const outboundSchema = AssetPatchPayload$outboundSchema; /** @deprecated use `AssetPatchPayload$Outbound` instead. */ export type Outbound = AssetPatchPayload$Outbound; } export function assetPatchPayloadToJSON( assetPatchPayload: AssetPatchPayload, ): string { return JSON.stringify( AssetPatchPayload$outboundSchema.parse(assetPatchPayload), ); } export function assetPatchPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetPatchPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetPatchPayload' from JSON`, ); }