/* * 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 DeleteChannelEpisodesChannelEpisodeHashedIdRequest = { /** * The hashed id of the Channel Episode */ channelEpisodeHashedId: string; }; /** * A channel episode represents a media that has been added to a channel. Only published * * @remarks * episodes are displayed in a channel. */ export type DeleteChannelEpisodesChannelEpisodeHashedIdResponse = { /** * A unique alphanumeric identifier for the channel episode's channel. */ channelHashedId: string; /** * The date when the channel episode was originally created. */ created: Date; /** * A cursor for stable pagination based on current `sort_by` order. You can pass this to `cursor[before]` or `cursor[after]` as a parameter to fetch the records before or after this record in the same sort order. This is only populated if records were fetched with `cursor[enabled]`, or `cursor[before]` or `cursor[after]`. */ cursor?: string | null | undefined; /** * The channel episode's description or episode notes. */ description: string; /** * A short summary of the episode that is displayed when space is limited. */ summary: string; /** * A unique alphanumeric identifier for the channel episode. */ hashedId: string; /** * A unique alphanumeric identifier for the channel episode's media. */ mediaHashedId: string; /** * Whether the channel episode has been published or is still in draft form. */ published: boolean; /** * The date and time when the episode is scheduled to be published in UTC timezone (only present when publish_status is 'scheduled'). */ publishAt?: Date | undefined; /** * The title of the channel episode */ title: string | null; /** * The date when the channel was last updated. */ updated: Date; }; /** @internal */ export type DeleteChannelEpisodesChannelEpisodeHashedIdRequest$Outbound = { channelEpisodeHashedId: string; }; /** @internal */ export const DeleteChannelEpisodesChannelEpisodeHashedIdRequest$outboundSchema: z.ZodType< DeleteChannelEpisodesChannelEpisodeHashedIdRequest$Outbound, z.ZodTypeDef, DeleteChannelEpisodesChannelEpisodeHashedIdRequest > = z.object({ channelEpisodeHashedId: z.string(), }); export function deleteChannelEpisodesChannelEpisodeHashedIdRequestToJSON( deleteChannelEpisodesChannelEpisodeHashedIdRequest: DeleteChannelEpisodesChannelEpisodeHashedIdRequest, ): string { return JSON.stringify( DeleteChannelEpisodesChannelEpisodeHashedIdRequest$outboundSchema.parse( deleteChannelEpisodesChannelEpisodeHashedIdRequest, ), ); } /** @internal */ export const DeleteChannelEpisodesChannelEpisodeHashedIdResponse$inboundSchema: z.ZodType< DeleteChannelEpisodesChannelEpisodeHashedIdResponse, z.ZodTypeDef, unknown > = z.object({ channel_hashed_id: z.string(), created: z.string().datetime({ offset: true }).transform(v => new Date(v)), cursor: z.nullable(z.string()).optional(), description: z.string(), summary: z.string(), hashed_id: z.string(), media_hashed_id: z.string(), published: z.boolean(), publish_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), title: z.nullable(z.string()), updated: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "channel_hashed_id": "channelHashedId", "hashed_id": "hashedId", "media_hashed_id": "mediaHashedId", "publish_at": "publishAt", }); }); export function deleteChannelEpisodesChannelEpisodeHashedIdResponseFromJSON( jsonString: string, ): SafeParseResult< DeleteChannelEpisodesChannelEpisodeHashedIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => DeleteChannelEpisodesChannelEpisodeHashedIdResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'DeleteChannelEpisodesChannelEpisodeHashedIdResponse' from JSON`, ); }