UNPKG

@kubernetes/client-node

Version:
729 lines 201 kB
// TODO: better import syntax? import { BaseAPIRequestFactory, RequiredError } from './baseapi.js'; import { HttpMethod, HttpInfo } from '../http/http.js'; import { ObjectSerializer } from '../models/ObjectSerializer.js'; import { ApiException } from './exception.js'; import { isCodeInRange } from '../util.js'; /** * no description */ export class CustomObjectsApiRequestFactory extends BaseAPIRequestFactory { /** * Creates a cluster scoped Custom object * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param body The JSON schema of the Resource to create. * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) */ async createClusterCustomObject(group, version, plural, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "createClusterCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "createClusterCustomObject", "version"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "createClusterCustomObject", "plural"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("CustomObjectsApi", "createClusterCustomObject", "body"); } // Path Params const localVarPath = '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "any", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Creates a namespace scoped Custom object * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param body The JSON schema of the Resource to create. * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) */ async createNamespacedCustomObject(group, version, namespace, plural, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "createNamespacedCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "createNamespacedCustomObject", "version"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("CustomObjectsApi", "createNamespacedCustomObject", "namespace"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "createNamespacedCustomObject", "plural"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("CustomObjectsApi", "createNamespacedCustomObject", "body"); } // Path Params const localVarPath = '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "any", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Deletes the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom object\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ async deleteClusterCustomObject(group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "deleteClusterCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "deleteClusterCustomObject", "version"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "deleteClusterCustomObject", "plural"); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("CustomObjectsApi", "deleteClusterCustomObject", "name"); } // Path Params const localVarPath = '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Delete collection of cluster scoped custom objects * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param pretty If \'true\', then the output is pretty printed. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ async deleteCollectionClusterCustomObject(group, version, plural, pretty, labelSelector, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionClusterCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionClusterCustomObject", "version"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionClusterCustomObject", "plural"); } // Path Params const localVarPath = '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Delete collection of namespace scoped custom objects * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param pretty If \'true\', then the output is pretty printed. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param body */ async deleteCollectionNamespacedCustomObject(group, version, namespace, plural, pretty, labelSelector, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, fieldSelector, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionNamespacedCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionNamespacedCustomObject", "version"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionNamespacedCustomObject", "namespace"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "deleteCollectionNamespacedCustomObject", "plural"); } // Path Params const localVarPath = '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Deletes the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ async deleteNamespacedCustomObject(group, version, namespace, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "deleteNamespacedCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "deleteNamespacedCustomObject", "version"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("CustomObjectsApi", "deleteNamespacedCustomObject", "namespace"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "deleteNamespacedCustomObject", "plural"); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("CustomObjectsApi", "deleteNamespacedCustomObject", "name"); } // Path Params const localVarPath = '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * get available resources * @param group The custom resource\'s group name * @param version The custom resource\'s version */ async getAPIResources(group, version, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "getAPIResources", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "getAPIResources", "version"); } // Path Params const localVarPath = '/apis/{group}/{version}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Returns a cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom object\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ async getClusterCustomObject(group, version, plural, name, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObject", "version"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObject", "plural"); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObject", "name"); } // Path Params const localVarPath = '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read scale of the specified custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ async getClusterCustomObjectScale(group, version, plural, name, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectScale", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectScale", "version"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectScale", "plural"); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectScale", "name"); } // Path Params const localVarPath = '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read status of the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ async getClusterCustomObjectStatus(group, version, plural, name, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectStatus", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectStatus", "version"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectStatus", "plural"); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("CustomObjectsApi", "getClusterCustomObjectStatus", "name"); } // Path Params const localVarPath = '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * Returns a namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ async getNamespacedCustomObject(group, version, namespace, plural, name, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObject", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObject", "version"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObject", "namespace"); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObject", "plural"); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObject", "name"); } // Path Params const localVarPath = '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read scale of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ async getNamespacedCustomObjectScale(group, version, namespace, plural, name, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObjectScale", "group"); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObjectScale", "version"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("CustomObjectsApi", "getNamespacedCustomObjectScale", "namespace"); } // verify required parameter 'plural' is not null or undefined if (plural ===