"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.TextResponse$ = exports.TextResponse$outboundSchema = exports.TextResponse$inboundSchema = exports.Info$ = exports.Info$outboundSchema = exports.Info$inboundSchema = exports.TextModeration$ = exports.TextModeration$outboundSchema = exports.TextModeration$inboundSchema = exports.Region$ = exports.Region$outboundSchema = exports.Region$inboundSchema = exports.AccessControl$ = exports.AccessControl$outboundSchema = exports.AccessControl$inboundSchema = exports.TextRequest$ = exports.TextRequest$outboundSchema = exports.TextRequest$inboundSchema = exports.TextRequestBody$ = exports.TextRequestBody$outboundSchema = exports.TextRequestBody$inboundSchema = exports.TextDecoration$ = exports.TextDecoration$outboundSchema = exports.TextDecoration$inboundSchema = exports.FontStyle$ = exports.FontStyle$outboundSchema = exports.FontStyle$inboundSchema = exports.FontWeight$ = exports.FontWeight$outboundSchema = exports.FontWeight$inboundSchema = exports.TextAlign$ = exports.TextAlign$outboundSchema = exports.TextAlign$inboundSchema = exports.TextResourceType$ = exports.TextResourceType$outboundSchema = exports.TextResourceType$inboundSchema = exports.TextGlobals$ = exports.TextGlobals$outboundSchema = exports.TextGlobals$inboundSchema = exports.TextDecoration = exports.FontStyle = exports.FontWeight = exports.TextAlign = exports.TextResourceType = void 0;
exports.textGlobalsToJSON = textGlobalsToJSON;
exports.textGlobalsFromJSON = textGlobalsFromJSON;
exports.textRequestBodyToJSON = textRequestBodyToJSON;
exports.textRequestBodyFromJSON = textRequestBodyFromJSON;
exports.textRequestToJSON = textRequestToJSON;
exports.textRequestFromJSON = textRequestFromJSON;
exports.accessControlToJSON = accessControlToJSON;
exports.accessControlFromJSON = accessControlFromJSON;
exports.regionToJSON = regionToJSON;
exports.regionFromJSON = regionFromJSON;
exports.textModerationToJSON = textModerationToJSON;
exports.textModerationFromJSON = textModerationFromJSON;
exports.infoToJSON = infoToJSON;
exports.infoFromJSON = infoFromJSON;
exports.textResponseToJSON = textResponseToJSON;
exports.textResponseFromJSON = textResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The type of resource to create. Must be "image" for text generation.
 */
exports.TextResourceType = {
    Image: "image",
};
/**
 * Text alignment (left, center, right, justify).
 */
exports.TextAlign = {
    Left: "left",
    Center: "center",
    Right: "right",
    Justify: "justify",
};
/**
 * Whether to use a normal or bold font.
 */
exports.FontWeight = {
    Normal: "normal",
    Bold: "bold",
};
/**
 * Whether to use a normal or italic font.
 */
exports.FontStyle = {
    Normal: "normal",
    Italic: "italic",
};
/**
 * Text decoration style.
 */
exports.TextDecoration = {
    None: "none",
    Underline: "underline",
};
/** @internal */
exports.TextGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.TextGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.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.
 */
var TextGlobals$;
(function (TextGlobals$) {
    /** @deprecated use `TextGlobals$inboundSchema` instead. */
    TextGlobals$.inboundSchema = exports.TextGlobals$inboundSchema;
    /** @deprecated use `TextGlobals$outboundSchema` instead. */
    TextGlobals$.outboundSchema = exports.TextGlobals$outboundSchema;
})(TextGlobals$ || (exports.TextGlobals$ = TextGlobals$ = {}));
function textGlobalsToJSON(textGlobals) {
    return JSON.stringify(exports.TextGlobals$outboundSchema.parse(textGlobals));
}
function textGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TextGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextGlobals' from JSON`);
}
/** @internal */
exports.TextResourceType$inboundSchema = z.nativeEnum(exports.TextResourceType);
/** @internal */
exports.TextResourceType$outboundSchema = exports.TextResourceType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TextResourceType$;
(function (TextResourceType$) {
    /** @deprecated use `TextResourceType$inboundSchema` instead. */
    TextResourceType$.inboundSchema = exports.TextResourceType$inboundSchema;
    /** @deprecated use `TextResourceType$outboundSchema` instead. */
    TextResourceType$.outboundSchema = exports.TextResourceType$outboundSchema;
})(TextResourceType$ || (exports.TextResourceType$ = TextResourceType$ = {}));
/** @internal */
exports.TextAlign$inboundSchema = z
    .nativeEnum(exports.TextAlign);
