/*
 * 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 storage type of the assets. Necessary for prefix filtering.
 */
export const ListImagesType = {
    Upload: "upload",
    Private: "private",
    Authenticated: "authenticated",
    Fetch: "fetch",
    List: "list",
};
/** @internal */
export const ListImagesGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
export const ListImagesGlobals$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 ListImagesGlobals$;
(function (ListImagesGlobals$) {
    /** @deprecated use `ListImagesGlobals$inboundSchema` instead. */
    ListImagesGlobals$.inboundSchema = ListImagesGlobals$inboundSchema;
    /** @deprecated use `ListImagesGlobals$outboundSchema` instead. */
    ListImagesGlobals$.outboundSchema = ListImagesGlobals$outboundSchema;
})(ListImagesGlobals$ || (ListImagesGlobals$ = {}));
export function listImagesGlobalsToJSON(listImagesGlobals) {
    return JSON.stringify(ListImagesGlobals$outboundSchema.parse(listImagesGlobals));
}
export function listImagesGlobalsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ListImagesGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListImagesGlobals' from JSON`);
}
/** @internal */
export const ListImagesType$inboundSchema = z.nativeEnum(ListImagesType);
/** @internal */
export const ListImagesType$outboundSchema = ListImagesType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ListImagesType$;
(function (ListImagesType$) {
    /** @deprecated use `ListImagesType$inboundSchema` instead. */
    ListImagesType$.inboundSchema = ListImagesType$inboundSchema;
    /** @deprecated use `ListImagesType$outboundSchema` instead. */
    ListImagesType$.outboundSchema = ListImagesType$outboundSchema;
})(ListImagesType$ || (ListImagesType$ = {}));
/** @internal */
export const ListImagesRequest$inboundSchema = z.object({
    type: ListImagesType$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 ListImagesRequest$outboundSchema = z.object({
    type: ListImagesType$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 ListImagesRequest$;
(function (ListImagesRequest$) {
    /** @deprecated use `ListImagesRequest$inboundSchema` instead. */
    ListImagesRequest$.inboundSchema = ListImagesRequest$inboundSchema;
    /** @deprecated use `ListImagesRequest$outboundSchema` instead. */
    ListImagesRequest$.outboundSchema = ListImagesRequest$outboundSchema;
})(ListImagesRequest$ || (ListImagesRequest$ = {}));
export function listImagesRequestToJSON(listImagesRequest) {
    return JSON.stringify(ListImagesRequest$outboundSchema.parse(listImagesRequest));
}
export function listImagesRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ListImagesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListImagesRequest' from JSON`);
}
//# sourceMappingURL=listimages.js.map