/*
 * 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 Info$inboundSchema = z
    .object({
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    crop: z.string().optional(),
    gravity: z.string().optional(),
});
/** @internal */
export const Info$outboundSchema = z.object({
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    crop: z.string().optional(),
    gravity: z.string().optional(),
});
/**
 * @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`);
}
/** @internal */
export const Derived$inboundSchema = z.object({
    public_id: z.string().optional(),
    resource_type: z.string().optional(),
    type: z.string().optional(),
    format: z.string().optional(),
    url: z.string().optional(),
    secure_url: z.string().optional(),
    bytes: z.number().int().optional(),
    id: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "public_id": "publicId",
        "resource_type": "resourceType",
        "secure_url": "secureUrl",
    });
});
/** @internal */
export const Derived$outboundSchema = z.object({
    publicId: z.string().optional(),
    resourceType: z.string().optional(),
    type: z.string().optional(),
    format: z.string().optional(),
    url: z.string().optional(),
    secureUrl: z.string().optional(),
    bytes: z.number().int().optional(),
    id: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        publicId: "public_id",
        resourceType: "resource_type",
        secureUrl: "secure_url",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Derived$;
(function (Derived$) {
    /** @deprecated use `Derived$inboundSchema` instead. */
    Derived$.inboundSchema = Derived$inboundSchema;
    /** @deprecated use `Derived$outboundSchema` instead. */
    Derived$.outboundSchema = Derived$outboundSchema;
})(Derived$ || (Derived$ = {}));
export function derivedToJSON(derived) {
    return JSON.stringify(Derived$outboundSchema.parse(derived));
}
export function derivedFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Derived$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Derived' from JSON`);
}
/** @internal */
export const TransformationInfo$inboundSchema = z.object({
    name: z.string().optional(),
    allowed_for_strict: z.boolean().optional(),
    used: z.boolean().optional(),
    named: z.boolean().optional(),
    info: z.array(z.lazy(() => Info$inboundSchema)).optional(),
    derived: z.array(z.lazy(() => Derived$inboundSchema)).optional(),
    next_cursor: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "allowed_for_strict": "allowedForStrict",
        "next_cursor": "nextCursor",
    });
});
/** @internal */
export const TransformationInfo$outboundSchema = z.object({
    name: z.string().optional(),
    allowedForStrict: z.boolean().optional(),
    used: z.boolean().optional(),
    named: z.boolean().optional(),
    info: z.array(z.lazy(() => Info$outboundSchema)).optional(),
    derived: z.array(z.lazy(() => Derived$outboundSchema)).optional(),
    nextCursor: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        allowedForStrict: "allowed_for_strict",
        nextCursor: "next_cursor",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TransformationInfo$;
(function (TransformationInfo$) {
    /** @deprecated use `TransformationInfo$inboundSchema` instead. */
    TransformationInfo$.inboundSchema = TransformationInfo$inboundSchema;
    /** @deprecated use `TransformationInfo$outboundSchema` instead. */
    TransformationInfo$.outboundSchema = TransformationInfo$outboundSchema;
})(TransformationInfo$ || (TransformationInfo$ = {}));
export function transformationInfoToJSON(transformationInfo) {
    return JSON.stringify(TransformationInfo$outboundSchema.parse(transformationInfo));
}
export function transformationInfoFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TransformationInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransformationInfo' from JSON`);
}
//# sourceMappingURL=transformationinfo.js.map