/** @internal */
exports.TextAlign$outboundSchema = exports.TextAlign$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TextAlign$;
(function (TextAlign$) {
    /** @deprecated use `TextAlign$inboundSchema` instead. */
    TextAlign$.inboundSchema = exports.TextAlign$inboundSchema;
    /** @deprecated use `TextAlign$outboundSchema` instead. */
    TextAlign$.outboundSchema = exports.TextAlign$outboundSchema;
})(TextAlign$ || (exports.TextAlign$ = TextAlign$ = {}));
/** @internal */
exports.FontWeight$inboundSchema = z
    .nativeEnum(exports.FontWeight);
/** @internal */
exports.FontWeight$outboundSchema = exports.FontWeight$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var FontWeight$;
(function (FontWeight$) {
    /** @deprecated use `FontWeight$inboundSchema` instead. */
    FontWeight$.inboundSchema = exports.FontWeight$inboundSchema;
    /** @deprecated use `FontWeight$outboundSchema` instead. */
    FontWeight$.outboundSchema = exports.FontWeight$outboundSchema;
})(FontWeight$ || (exports.FontWeight$ = FontWeight$ = {}));
/** @internal */
exports.FontStyle$inboundSchema = z
    .nativeEnum(exports.FontStyle);
/** @internal */
exports.FontStyle$outboundSchema = exports.FontStyle$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var FontStyle$;
(function (FontStyle$) {
    /** @deprecated use `FontStyle$inboundSchema` instead. */
    FontStyle$.inboundSchema = exports.FontStyle$inboundSchema;
    /** @deprecated use `FontStyle$outboundSchema` instead. */
    FontStyle$.outboundSchema = exports.FontStyle$outboundSchema;
})(FontStyle$ || (exports.FontStyle$ = FontStyle$ = {}));
/** @internal */
exports.TextDecoration$inboundSchema = z.nativeEnum(exports.TextDecoration);
/** @internal */
exports.TextDecoration$outboundSchema = exports.TextDecoration$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TextDecoration$;
(function (TextDecoration$) {
    /** @deprecated use `TextDecoration$inboundSchema` instead. */
    TextDecoration$.inboundSchema = exports.TextDecoration$inboundSchema;
    /** @deprecated use `TextDecoration$outboundSchema` instead. */
    TextDecoration$.outboundSchema = exports.TextDecoration$outboundSchema;
})(TextDecoration$ || (exports.TextDecoration$ = TextDecoration$ = {}));
/** @internal */
exports.TextRequestBody$inboundSchema = z.object({
    text: z.string(),
    public_id: z.string().optional(),
    font_family: z.string().optional(),
    font_size: z.number().int().default(12),
    font_color: z.string().default("black"),
    text_align: exports.TextAlign$inboundSchema.optional(),
    font_weight: exports.FontWeight$inboundSchema.default("normal"),
    font_style: exports.FontStyle$inboundSchema.default("normal"),
    background: z.string().default("transparent"),
    opacity: z.number().int().default(100),
    text_decoration: exports.TextDecoration$inboundSchema.default("none"),
    line_spacing: z.number().int().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "public_id": "publicId",
        "font_family": "fontFamily",
        "font_size": "fontSize",
        "font_color": "fontColor",
        "text_align": "textAlign",
        "font_weight": "fontWeight",
        "font_style": "fontStyle",
        "text_decoration": "textDecoration",
        "line_spacing": "lineSpacing",
    });
});
/** @internal */
exports.TextRequestBody$outboundSchema = z.object({
    text: z.string(),
    publicId: z.string().optional(),
    fontFamily: z.string().optional(),
    fontSize: z.number().int().default(12),
    fontColor: z.string().default("black"),
    textAlign: exports.TextAlign$outboundSchema.optional(),
    fontWeight: exports.FontWeight$outboundSchema.default("normal"),
    fontStyle: exports.FontStyle$outboundSchema.default("normal"),
    background: z.string().default("transparent"),
    opacity: z.number().int().default(100),
    textDecoration: exports.TextDecoration$outboundSchema.default("none"),
    lineSpacing: z.number().int().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        publicId: "public_id",
        fontFamily: "font_family",
        fontSize: "font_size",
        fontColor: "font_color",
        textAlign: "text_align",
        fontWeight: "font_weight",
        fontStyle: "font_style",
        textDecoration: "text_decoration",
        lineSpacing: "line_spacing",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TextRequestBody$;
(function (TextRequestBody$) {
    /** @deprecated use `TextRequestBody$inboundSchema` instead. */
    TextRequestBody$.inboundSchema = exports.TextRequestBody$inboundSchema;
    /** @deprecated use `TextRequestBody$outboundSchema` instead. */
    TextRequestBody$.outboundSchema = exports.TextRequestBody$outboundSchema;
})(TextRequestBody$ || (exports.TextRequestBody$ = TextRequestBody$ = {}));
function textRequestBodyToJSON(textRequestBody) {
    return JSON.stringify(exports.TextRequestBody$outboundSchema.parse(textRequestBody));
}
function textRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TextRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextRequestBody' from JSON`);
}
/** @internal */
exports.TextRequest$inboundSchema = z.object({
    resource_type: exports.TextResourceType$inboundSchema,
    RequestBody: z.lazy(() => exports.TextRequestBody$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "resource_type": "resourceType",
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.TextRequest$outboundSchema = z.object({
    resourceType: exports.TextResourceType$outboundSchema,
    requestBody: z.lazy(() => exports.TextRequestBody$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        resourceType: "resource_type",
        requestBody: "RequestBody",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TextRequest$;
(function (TextRequest$) {
    /** @deprecated use `TextRequest$inboundSchema` instead. */
    TextRequest$.inboundSchema = exports.TextRequest$inboundSchema;
    /** @deprecated use `TextRequest$outboundSchema` instead. */
    TextRequest$.outboundSchema = exports.TextRequest$outboundSchema;
})(TextRequest$ || (exports.TextRequest$ = TextRequest$ = {}));
function textRequestToJSON(textRequest) {
    return JSON.stringify(exports.TextRequest$outboundSchema.parse(textRequest));
}
function textRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TextRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextRequest' from JSON`);
}
/** @internal */
exports.AccessControl$inboundSchema = z.object({});
/** @internal */
exports.AccessControl$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 AccessControl$;
(function (AccessControl$) {
    /** @deprecated use `AccessControl$inboundSchema` instead. */
    AccessControl$.inboundSchema = exports.AccessControl$inboundSchema;
    /** @deprecated use `AccessControl$outboundSchema` instead. */
    AccessControl$.outboundSchema = exports.AccessControl$outboundSchema;
})(AccessControl$ || (exports.AccessControl$ = AccessControl$ = {}));
function accessControlToJSON(accessControl) {
    return JSON.stringify(exports.AccessControl$outboundSchema.parse(accessControl));
}
function accessControlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccessControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccessControl' from JSON`);
}
/** @internal */
exports.Region$inboundSchema = z
    .object({});
/** @internal */
exports.Region$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 Region$;
(function (Region$) {
    /** @deprecated use `Region$inboundSchema` instead. */
    Region$.inboundSchema = exports.Region$inboundSchema;
    /** @deprecated use `Region$outboundSchema` instead. */
    Region$.outboundSchema = exports.Region$outboundSchema;
})(Region$ || (exports.Region$ = Region$ = {}));
function regionToJSON(region) {
    return JSON.stringify(exports.Region$outboundSchema.parse(region));
}
function regionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Region$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Region' from JSON`);
}
/** @internal */
exports.TextModeration$inboundSchema = z.object({});
/** @internal */
exports.TextModeration$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 TextModeration$;
(function (TextModeration$) {
    /** @deprecated use `TextModeration$inboundSchema` instead. */
    TextModeration$.inboundSchema = exports.TextModeration$inboundSchema;
    /** @deprecated use `TextModeration$outboundSchema` instead. */
    TextModeration$.outboundSchema = exports.TextModeration$outboundSchema;
})(TextModeration$ || (exports.TextModeration$ = TextModeration$ = {}));
function textModerationToJSON(textModeration) {
    return JSON.stringify(exports.TextModeration$outboundSchema.parse(textModeration));
}
function textModerationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TextModeration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextModeration' from JSON`);
}
/** @internal */
exports.Info$inboundSchema = z
    .object({});
/** @internal */
exports.Info$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 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`);
}
/** @internal */
exports.TextResponse$inboundSchema = z.object({
    asset_id: z.string(),
    public_id: z.string(),
    version: z.number().int(),
    version_id: z.string(),
    signature: z.string(),
    width: z.number().int(),
    height: z.number().int(),
    format: z.string(),
    resource_type: z.string(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    tags: z.array(z.string()).optional(),
    pages: z.number().int().optional(),
    bytes: z.number().int(),
    type: z.string(),
    etag: z.string().optional(),
    placeholder: z.boolean().optional(),
    url: z.string(),
    secure_url: z.string(),
    display_name: z.string().optional(),
    access_mode: z.string().optional(),
    access_control: z.array(z.lazy(() => exports.AccessControl$inboundSchema)).optional(),
    regions: z.array(z.lazy(() => exports.Region$inboundSchema)).optional(),
    moderation: z.lazy(() => exports.TextModeration$inboundSchema).optional(),
    info: z.lazy(() => exports.Info$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "asset_id": "assetId",
        "public_id": "publicId",
        "version_id": "versionId",
        "resource_type": "resourceType",
        "created_at": "createdAt",
        "secure_url": "secureUrl",
        "display_name": "displayName",
        "access_mode": "accessMode",
        "access_control": "accessControl",
    });
});
/** @internal */
exports.TextResponse$outboundSchema = z.object({
    assetId: z.string(),
    publicId: z.string(),
    version: z.number().int(),
    versionId: z.string(),
    signature: z.string(),
    width: z.number().int(),
    height: z.number().int(),
    format: z.string(),
    resourceType: z.string(),
    createdAt: z.date().transform(v => v.toISOString()),
    tags: z.array(z.string()).optional(),
    pages: z.number().int().optional(),
    bytes: z.number().int(),
    type: z.string(),
    etag: z.string().optional(),
    placeholder: z.boolean().optional(),
    url: z.string(),
    secureUrl: z.string(),
    displayName: z.string().optional(),
    accessMode: z.string().optional(),
    accessControl: z.array(z.lazy(() => exports.AccessControl$outboundSchema)).optional(),
    regions: z.array(z.lazy(() => exports.Region$outboundSchema)).optional(),
    moderation: z.lazy(() => exports.TextModeration$outboundSchema).optional(),
    info: z.lazy(() => exports.Info$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        assetId: "asset_id",
        publicId: "public_id",
        versionId: "version_id",
        resourceType: "resource_type",
        createdAt: "created_at",
        secureUrl: "secure_url",
        displayName: "display_name",
        accessMode: "access_mode",
        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 TextResponse$;
(function (TextResponse$) {
    /** @deprecated use `TextResponse$inboundSchema` instead. */
    TextResponse$.inboundSchema = exports.TextResponse$inboundSchema;
    /** @deprecated use `TextResponse$outboundSchema` instead. */
    TextResponse$.outboundSchema = exports.TextResponse$outboundSchema;
})(TextResponse$ || (exports.TextResponse$ = TextResponse$ = {}));
function textResponseToJSON(textResponse) {
    return JSON.stringify(exports.TextResponse$outboundSchema.parse(textResponse));
}
function textResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TextResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextResponse' from JSON`);
}
//# sourceMappingURL=text.js.map