/* * 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 GetChannelsChannelHashedIdRequest = { /** * The hashed ID of the channel. */ channelHashedId: string; }; /** * A Channel lets you take a collection of video (or audio) and embed them * * @remarks * on your site, as well as distribute through podcasting. */ export type GetChannelsChannelHashedIdResponse = { /** * The numeric id of the channel. */ id: number; /** * The date when the channel was originally created. */ created: Date; /** * The channel's description. */ description: string; /** * A unique alphanumeric identifier for this channel. */ hashedId: string; /** * The number of medias in the channel. */ mediaCount: number; /** * The display name for the channel */ name: string; /** * The date when the channel was last updated. */ updated: 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; }; /** @internal */ export type GetChannelsChannelHashedIdRequest$Outbound = { channelHashedId: string; }; /** @internal */ export const GetChannelsChannelHashedIdRequest$outboundSchema: z.ZodType< GetChannelsChannelHashedIdRequest$Outbound, z.ZodTypeDef, GetChannelsChannelHashedIdRequest > = z.object({ channelHashedId: z.string(), }); export function getChannelsChannelHashedIdRequestToJSON( getChannelsChannelHashedIdRequest: GetChannelsChannelHashedIdRequest, ): string { return JSON.stringify( GetChannelsChannelHashedIdRequest$outboundSchema.parse( getChannelsChannelHashedIdRequest, ), ); } /** @internal */ export const GetChannelsChannelHashedIdResponse$inboundSchema: z.ZodType< GetChannelsChannelHashedIdResponse, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), created: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), hashed_id: z.string(), media_count: z.number().int(), name: z.string(), updated: z.string().datetime({ offset: true }).transform(v => new Date(v)), cursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", "media_count": "mediaCount", }); }); export function getChannelsChannelHashedIdResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetChannelsChannelHashedIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetChannelsChannelHashedIdResponse' from JSON`, ); }