/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f526444117c0 */ import * as z from "zod"; import { ClosedEnum } from "../types/enums.js"; import { ApiError, ApiError$zodSchema } from "./apierror.js"; import { VideoViewsResponse, VideoViewsResponse$zodSchema, } from "./videoviewsresponse.js"; export type GetVideoViewsGlobals = { cloud_name?: string | undefined }; export const GetVideoViewsGlobals$zodSchema: z.ZodType = z .object({ cloud_name: z.string().describe( "The cloud name of your product environment.", ).optional(), }); /** * Specifies the expression field by which to sort the results. Prepend values with a '-' to reverse the order. */ export const GetVideoViewsSortBy = { ViewEndedAt: "view_ended_at", VideoDuration: "video_duration", ViewWatchTime: "view_watch_time", MinusViewEndedAt: "-view_ended_at", MinusVideoDuration: "-video_duration", MinusViewWatchTime: "-view_watch_time", } as const; /** * Specifies the expression field by which to sort the results. Prepend values with a '-' to reverse the order. */ export type GetVideoViewsSortBy = ClosedEnum; export const GetVideoViewsSortBy$zodSchema = z.enum([ "view_ended_at", "video_duration", "view_watch_time", "-view_ended_at", "-video_duration", "-view_watch_time", ]).describe( "Specifies the expression field by which to sort the results. Prepend values with a '-' to reverse the order.", ); export type GetVideoViewsRequest = { expression?: string | undefined; max_results?: number | undefined; sort_by?: GetVideoViewsSortBy | undefined; next_cursor?: string | undefined; }; export const GetVideoViewsRequest$zodSchema: z.ZodType = z .object({ expression: z.string().describe( "A set of conditions used to limit the results to rows that match those conditions. For example: `?expression=video_public_id=skate`", ).optional(), max_results: z.int().default(10).describe( "The maximum number of results to return. Default is 10.", ), next_cursor: z.string().describe( "The cursor for pagination. Use the next_cursor value from a previous response to get the next page of results.", ).optional(), sort_by: GetVideoViewsSortBy$zodSchema.default("-view_ended_at").describe( "Specifies the expression field by which to sort the results. Prepend values with a '-' to reverse the order.", ), }); export type GetVideoViewsResponse = ApiError | VideoViewsResponse; export const GetVideoViewsResponse$zodSchema: z.ZodType = z.union([ ApiError$zodSchema, VideoViewsResponse$zodSchema, ]);