"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Info$ = exports.Info$outboundSchema = exports.Info$inboundSchema = exports.InfoAccessControl$ = exports.InfoAccessControl$outboundSchema = exports.InfoAccessControl$inboundSchema = exports.InfoModeration$ = exports.InfoModeration$outboundSchema = exports.InfoModeration$inboundSchema = exports.InfoContext$ = exports.InfoContext$outboundSchema = exports.InfoContext$inboundSchema = void 0;
exports.infoContextToJSON = infoContextToJSON;
exports.infoContextFromJSON = infoContextFromJSON;
exports.infoModerationToJSON = infoModerationToJSON;
exports.infoModerationFromJSON = infoModerationFromJSON;
exports.infoAccessControlToJSON = infoAccessControlToJSON;
exports.infoAccessControlFromJSON = infoAccessControlFromJSON;
exports.infoToJSON = infoToJSON;
exports.infoFromJSON = infoFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.InfoContext$inboundSchema = z.object({
    custom: z.record(z.any()).optional(),
});
/** @internal */
exports.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.
 */
var InfoContext$;
(function (InfoContext$) {
    /** @deprecated use `InfoContext$inboundSchema` instead. */
    InfoContext$.inboundSchema = exports.InfoContext$inboundSchema;
    /** @deprecated use `InfoContext$outboundSchema` instead. */
    InfoContext$.outboundSchema = exports.InfoContext$outboundSchema;
})(InfoContext$ || (exports.InfoContext$ = InfoContext$ = {}));
function infoContextToJSON(infoContext) {
    return JSON.stringify(exports.InfoContext$outboundSchema.parse(infoContext));
}
function infoContextFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InfoContext$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InfoContext' from JSON`);
}
/** @internal */
exports.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 (0, primitives_js_1.remap)(v, {
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.InfoModeration$outboundSchema = z.object({
    kind: z.string().optional(),
    status: z.string().optional(),
    updatedAt: z.date().transform(v => v.toISOString()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.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.
 */
var InfoModeration$;
(function (InfoModeration$) {
    /** @deprecated use `InfoModeration$inboundSchema` instead. */
    InfoModeration$.inboundSchema = exports.InfoModeration$inboundSchema;
    /** @deprecated use `InfoModeration$outboundSchema` instead. */
    InfoModeration$.outboundSchema = exports.InfoModeration$outboundSchema;
})(InfoModeration$ || (exports.InfoModeration$ = InfoModeration$ = {}));
function infoModerationToJSON(infoModeration) {
    return JSON.stringify(exports.InfoModeration$outboundSchema.parse(infoModeration));
}
function infoModerationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InfoModeration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InfoModeration' from JSON`);
}
/** @internal */
exports.InfoAccessControl$inboundSchema = z.object({});
/** @internal */
exports.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.
 */
var InfoAccessControl$;
(function (InfoAccessControl$) {
    /** @deprecated use `InfoAccessControl$inboundSchema` instead. */
    InfoAccessControl$.inboundSchema = exports.InfoAccessControl$inboundSchema;
    /** @deprecated use `InfoAccessControl$outboundSchema` instead. */
    InfoAccessControl$.outboundSchema = exports.InfoAccessControl$outboundSchema;
})(InfoAccessControl$ || (exports.InfoAccessControl$ = InfoAccessControl$ = {}));
function infoAccessControlToJSON(infoAccessControl) {
    return JSON.stringify(exports.InfoAccessControl$outboundSchema.parse(infoAccessControl));
}
function infoAccessControlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InfoAccessControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InfoAccessControl' from JSON`);
}
/** @internal */
exports.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(() => exports.InfoContext$inboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
    moderation_kind: z.string().optional(),
    moderation_status: z.string().optional(),
    moderation: z.array(z.lazy(() => exports.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(() => exports.InfoAccessControl$inboundSchema))).optional(),
    etag: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.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 */
exports.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(() => exports.InfoContext$outboundSchema).optional(),
    metadata: z.record(z.any()).optional(),
    moderationKind: z.string().optional(),
    moderationStatus: z.string().optional(),
    moderation: z.array(z.lazy(() => exports.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(() => exports.InfoAccessControl$outboundSchema))).optional(),
    etag: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.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.
 */
var Info$;
(function (Info$) {
    /** @deprecated use `Info$inboundSchema` instead. */
    Info$.inboundSchema = exports.Info$inboundSchema;
    /** @deprecated use `Info$outboundSchema` instead. */
    Info$.outboundSchema = exports.Info$outboundSchema;
})(Info$ || (exports.Info$ = Info$ = {}));
function infoToJSON(info) {
    return JSON.stringify(exports.Info$outboundSchema.parse(info));
}
function infoFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Info$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Info' from JSON`);
}
//# sourceMappingURL=info.js.map