UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

39 lines (38 loc) 1.67 kB
import { type ResourceOperation } from './resources/resource-operation.js'; import { type ResourceType } from './resources/resource-type.js'; import { type NamespaceName } from '../../types/namespace/namespace-name.js'; interface ApiError extends Error { code?: number; statusCode?: number; body?: unknown; headers?: unknown; input?: unknown; } export declare class KubeApiResponse { /** * Checks the response for an error status code to determine which error should be thrown. * * @param errorResponse - the error response returned from the Kubernetes API call. * @param resourceType - the type of resource being checked. * @param resourceOperation - the operation being performed on the resource. * @param namespace - the namespace of the resource being checked. * @param name - the name of the resource being checked. */ static throwError(errorResponse: ApiError, resourceOperation: ResourceOperation, resourceType: ResourceType, namespace: NamespaceName, name: string): never; /** * Checks if the error response has a status code indicating a failing status (greater than 202 Accepted). * @param errorResponse */ static isFailingStatus(errorResponse: ApiError): boolean; /** * Checks if the error response has a status code indicating a "Not Found" error (404). * @param errorResponse */ static isNotFound(errorResponse: ApiError): boolean; /** * Checks if the error response has a status code indicating a "Created" status (201). * @param errorResponse */ static isCreatedStatus(errorResponse: ApiError): boolean; } export {};