/*
 * 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";
/**
 * The type of resource to create. Must be "image" for text generation.
 */
export const TextResourceType = {
    Image: "image",
};
/**
 * Text alignment (left, center, right, justify).
 */
export const TextAlign = {
    Left: "left",
    Center: "center",
    Right: "right",
    Justify: "justify",
};
/**
 * Whether to use a normal or bold font.
 */
export const FontWeight = {
    Normal: "normal",
    Bold: "bold",
};
/**
 * Whether to use a normal or italic font.
 */
export const FontStyle = {
    Normal: "normal",
    Italic: "italic",
};
/**
 * Text decoration style.
 */
export const TextDecoration = {
    None: "none",
    Underline: "underline",
};
/** @internal */
export const TextGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
export const TextGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return 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.
 */
export var TextGlobals$;
(function (TextGlobals$) {
    /** @deprecated use `TextGlobals$inboundSchema` instead. */
    TextGlobals$.inboundSchema = TextGlobals$inboundSchema;
    /** @deprecated use `TextGlobals$outboundSchema` instead. */
    TextGlobals$.outboundSchema = TextGlobals$outboundSchema;
})(TextGlobals$ || (TextGlobals$ = {}));
export function textGlobalsToJSON(textGlobals) {
    return JSON.stringify(TextGlobals$outboundSchema.parse(textGlobals));
}
export function textGlobalsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TextGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextGlobals' from JSON`);
}
/** @internal */
export const TextResourceType$inboundSchema = z.nativeEnum(TextResourceType);
/** @internal */
export const TextResourceType$outboundSchema = TextResourceType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TextResourceType$;
(function (TextResourceType$) {
    /** @deprecated use `TextResourceType$inboundSchema` instead. */
    TextResourceType$.inboundSchema = TextResourceType$inboundSchema;
    /** @deprecated use `TextResourceType$outboundSchema` instead. */
    TextResourceType$.outboundSchema = TextResourceType$outboundSchema;
})(TextResourceType$ || (TextResourceType$ = {}));
/** @internal */
export const TextAlign$inboundSchema = z
    .nativeEnum(TextAlign);
/** @internal */
export const TextAlign$outboundSchema = TextAlign$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TextAlign$;
(function (TextAlign$) {
    /** @deprecated use `TextAlign$inboundSchema` instead. */
    TextAlign$.inboundSchema = TextAlign$inboundSchema;
    /** @deprecated use `TextAlign$outboundSchema` instead. */
    TextAlign$.outboundSchema = TextAlign$outboundSchema;
})(TextAlign$ || (TextAlign$ = {}));
/** @internal */
export const FontWeight$inboundSchema = z
    .nativeEnum(FontWeight);
/** @internal */
export const FontWeight$outboundSchema = FontWeight$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var FontWeight$;
(function (FontWeight$) {
    /** @deprecated use `FontWeight$inboundSchema` instead. */
    FontWeight$.inboundSchema = FontWeight$inboundSchema;
    /** @deprecated use `FontWeight$outboundSchema` instead. */
    FontWeight$.outboundSchema = FontWeight$outboundSchema;
})(FontWeight$ || (FontWeight$ = {}));
/** @internal */
export const FontStyle$inboundSchema = z
    .nativeEnum(FontStyle);
