"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.UploadResponse$ = exports.UploadResponse$outboundSchema = exports.UploadResponse$inboundSchema = exports.Eager$ = exports.Eager$outboundSchema = exports.Eager$inboundSchema = exports.UploadResponseImageMetadata$ = exports.UploadResponseImageMetadata$outboundSchema = exports.UploadResponseImageMetadata$inboundSchema = void 0;
exports.uploadResponseImageMetadataToJSON = uploadResponseImageMetadataToJSON;
exports.uploadResponseImageMetadataFromJSON = uploadResponseImageMetadataFromJSON;
exports.eagerToJSON = eagerToJSON;
exports.eagerFromJSON = eagerFromJSON;
exports.uploadResponseToJSON = uploadResponseToJSON;
exports.uploadResponseFromJSON = uploadResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.UploadResponseImageMetadata$inboundSchema = z.object({});
/** @internal */
exports.UploadResponseImageMetadata$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 UploadResponseImageMetadata$;
(function (UploadResponseImageMetadata$) {
    /** @deprecated use `UploadResponseImageMetadata$inboundSchema` instead. */
    UploadResponseImageMetadata$.inboundSchema = exports.UploadResponseImageMetadata$inboundSchema;
    /** @deprecated use `UploadResponseImageMetadata$outboundSchema` instead. */
    UploadResponseImageMetadata$.outboundSchema = exports.UploadResponseImageMetadata$outboundSchema;
})(UploadResponseImageMetadata$ || (exports.UploadResponseImageMetadata$ = UploadResponseImageMetadata$ = {}));
function uploadResponseImageMetadataToJSON(uploadResponseImageMetadata) {
    return JSON.stringify(exports.UploadResponseImageMetadata$outboundSchema.parse(uploadResponseImageMetadata));
}
function uploadResponseImageMetadataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadResponseImageMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadResponseImageMetadata' from JSON`);
}
/** @internal */
exports.Eager$inboundSchema = z
    .object({
    transformation: z.string().optional(),
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    bytes: z.number().int().optional(),
    format: z.string().optional(),
    url: z.string().optional(),
    secure_url: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "secure_url": "secureUrl",
    });
});
/** @internal */
exports.Eager$outboundSchema = z.object({
    transformation: z.string().optional(),
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    bytes: z.number().int().optional(),
    format: z.string().optional(),
    url: z.string().optional(),
    secureUrl: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        secureUrl: "secure_url",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Eager$;
(function (Eager$) {
    /** @deprecated use `Eager$inboundSchema` instead. */
    Eager$.inboundSchema = exports.Eager$inboundSchema;
    /** @deprecated use `Eager$outboundSchema` instead. */
    Eager$.outboundSchema = exports.Eager$outboundSchema;
})(Eager$ || (exports.Eager$ = Eager$ = {}));
function eagerToJSON(eager) {
    return JSON.stringify(exports.Eager$outboundSchema.parse(eager));
}
function eagerFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Eager$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Eager' from JSON`);
}
/** @internal */
exports.UploadResponse$inboundSchema = z.object({
    url: z.string().optional(),
    secure_url: z.string().optional(),
    public_id: z.string().optional(),
    version: z.number().int().optional(),
    version_id: z.string().optional(),
    signature: z.string().optional(),
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    asset_id: z.string().optional(),
    format: z.string().optional(),
    resource_type: z.string().optional(),
    created_at: z.string().optional(),
    tags: z.array(z.string()).optional(),
    pages: z.number().int().optional(),
    bytes: z.number().int().optional(),
    type: z.string().optional(),
    etag: z.string().optional(),
    placeholder: z.boolean().optional(),
    original_filename: z.string().optional(),
    image_metadata: z.lazy(() => exports.UploadResponseImageMetadata$inboundSchema)
        .optional(),
    illustration_score: z.number().optional(),
    semi_transparent: z.boolean().optional(),
    grayscale: z.boolean().optional(),
    eager: z.array(z.lazy(() => exports.Eager$inboundSchema)).optional(),
    api_key: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "secure_url": "secureUrl",
        "public_id": "publicId",
        "version_id": "versionId",
        "asset_id": "assetId",
        "resource_type": "resourceType",
        "created_at": "createdAt",
        "original_filename": "originalFilename",
        "image_metadata": "imageMetadata",
        "illustration_score": "illustrationScore",
        "semi_transparent": "semiTransparent",
        "api_key": "apiKey",
    });
});
/** @internal */
exports.UploadResponse$outboundSchema = z.object({
    url: z.string().optional(),
    secureUrl: z.string().optional(),
    publicId: z.string().optional(),
    version: z.number().int().optional(),
    versionId: z.string().optional(),
    signature: z.string().optional(),
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    assetId: z.string().optional(),
    format: z.string().optional(),
    resourceType: z.string().optional(),
    createdAt: z.string().optional(),
    tags: z.array(z.string()).optional(),
    pages: z.number().int().optional(),
    bytes: z.number().int().optional(),
    type: z.string().optional(),
    etag: z.string().optional(),
    placeholder: z.boolean().optional(),
    originalFilename: z.string().optional(),
    imageMetadata: z.lazy(() => exports.UploadResponseImageMetadata$outboundSchema)
        .optional(),
    illustrationScore: z.number().optional(),
    semiTransparent: z.boolean().optional(),
    grayscale: z.boolean().optional(),
    eager: z.array(z.lazy(() => exports.Eager$outboundSchema)).optional(),
    apiKey: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        secureUrl: "secure_url",
        publicId: "public_id",
        versionId: "version_id",
        assetId: "asset_id",
        resourceType: "resource_type",
        createdAt: "created_at",
        originalFilename: "original_filename",
        imageMetadata: "image_metadata",
        illustrationScore: "illustration_score",
        semiTransparent: "semi_transparent",
        apiKey: "api_key",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UploadResponse$;
(function (UploadResponse$) {
    /** @deprecated use `UploadResponse$inboundSchema` instead. */
    UploadResponse$.inboundSchema = exports.UploadResponse$inboundSchema;
    /** @deprecated use `UploadResponse$outboundSchema` instead. */
    UploadResponse$.outboundSchema = exports.UploadResponse$outboundSchema;
})(UploadResponse$ || (exports.UploadResponse$ = UploadResponse$ = {}));
function uploadResponseToJSON(uploadResponse) {
    return JSON.stringify(exports.UploadResponse$outboundSchema.parse(uploadResponse));
}
function uploadResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadResponse' from JSON`);
}
//# sourceMappingURL=uploadresponse.js.map