destroyassetop.ts•2.14 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { ApiError, ApiError$zodSchema } from "./apierror.js";
import { ResourceType, ResourceType$zodSchema } from "./resourcetype.js";
export type DestroyAssetGlobals = { cloud_name?: string | undefined };
export const DestroyAssetGlobals$zodSchema: z.ZodType<
DestroyAssetGlobals,
z.ZodTypeDef,
unknown
> = z.object({
cloud_name: z.string().describe("The cloud name of your product environment.")
.optional(),
});
export type DestroyAssetRequest = {
resource_type: ResourceType;
public_id: string;
invalidate?: boolean | undefined;
};
export const DestroyAssetRequest$zodSchema: z.ZodType<
DestroyAssetRequest,
z.ZodTypeDef,
unknown
> = z.object({
invalidate: z.boolean().default(false).describe(
"Whether to invalidate CDN cached copies of the asset",
),
public_id: z.string().describe("The public ID of the asset."),
resource_type: ResourceType$zodSchema,
});
/**
* Indicates successful deletion
*/
export const DestroyAssetResult$zodSchema = z.enum([
"ok",
]).describe("Indicates successful deletion");
export type DestroyAssetResult = z.infer<typeof DestroyAssetResult$zodSchema>;
/**
* Asset/resource destroyed successfully
*/
export type DestroyAssetResponseBody = {
result?: DestroyAssetResult | undefined;
};
export const DestroyAssetResponseBody$zodSchema: z.ZodType<
DestroyAssetResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
result: DestroyAssetResult$zodSchema.optional(),
}).describe("Asset/resource destroyed successfully");
export type DestroyAssetResponse = {
ContentType: string;
StatusCode: number;
RawResponse: Response;
object?: DestroyAssetResponseBody | undefined;
api_error?: ApiError | undefined;
};
export const DestroyAssetResponse$zodSchema: z.ZodType<
DestroyAssetResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
RawResponse: z.instanceof(Response),
StatusCode: z.number().int(),
api_error: ApiError$zodSchema.optional(),
object: z.lazy(() => DestroyAssetResponseBody$zodSchema).optional(),
});