/** @internal */
export const FontStyle$outboundSchema = FontStyle$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var FontStyle$;
(function (FontStyle$) {
    /** @deprecated use `FontStyle$inboundSchema` instead. */
    FontStyle$.inboundSchema = FontStyle$inboundSchema;
    /** @deprecated use `FontStyle$outboundSchema` instead. */
    FontStyle$.outboundSchema = FontStyle$outboundSchema;
})(FontStyle$ || (FontStyle$ = {}));
/** @internal */
export const TextDecoration$inboundSchema = z.nativeEnum(TextDecoration);
/** @internal */
export const TextDecoration$outboundSchema = TextDecoration$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TextDecoration$;
(function (TextDecoration$) {
    /** @deprecated use `TextDecoration$inboundSchema` instead. */
    TextDecoration$.inboundSchema = TextDecoration$inboundSchema;
    /** @deprecated use `TextDecoration$outboundSchema` instead. */
    TextDecoration$.outboundSchema = TextDecoration$outboundSchema;
})(TextDecoration$ || (TextDecoration$ = {}));
/** @internal */
export const 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: TextAlign$inboundSchema.optional(),
    font_weight: FontWeight$inboundSchema.default("normal"),
    font_style: FontStyle$inboundSchema.default("normal"),
    background: z.string().default("transparent"),
    opacity: z.number().int().default(100),
    text_decoration: TextDecoration$inboundSchema.default("none"),
    line_spacing: z.number().int().optional(),
}).transform((v) => {
    return 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 */
export const 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: TextAlign$outboundSchema.optional(),
    fontWeight: FontWeight$outboundSchema.default("normal"),
    fontStyle: FontStyle$outboundSchema.default("normal"),
    background: z.string().default("transparent"),
    opacity: z.number().int().default(100),
    textDecoration: TextDecoration$outboundSchema.default("none"),
    lineSpacing: z.number().int().optional(),
}).transform((v) => {
    return 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.
 */
export var TextRequestBody$;
(function (TextRequestBody$) {
    /** @deprecated use `TextRequestBody$inboundSchema` instead. */
    TextRequestBody$.inboundSchema = TextRequestBody$inboundSchema;
    /** @deprecated use `TextRequestBody$outboundSchema` instead. */
    TextRequestBody$.outboundSchema = TextRequestBody$outboundSchema;
})(TextRequestBody$ || (TextRequestBody$ = {}));
export function textRequestBodyToJSON(textRequestBody) {
    return JSON.stringify(TextRequestBody$outboundSchema.parse(textRequestBody));
}
export function textRequestBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TextRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextRequestBody' from JSON`);
}
/** @internal */
export const TextRequest$inboundSchema = z.object({
    resource_type: TextResourceType$inboundSchema,
    RequestBody: z.lazy(() => TextRequestBody$inboundSchema),
}).transform((v) => {
    return remap$(v, {
        "resource_type": "resourceType",
        "RequestBody": "requestBody",
    });
});
/** @internal */
export const TextRequest$outboundSchema = z.object({
    resourceType: TextResourceType$outboundSchema,
    requestBody: z.lazy(() => TextRequestBody$outboundSchema),
}).transform((v) => {
    return 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.
 */
export var TextRequest$;
(function (TextRequest$) {
    /** @deprecated use `TextRequest$inboundSchema` instead. */
    TextRequest$.inboundSchema = TextRequest$inboundSchema;
    /** @deprecated use `TextRequest$outboundSchema` instead. */
    TextRequest$.outboundSchema = TextRequest$outboundSchema;
})(TextRequest$ || (TextRequest$ = {}));
export function textRequestToJSON(textRequest) {
    return JSON.stringify(TextRequest$outboundSchema.parse(textRequest));
}
export function textRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TextRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextRequest' from JSON`);
}
/** @internal */
export const AccessControl$inboundSchema = z.object({});
/** @internal */
export const 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.
 */
export var AccessControl$;
(function (AccessControl$) {
    /** @deprecated use `AccessControl$inboundSchema` instead. */
    AccessControl$.inboundSchema = AccessControl$inboundSchema;
    /** @deprecated use `AccessControl$outboundSchema` instead. */
    AccessControl$.outboundSchema = AccessControl$outboundSchema;
})(AccessControl$ || (AccessControl$ = {}));
export function accessControlToJSON(accessControl) {
    return JSON.stringify(AccessControl$outboundSchema.parse(accessControl));
}
export function accessControlFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AccessControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccessControl' from JSON`);
}
/** @internal */
export const Region$inboundSchema = z
    .object({});
/** @internal */
export const 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.
 */
export var Region$;
(function (Region$) {
    /** @deprecated use `Region$inboundSchema` instead. */
    Region$.inboundSchema = Region$inboundSchema;
    /** @deprecated use `Region$outboundSchema` instead. */
    Region$.outboundSchema = Region$outboundSchema;
})(Region$ || (Region$ = {}));
export function regionToJSON(region) {
    return JSON.stringify(Region$outboundSchema.parse(region));
}
export function regionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Region$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Region' from JSON`);
}
/** @internal */
export const TextModeration$inboundSchema = z.object({});
/** @internal */
export const 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.
 */
export var TextModeration$;
(function (TextModeration$) {
    /** @deprecated use `TextModeration$inboundSchema` instead. */
    TextModeration$.inboundSchema = TextModeration$inboundSchema;
    /** @deprecated use `TextModeration$outboundSchema` instead. */
    TextModeration$.outboundSchema = TextModeration$outboundSchema;
})(TextModeration$ || (TextModeration$ = {}));
export function textModerationToJSON(textModeration) {
    return JSON.stringify(TextModeration$outboundSchema.parse(textModeration));
}
export function textModerationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TextModeration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextModeration' from JSON`);
}
/** @internal */
export const Info$inboundSchema = z
    .object({});
/** @internal */
export const 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.
 */
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 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(() => AccessControl$inboundSchema)).optional(),
    regions: z.array(z.lazy(() => Region$inboundSchema)).optional(),
    moderation: z.lazy(() => TextModeration$inboundSchema).optional(),
    info: z.lazy(() => Info$inboundSchema).optional(),
}).transform((v) => {
    return 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 */
export const 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(() => AccessControl$outboundSchema)).optional(),
    regions: z.array(z.lazy(() => Region$outboundSchema)).optional(),
    moderation: z.lazy(() => TextModeration$outboundSchema).optional(),
    info: z.lazy(() => Info$outboundSchema).optional(),
}).transform((v) => {
    return 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.
 */
export var TextResponse$;
(function (TextResponse$) {
    /** @deprecated use `TextResponse$inboundSchema` instead. */
    TextResponse$.inboundSchema = TextResponse$inboundSchema;
    /** @deprecated use `TextResponse$outboundSchema` instead. */
    TextResponse$.outboundSchema = TextResponse$outboundSchema;
})(TextResponse$ || (TextResponse$ = {}));
export function textResponseToJSON(textResponse) {
    return JSON.stringify(TextResponse$outboundSchema.parse(textResponse));
}
export function textResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TextResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextResponse' from JSON`);
}
//# sourceMappingURL=text.js.map