/*
 * 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 * as components from "../components/index.js";
/**
 * The delivery type. Necessary for prefix filtering.
 */
export const ListVideosType = {
    Upload: "upload",
    Private: "private",
    Authenticated: "authenticated",
    Fetch: "fetch",
    List: "list",
};
/** @internal */
export const ListVideosGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
export const ListVideosGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        cloudName: "cloud_name",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ListVideosGlobals$;
(function (ListVideosGlobals$) {
    /** @deprecated use `ListVideosGlobals$inboundSchema` instead. */
    ListVideosGlobals$.inboundSchema = ListVideosGlobals$inboundSchema;
    /** @deprecated use `ListVideosGlobals$outboundSchema` instead. */
    ListVideosGlobals$.outboundSchema = ListVideosGlobals$outboundSchema;
})(ListVideosGlobals$ || (ListVideosGlobals$ = {}));
export function listVideosGlobalsToJSON(listVideosGlobals) {
    return JSON.stringify(ListVideosGlobals$outboundSchema.parse(listVideosGlobals));
}
export function listVideosGlobalsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ListVideosGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListVideosGlobals' from JSON`);
}
/** @internal */
export const ListVideosType$inboundSchema = z.nativeEnum(ListVideosType);
/** @internal */
export const ListVideosType$outboundSchema = ListVideosType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ListVideosType$;
(function (ListVideosType$) {
    /** @deprecated use `ListVideosType$inboundSchema` instead. */
    ListVideosType$.inboundSchema = ListVideosType$inboundSchema;
    /** @deprecated use `ListVideosType$outboundSchema` instead. */
    ListVideosType$.outboundSchema = ListVideosType$outboundSchema;
})(ListVideosType$ || (ListVideosType$ = {}));
/** @internal */
export const ListVideosRequest$inboundSchema = z.object({
    type: ListVideosType$inboundSchema.optional(),
    prefix: z.string().optional(),
    public_ids: z.array(z.string()).optional(),
    tags: z.boolean().optional(),
    next_cursor: z.string().optional(),
    max_results: z.number().int().optional(),
    direction: components.Direction$inboundSchema.optional(),
    start_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    fields: z.array(components.FieldsSpec$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "public_ids": "publicIds",
        "next_cursor": "nextCursor",
        "max_results": "maxResults",
        "start_at": "startAt",
    });
});
/** @internal */
export const ListVideosRequest$outboundSchema = z.object({
    type: ListVideosType$outboundSchema.optional(),
    prefix: z.string().optional(),
    publicIds: z.array(z.string()).optional(),
    tags: z.boolean().optional(),
    nextCursor: z.string().optional(),
    maxResults: z.number().int().optional(),
    direction: components.Direction$outboundSchema.optional(),
    startAt: z.date().transform(v => v.toISOString()).optional(),
    fields: z.array(components.FieldsSpec$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        publicIds: "public_ids",
        nextCursor: "next_cursor",
        maxResults: "max_results",
        startAt: "start_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ListVideosRequest$;
(function (ListVideosRequest$) {
    /** @deprecated use `ListVideosRequest$inboundSchema` instead. */
    ListVideosRequest$.inboundSchema = ListVideosRequest$inboundSchema;
    /** @deprecated use `ListVideosRequest$outboundSchema` instead. */
    ListVideosRequest$.outboundSchema = ListVideosRequest$outboundSchema;
})(ListVideosRequest$ || (ListVideosRequest$ = {}));
export function listVideosRequestToJSON(listVideosRequest) {
    return JSON.stringify(ListVideosRequest$outboundSchema.parse(listVideosRequest));
}
export function listVideosRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ListVideosRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListVideosRequest' from JSON`);
}
//# sourceMappingURL=listvideos.js.map