/**
 * Kubernetes
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1.22.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */ import localVarRequest from 'request' ; import http from 'http' ; import { V1APIResourceList } from '../model/v1APIResourceList' ; import { V1APIService } from '../model/v1APIService' ; import { V1APIServiceList } from '../model/v1APIServiceList' ; import { V1DeleteOptions } from '../model/v1DeleteOptions' ; import { V1Status } from '../model/v1Status' ; import { ObjectSerializer , Authentication , VoidAuth , Interceptor } from '../model/models' ; import { HttpBasicAuth , HttpBearerAuth , ApiKeyAuth , OAuth } from '../model/models' ; import { HttpError , RequestFile } from './apis' ; let defaultBasePath = 'http://localhost' ; export enum ApiregistrationV1ApiApiKeys { BearerToken } export class ApiregistrationV1Api { protected _basePath = defaultBasePath ; protected _defaultHeaders : any = { } ; protected _useQuerystring : boolean = false ; protected authentications = { 'default' : < Authentication > new VoidAuth ( ) , 'BearerToken' : new ApiKeyAuth ( 'header' , 'authorization' ) , } ; protected interceptors : Interceptor [ ] = [ ] ; constructor ( basePath ? ) ; constructor ( basePathOrUsername , password ? , basePath ? ) { if ( password ) { if ( basePath ) { this . basePath = basePath ; } } else { if ( basePathOrUsername ) { this . basePath = basePathOrUsername ; } } } set useQuerystring ( value ) { this . _useQuerystring = value ; } set basePath ( basePath ) { this . _basePath = basePath ; } set defaultHeaders ( defaultHeaders ) { this . _defaultHeaders = defaultHeaders ; } get defaultHeaders ( ) { return this . _defaultHeaders ; } get basePath ( ) { return this . _basePath ; } public setDefaultAuthentication ( auth ) { this . authentications . default = auth ; } public setApiKey ( key , value ) { ( this . authentications as any ) [ ApiregistrationV1ApiApiKeys [ key ] ] . apiKey = value ; } public addInterceptor ( interceptor ) { this . interceptors . push ( interceptor ) ; } param body param pretty param dryRun param fieldManager public async createAPIService ( body , pretty ? , dryRun ? , fieldManager ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices' ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( body === null || body === undefined ) { throw new Error ( 'Required parameter body was null or undefined when calling createAPIService.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( fieldManager !== undefined ) { localVarQueryParameters [ 'fieldManager' ] = ObjectSerializer . serialize ( fieldManager , "string" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'POST' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "V1APIService" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param pretty param dryRun param gracePeriodSeconds param orphanDependents param propagationPolicy param body public async deleteAPIService ( name , pretty ? , dryRun ? , gracePeriodSeconds ? , orphanDependents ? , propagationPolicy ? , body ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling deleteAPIService.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( gracePeriodSeconds !== undefined ) { localVarQueryParameters [ 'gracePeriodSeconds' ] = ObjectSerializer . serialize ( gracePeriodSeconds , "number" ) ; } if ( orphanDependents !== undefined ) { localVarQueryParameters [ 'orphanDependents' ] = ObjectSerializer . serialize ( orphanDependents , "boolean" ) ; } if ( propagationPolicy !== undefined ) { localVarQueryParameters [ 'propagationPolicy' ] = ObjectSerializer . serialize ( propagationPolicy , "string" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'DELETE' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "V1DeleteOptions" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1Status ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1Status" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param pretty param _continue param dryRun param fieldSelector param gracePeriodSeconds param labelSelector param limit param orphanDependents param propagationPolicy param resourceVersion param resourceVersionMatch param timeoutSeconds param body public async deleteCollectionAPIService ( pretty ? , _continue ? , dryRun ? , fieldSelector ? , gracePeriodSeconds ? , labelSelector ? , limit ? , orphanDependents ? , propagationPolicy ? , resourceVersion ? , resourceVersionMatch ? , timeoutSeconds ? , body ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices' ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( _continue !== undefined ) { localVarQueryParameters [ 'continue' ] = ObjectSerializer . serialize ( _continue , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( fieldSelector !== undefined ) { localVarQueryParameters [ 'fieldSelector' ] = ObjectSerializer . serialize ( fieldSelector , "string" ) ; } if ( gracePeriodSeconds !== undefined ) { localVarQueryParameters [ 'gracePeriodSeconds' ] = ObjectSerializer . serialize ( gracePeriodSeconds , "number" ) ; } if ( labelSelector !== undefined ) { localVarQueryParameters [ 'labelSelector' ] = ObjectSerializer . serialize ( labelSelector , "string" ) ; } if ( limit !== undefined ) { localVarQueryParameters [ 'limit' ] = ObjectSerializer . serialize ( limit , "number" ) ; } if ( orphanDependents !== undefined ) { localVarQueryParameters [ 'orphanDependents' ] = ObjectSerializer . serialize ( orphanDependents , "boolean" ) ; } if ( propagationPolicy !== undefined ) { localVarQueryParameters [ 'propagationPolicy' ] = ObjectSerializer . serialize ( propagationPolicy , "string" ) ; } if ( resourceVersion !== undefined ) { localVarQueryParameters [ 'resourceVersion' ] = ObjectSerializer . serialize ( resourceVersion , "string" ) ; } if ( resourceVersionMatch !== undefined ) { localVarQueryParameters [ 'resourceVersionMatch' ] = ObjectSerializer . serialize ( resourceVersionMatch , "string" ) ; } if ( timeoutSeconds !== undefined ) { localVarQueryParameters [ 'timeoutSeconds' ] = ObjectSerializer . serialize ( timeoutSeconds , "number" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'DELETE' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "V1DeleteOptions" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1Status ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1Status" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } /**
     * get available resources
     */ public async getAPIResources ( options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/' ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'GET' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIResourceList ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIResourceList" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param pretty param allowWatchBookmarks param _continue param fieldSelector param labelSelector param limit param resourceVersion param resourceVersionMatch param timeoutSeconds param watch public async listAPIService ( pretty ? , allowWatchBookmarks ? , _continue ? , fieldSelector ? , labelSelector ? , limit ? , resourceVersion ? , resourceVersionMatch ? , timeoutSeconds ? , watch ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices' ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' , 'application/json;stream=watch' , 'application/vnd.kubernetes.protobuf;stream=watch' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( allowWatchBookmarks !== undefined ) { localVarQueryParameters [ 'allowWatchBookmarks' ] = ObjectSerializer . serialize ( allowWatchBookmarks , "boolean" ) ; } if ( _continue !== undefined ) { localVarQueryParameters [ 'continue' ] = ObjectSerializer . serialize ( _continue , "string" ) ; } if ( fieldSelector !== undefined ) { localVarQueryParameters [ 'fieldSelector' ] = ObjectSerializer . serialize ( fieldSelector , "string" ) ; } if ( labelSelector !== undefined ) { localVarQueryParameters [ 'labelSelector' ] = ObjectSerializer . serialize ( labelSelector , "string" ) ; } if ( limit !== undefined ) { localVarQueryParameters [ 'limit' ] = ObjectSerializer . serialize ( limit , "number" ) ; } if ( resourceVersion !== undefined ) { localVarQueryParameters [ 'resourceVersion' ] = ObjectSerializer . serialize ( resourceVersion , "string" ) ; } if ( resourceVersionMatch !== undefined ) { localVarQueryParameters [ 'resourceVersionMatch' ] = ObjectSerializer . serialize ( resourceVersionMatch , "string" ) ; } if ( timeoutSeconds !== undefined ) { localVarQueryParameters [ 'timeoutSeconds' ] = ObjectSerializer . serialize ( timeoutSeconds , "number" ) ; } if ( watch !== undefined ) { localVarQueryParameters [ 'watch' ] = ObjectSerializer . serialize ( watch , "boolean" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'GET' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIServiceList ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIServiceList" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param body param pretty param dryRun param fieldManager param force public async patchAPIService ( name , body , pretty ? , dryRun ? , fieldManager ? , force ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling patchAPIService.' ) ; } if ( body === null || body === undefined ) { throw new Error ( 'Required parameter body was null or undefined when calling patchAPIService.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( fieldManager !== undefined ) { localVarQueryParameters [ 'fieldManager' ] = ObjectSerializer . serialize ( fieldManager , "string" ) ; } if ( force !== undefined ) { localVarQueryParameters [ 'force' ] = ObjectSerializer . serialize ( force , "boolean" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'PATCH' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "object" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param body param pretty param dryRun param fieldManager param force public async patchAPIServiceStatus ( name , body , pretty ? , dryRun ? , fieldManager ? , force ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling patchAPIServiceStatus.' ) ; } if ( body === null || body === undefined ) { throw new Error ( 'Required parameter body was null or undefined when calling patchAPIServiceStatus.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( fieldManager !== undefined ) { localVarQueryParameters [ 'fieldManager' ] = ObjectSerializer . serialize ( fieldManager , "string" ) ; } if ( force !== undefined ) { localVarQueryParameters [ 'force' ] = ObjectSerializer . serialize ( force , "boolean" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'PATCH' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "object" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param pretty public async readAPIService ( name , pretty ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling readAPIService.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'GET' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param pretty public async readAPIServiceStatus ( name , pretty ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling readAPIServiceStatus.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'GET' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param body param pretty param dryRun param fieldManager public async replaceAPIService ( name , body , pretty ? , dryRun ? , fieldManager ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling replaceAPIService.' ) ; } if ( body === null || body === undefined ) { throw new Error ( 'Required parameter body was null or undefined when calling replaceAPIService.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( fieldManager !== undefined ) { localVarQueryParameters [ 'fieldManager' ] = ObjectSerializer . serialize ( fieldManager , "string" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'PUT' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "V1APIService" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } param name param body param pretty param dryRun param fieldManager public async replaceAPIServiceStatus ( name , body , pretty ? , dryRun ? , fieldManager ? , options = { headers : { } } ) { const localVarPath = this . basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' . replace ( '{' + 'name' + '}' , encodeURIComponent ( String ( name ) ) ) ; let localVarQueryParameters = { } ; let localVarHeaderParams = ( < any > Object ) . assign ( { } , this . _defaultHeaders ) ; const produces = [ 'application/json' , 'application/yaml' , 'application/vnd.kubernetes.protobuf' ] ; if ( produces . indexOf ( 'application/json' ) >= 0 ) { localVarHeaderParams . Accept = 'application/json' ; } else { localVarHeaderParams . Accept = produces . join ( ',' ) ; } let localVarFormParams = { } ; if ( name === null || name === undefined ) { throw new Error ( 'Required parameter name was null or undefined when calling replaceAPIServiceStatus.' ) ; } if ( body === null || body === undefined ) { throw new Error ( 'Required parameter body was null or undefined when calling replaceAPIServiceStatus.' ) ; } if ( pretty !== undefined ) { localVarQueryParameters [ 'pretty' ] = ObjectSerializer . serialize ( pretty , "string" ) ; } if ( dryRun !== undefined ) { localVarQueryParameters [ 'dryRun' ] = ObjectSerializer . serialize ( dryRun , "string" ) ; } if ( fieldManager !== undefined ) { localVarQueryParameters [ 'fieldManager' ] = ObjectSerializer . serialize ( fieldManager , "string" ) ; } ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ; let localVarUseFormData = false ; let localVarRequestOptions = { method : 'PUT' , qs : localVarQueryParameters , headers : localVarHeaderParams , uri : localVarPath , useQuerystring : this . _useQuerystring , json : true , body : ObjectSerializer . serialize ( body , "V1APIService" ) } ; let authenticationPromise = Promise . resolve ( ) ; if ( this . authentications . BearerToken . apiKey ) { authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . BearerToken . applyToRequest ( localVarRequestOptions ) ) ; } authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ; let interceptorPromise = authenticationPromise ; for ( const interceptor of this . interceptors ) { interceptorPromise = interceptorPromise . then ( ( ) => interceptor ( localVarRequestOptions ) ) ; } return interceptorPromise . then ( ( ) => { if ( Object . keys ( localVarFormParams ) . length ) { if ( localVarUseFormData ) { ( < any > localVarRequestOptions ) . formData = localVarFormParams ; } else { localVarRequestOptions . form = localVarFormParams ; } } return new Promise < { response : http . IncomingMessage ; body : V1APIService ; } > ( ( resolve , reject ) => { localVarRequest ( localVarRequestOptions , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) { body = ObjectSerializer . deserialize ( body , "V1APIService" ) ; resolve ( { response : response , body : body } ) ; } else { reject ( new HttpError ( response , body , response . statusCode ) ) ; } } } ) ; } ) ; } ) ; } }