downloadbackupassetop.ts•5.69 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
export type DownloadBackupAssetGlobals = { cloud_name?: string | undefined };
export const DownloadBackupAssetGlobals$zodSchema: z.ZodType<
DownloadBackupAssetGlobals,
z.ZodTypeDef,
unknown
> = z.object({
cloud_name: z.string().describe("The cloud name of your product environment.")
.optional(),
});
export type DownloadBackupAssetRequest = {
asset_id: string;
version_id: string;
api_key?: string | undefined;
signature?: string | undefined;
timestamp?: number | undefined;
};
export const DownloadBackupAssetRequest$zodSchema: z.ZodType<
DownloadBackupAssetRequest,
z.ZodTypeDef,
unknown
> = z.object({
api_key: z.string().describe(
"The API key to use for the request. This is automatically computed by the Cloudinary's SDKs.",
).optional(),
asset_id: z.string().describe(
"The asset ID of the resource. Must be a 32-character hexadecimal string.",
),
signature: z.string().describe(
"(Required for signed REST API calls) Used to authenticate the request and based on the parameters you use in the request. When using the Cloudinary SDKs for signed requests, the signature is automatically generated and added to the request. If you manually generate your own signed POST request, you need to manually generate the signature parameter and add it to the request together with the api_key and timestamp parameters.\n"
+ "",
).optional(),
timestamp: z.number().int().describe(
"The timestamp to use for the request in unix time. This is automatically computed by the Cloudinary's SDKs.",
).optional(),
version_id: z.string().describe(
"The version ID of the backup to download. Must be a 32-character hexadecimal string.",
),
});
export type NotFoundError = { message?: string | undefined };
export const NotFoundError$zodSchema: z.ZodType<
NotFoundError,
z.ZodTypeDef,
unknown
> = z.object({
message: z.string().optional(),
});
/**
* Version not found
*/
export type DownloadBackupAssetNotFoundResponseBody = {
error?: NotFoundError | undefined;
};
export const DownloadBackupAssetNotFoundResponseBody$zodSchema: z.ZodType<
DownloadBackupAssetNotFoundResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
error: z.lazy(() => NotFoundError$zodSchema).optional(),
}).describe("Version not found");
export type DownloadBackupAssetUnauthorizedError = {
message?: string | undefined;
http_code?: number | undefined;
};
export const DownloadBackupAssetUnauthorizedError$zodSchema: z.ZodType<
DownloadBackupAssetUnauthorizedError,
z.ZodTypeDef,
unknown
> = z.object({
http_code: z.number().int().optional(),
message: z.string().optional(),
});
/**
* Authentication failed
*/
export type DownloadBackupAssetUnauthorizedResponseBody = {
error?: DownloadBackupAssetUnauthorizedError | undefined;
};
export const DownloadBackupAssetUnauthorizedResponseBody$zodSchema: z.ZodType<
DownloadBackupAssetUnauthorizedResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
error: z.lazy(() => DownloadBackupAssetUnauthorizedError$zodSchema)
.optional(),
}).describe("Authentication failed");
export type BadRequestError = {
message?: string | undefined;
http_code?: number | undefined;
};
export const BadRequestError$zodSchema: z.ZodType<
BadRequestError,
z.ZodTypeDef,
unknown
> = z.object({
http_code: z.number().int().optional(),
message: z.string().optional(),
});
/**
* Bad request
*/
export type DownloadBackupAssetBadRequestResponseBody = {
error?: BadRequestError | undefined;
};
export const DownloadBackupAssetBadRequestResponseBody$zodSchema: z.ZodType<
DownloadBackupAssetBadRequestResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
error: z.lazy(() => BadRequestError$zodSchema).optional(),
}).describe("Bad request");
export type DownloadBackupAssetResponse = {
ContentType: string;
StatusCode: number;
RawResponse: Response;
twoHundredApplicationOctetStreamBytes?: Uint8Array | string | undefined;
twoHundredImageWildcardBytes?: Uint8Array | string | undefined;
twoHundredVideoWildcardBytes?: Uint8Array | string | undefined;
twoHundredTextPlainBytes?: Uint8Array | string | undefined;
fourHundredApplicationJsonObject?:
| DownloadBackupAssetBadRequestResponseBody
| undefined;
fourHundredAndOneApplicationJsonObject?:
| DownloadBackupAssetUnauthorizedResponseBody
| undefined;
fourHundredAndFourApplicationJsonObject?:
| DownloadBackupAssetNotFoundResponseBody
| undefined;
};
export const DownloadBackupAssetResponse$zodSchema: z.ZodType<
DownloadBackupAssetResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
RawResponse: z.instanceof(Response),
StatusCode: z.number().int(),
fourHundredAndFourApplicationJsonObject: z.lazy(() =>
DownloadBackupAssetNotFoundResponseBody$zodSchema
).optional(),
fourHundredAndOneApplicationJsonObject: z.lazy(() =>
DownloadBackupAssetUnauthorizedResponseBody$zodSchema
).optional(),
fourHundredApplicationJsonObject: z.lazy(() =>
DownloadBackupAssetBadRequestResponseBody$zodSchema
).optional(),
twoHundredApplicationOctetStreamBytes: z.string().base64().describe(
"Asset backup downloaded successfully",
).optional(),
twoHundredImageWildcardBytes: z.string().base64().describe(
"Asset backup downloaded successfully",
).optional(),
twoHundredTextPlainBytes: z.string().base64().describe(
"Asset backup downloaded successfully",
).optional(),
twoHundredVideoWildcardBytes: z.string().base64().describe(
"Asset backup downloaded successfully",
).optional(),
});