UNPKG

@phala/cloud

Version:
146 lines 5.23 kB
import { z } from "zod"; import { type Client, type SafeResult } from "../client"; import { ActionParameters, ActionReturnType } from "../types/common"; export declare const ListInstanceTypesRequestSchema: z.ZodObject<{ page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; page_size: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; }, "strict", z.ZodTypeAny, { page: number; page_size: number; }, { page?: number | undefined; page_size?: number | undefined; }>; export declare const InstanceTypeSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, z.ZodTypeAny, "passthrough">>; export declare const PaginatedInstanceTypesSchema: z.ZodObject<{ items: z.ZodArray<z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, z.ZodTypeAny, "passthrough">>, "many">; total: z.ZodNumber; page: z.ZodNumber; page_size: z.ZodNumber; pages: z.ZodNumber; }, "strict", z.ZodTypeAny, { page: number; page_size: number; items: z.objectOutputType<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, z.ZodTypeAny, "passthrough">[]; total: number; pages: number; }, { page: number; page_size: number; items: z.objectInputType<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; vcpu: z.ZodNumber; memory_mb: z.ZodNumber; hourly_rate: z.ZodString; requires_gpu: z.ZodBoolean; public: z.ZodBoolean; enabled: z.ZodBoolean; }, z.ZodTypeAny, "passthrough">[]; total: number; pages: number; }>; export type ListInstanceTypesRequest = z.infer<typeof ListInstanceTypesRequestSchema>; export type InstanceType = z.infer<typeof InstanceTypeSchema>; export type PaginatedInstanceTypes = z.infer<typeof PaginatedInstanceTypesSchema>; export type ListInstanceTypesParameters<T = undefined> = ActionParameters<T>; export type ListInstanceTypesReturnType<T = undefined> = ActionReturnType<PaginatedInstanceTypes, T>; /** * List available instance types with pagination * * @param client - The API client * @param request - Optional request parameters for pagination * @param request.page - Page number (1-based) * @param request.page_size - Number of items per page * @param parameters - Optional behavior parameters * @returns Paginated list of instance types * * @example * ```typescript * // Get first page with default size * const types = await listInstanceTypes(client, { page: 1 }) * * // Get with custom page size * const types = await listInstanceTypes(client, { page: 1, page_size: 50 }) * * // Get all types (use large page size) * const types = await listInstanceTypes(client, { page_size: 1000 }) * ``` */ export declare function listInstanceTypes<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request?: ListInstanceTypesRequest, parameters?: ListInstanceTypesParameters<T>): Promise<ListInstanceTypesReturnType<T>>; /** * Safe version of listInstanceTypes that returns a Result type instead of throwing */ export declare function safeListInstanceTypes<T extends z.ZodSchema | false | undefined = undefined>(client: Client, request?: ListInstanceTypesRequest, parameters?: ListInstanceTypesParameters<T>): Promise<SafeResult<ListInstanceTypesReturnType<T>>>; //# sourceMappingURL=list-instance-types.d.ts.map