getresourcebypublicidop.ts•3.73 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { ApiError, ApiError$zodSchema } from "./apierror.js";
import {
ExtendedStorageType,
ExtendedStorageType$zodSchema,
} from "./extendedstoragetype.js";
import { Info, Info$zodSchema } from "./info.js";
import { ResourceType, ResourceType$zodSchema } from "./resourcetype.js";
export type GetResourceByPublicIdGlobals = { cloud_name?: string | undefined };
export const GetResourceByPublicIdGlobals$zodSchema: z.ZodType<
GetResourceByPublicIdGlobals,
z.ZodTypeDef,
unknown
> = z.object({
cloud_name: z.string().describe("The cloud name of your product environment.")
.optional(),
});
export type GetResourceByPublicIdRequest = {
resource_type: ResourceType;
type: ExtendedStorageType;
public_id: string;
colors?: boolean | undefined;
media_metadata?: boolean | undefined;
faces?: boolean | undefined;
quality_analysis?: boolean | undefined;
accessibility_analysis?: boolean | undefined;
pages?: boolean | undefined;
phash?: boolean | undefined;
coordinates?: boolean | undefined;
versions?: boolean | undefined;
max_results?: number | undefined;
derived_next_cursor?: string | undefined;
};
export const GetResourceByPublicIdRequest$zodSchema: z.ZodType<
GetResourceByPublicIdRequest,
z.ZodTypeDef,
unknown
> = z.object({
accessibility_analysis: z.boolean().default(false).describe(
"Whether to return accessibility analysis scores for the image. Default: false.",
),
colors: z.boolean().default(false).describe(
"Whether to include color information (predominant colors and histogram of 32 leading colors). Default: false.",
),
coordinates: z.boolean().default(false).describe(
"Whether to include previously specified custom cropping coordinates and faces coordinates. Default: false.",
),
derived_next_cursor: z.string().describe(
"The cursor for the next page of derived assets when there are more derived images than max_results.",
).optional(),
faces: z.boolean().default(false).describe(
"Whether to include a list of coordinates of detected faces. Default: false.",
),
max_results: z.number().int().default(10).describe(
"Maximum number of derived assets to return. Default: 10.",
),
media_metadata: z.boolean().default(false).describe(
"Whether to include IPTC, XMP, and detailed Exif metadata in the response. Default: false.",
),
pages: z.boolean().default(false).describe(
"Whether to report the number of pages in multi-page documents (e.g., PDF). Default: false.",
),
phash: z.boolean().default(false).describe(
"Whether to include the perceptual hash (pHash) of the uploaded photo for image similarity detection. Default: false.",
),
public_id: z.string().describe("The public ID of the asset."),
quality_analysis: z.boolean().default(false).describe(
"Whether to return quality analysis scores for the image. Default: false.",
),
resource_type: ResourceType$zodSchema,
type: ExtendedStorageType$zodSchema,
versions: z.boolean().default(false).describe(
"Whether to include details of all the backed up versions of the asset. Default: false.",
),
});
export type GetResourceByPublicIdResponse = {
ContentType: string;
StatusCode: number;
RawResponse: Response;
info?: Info | undefined;
api_error?: ApiError | undefined;
};
export const GetResourceByPublicIdResponse$zodSchema: z.ZodType<
GetResourceByPublicIdResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
RawResponse: z.instanceof(Response),
StatusCode: z.number().int(),
api_error: ApiError$zodSchema.optional(),
info: Info$zodSchema.optional(),
});