/*
 * 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";
/** @internal */
export const InfoContext$inboundSchema = z.object({
    custom: z.record(z.any()).optional(),
});
/** @internal */
export const InfoContext$outboundSchema = z.object({
    custom: z.record(z.any()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InfoContext$;
(function (InfoContext$) {
    /** @deprecated use `InfoContext$inboundSchema` instead. */
    InfoContext$.inboundSchema = InfoContext$inboundSchema;
    /** @deprecated use `InfoContext$outboundSchema` instead. */
    InfoContext$.outboundSchema = InfoContext$outboundSchema;
})(InfoContext$ || (InfoContext$ = {}));
export function infoContextToJSON(infoContext) {
    return JSON.stringify(InfoContext$outboundSchema.parse(infoContext));
}
export function infoContextFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InfoContext$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InfoContext' from JSON`);
}
/** @internal */
export const InfoModeration$inboundSchema = z.object({
    kind: z.string().optional(),
    status: z.string().optional(),
    updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
}).transform((v) => {
    return remap$(v, {
        "updated_at": "updatedAt",
    });
});
/** @internal */
export const InfoModeration$outboundSchema = z.object({
    kind: z.string().optional(),
    status: z.string().optional(),
    updatedAt: z.date().transform(v => v.toISOString()).optional(),
}).transform((v) => {
    return remap$(v, {
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InfoModeration$;
(function (InfoModeration$) {
    /** @deprecated use `InfoModeration$inboundSchema` instead. */
    InfoModeration$.inboundSchema = InfoModeration$inboundSchema;
    /** @deprecated use `InfoModeration$outboundSchema` instead. */
    InfoModeration$.outboundSchema = InfoModeration$outboundSchema;
})(InfoModeration$ || (InfoModeration$ = {}));
export function infoModerationToJSON(infoModeration) {
    return JSON.stringify(InfoModeration$outboundSchema.parse(infoModeration));
}
export function infoModerationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InfoModeration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InfoModeration' from JSON`);
}
/** @internal */
export const InfoAccessControl$inboundSchema = z.object({});
/** @internal */
export const InfoAccessControl$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InfoAccessControl$;
(function (InfoAccessControl$) {
    /** @deprecated use `InfoAccessControl$inboundSchema` instead. */
    InfoAccessControl$.inboundSchema = InfoAccessControl$inboundSchema;
    /** @deprecated use `InfoAccessControl$outboundSchema` instead. */
    InfoAccessControl$.outboundSchema = InfoAccessControl$outboundSchema;
})(InfoAccessControl$ || (InfoAccessControl$ = {}));
export function infoAccessControlToJSON(infoAccessControl) {
    return JSON.stringify(InfoAccessControl$outboundSchema.parse(infoAccessControl));
}
export function infoAccessControlFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InfoAccessControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InfoAccessControl' from JSON`);
}
/** @internal */
export const Info$inboundSchema = z
    .object({
    asset_id: z.string().optional(),
    public_id: z.string().optional(),
    asset_folder: z.string().optional(),
    display_name: z.string().optional(),
    folder: z.string().optional(),
    filename: z.string().optional(),
    format: z.string().optional(),
    version: z.number().int().optional(),
    resource_type: z.string().optional(),
    type: z.string().optional(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    uploaded_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    bytes: z.number().int().optional(),
    backup_bytes: z.number().int().optional(),
    width: z.nullable(z.number().int()).optional(),
    height: z.nullable(z.number().int()).optional(),
    aspect_ratio: z.nullable(z.number()).optional(),
    pixels: z.nullable(z.number().int()).optional(),
    tags: z.array(z.string()).optional(),
    context: z.lazy(() => InfoContext$inboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
    moderation_kind: z.string().optional(),
    moderation_status: z.string().optional(),
    moderation: z.array(z.lazy(() => InfoModeration$inboundSchema)).optional(),
    backup: z.boolean().optional(),
    access_mode: z.string().optional(),
    url: z.string().optional(),
    secure_url: z.string().optional(),
    status: z.string().optional(),
    access_control: z.nullable(z.array(z.lazy(() => InfoAccessControl$inboundSchema))).optional(),
    etag: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "asset_id": "assetId",
        "public_id": "publicId",
        "asset_folder": "assetFolder",
        "display_name": "displayName",
        "resource_type": "resourceType",
        "created_at": "createdAt",
        "uploaded_at": "uploadedAt",
        "backup_bytes": "backupBytes",
        "aspect_ratio": "aspectRatio",
        "moderation_kind": "moderationKind",
        "moderation_status": "moderationStatus",
        "access_mode": "accessMode",
        "secure_url": "secureUrl",
        "access_control": "accessControl",
    });
});
/** @internal */
export const Info$outboundSchema = z.object({
    assetId: z.string().optional(),
    publicId: z.string().optional(),
    assetFolder: z.string().optional(),
    displayName: z.string().optional(),
    folder: z.string().optional(),
    filename: z.string().optional(),
    format: z.string().optional(),
    version: z.number().int().optional(),
    resourceType: z.string().optional(),
    type: z.string().optional(),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    uploadedAt: z.date().transform(v => v.toISOString()).optional(),
    bytes: z.number().int().optional(),
    backupBytes: z.number().int().optional(),
    width: z.nullable(z.number().int()).optional(),
    height: z.nullable(z.number().int()).optional(),
    aspectRatio: z.nullable(z.number()).optional(),
    pixels: z.nullable(z.number().int()).optional(),
    tags: z.array(z.string()).optional(),
    context: z.lazy(() => InfoContext$outboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
    moderationKind: z.string().optional(),
    moderationStatus: z.string().optional(),
    moderation: z.array(z.lazy(() => InfoModeration$outboundSchema)).optional(),
    backup: z.boolean().optional(),
    accessMode: z.string().optional(),
    url: z.string().optional(),
    secureUrl: z.string().optional(),
    status: z.string().optional(),
    accessControl: z.nullable(z.array(z.lazy(() => InfoAccessControl$outboundSchema))).optional(),
    etag: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        assetId: "asset_id",
        publicId: "public_id",
        assetFolder: "asset_folder",
        displayName: "display_name",
        resourceType: "resource_type",
        createdAt: "created_at",
        uploadedAt: "uploaded_at",
        backupBytes: "backup_bytes",
        aspectRatio: "aspect_ratio",
        moderationKind: "moderation_kind",
        moderationStatus: "moderation_status",
        accessMode: "access_mode",
        secureUrl: "secure_url",
        accessControl: "access_control",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Info$;
(function (Info$) {
    /** @deprecated use `Info$inboundSchema` instead. */
    Info$.inboundSchema = Info$inboundSchema;
    /** @deprecated use `Info$outboundSchema` instead. */
    Info$.outboundSchema = Info$outboundSchema;
})(Info$ || (Info$ = {}));
export function infoToJSON(info) {
    return JSON.stringify(Info$outboundSchema.parse(info));
}
export function infoFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Info$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Info' from JSON`);
}
//# sourceMappingURL=info.js.map