/* tslint:disable */ /* eslint-disable */ /** * Abaco API * Abaco (Actor Based Containers) is an API and distributed computing platform funded by the National Science Foundation to provide Functions-as-a-service to the research computing community. Abaco leverages Docker containers and the Actor Model of Concurrent Computation to provide generic function primitives that are portable, composable and scalable. * * The version of the OpenAPI document: 1 * Contact: cicsupport@tacc.utexas.edu * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { ReqCreateNonce, ReqCreateNonceFromJSON, ReqCreateNonceToJSON, RespCreateNonce, RespCreateNonceFromJSON, RespCreateNonceToJSON, RespDeleteNonce, RespDeleteNonceFromJSON, RespDeleteNonceToJSON, RespGetNonce, RespGetNonceFromJSON, RespGetNonceToJSON, RespListNonces, RespListNoncesFromJSON, RespListNoncesToJSON, } from '../models'; export interface CreateNonceRequest { actorId: string; reqCreateNonce: ReqCreateNonce; } export interface DeleteNonceRequest { actorId: string; nonceId: string; } export interface GetNonceRequest { actorId: string; nonceId: string; } export interface ListNoncesRequest { actorId: string; } /** * */ export class NoncesApi extends runtime.BaseAPI { /** * Create a nonce for an actor. * create_nonce */ async createNonceRaw(requestParameters: CreateNonceRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.actorId === null || requestParameters.actorId === undefined) { throw new runtime.RequiredError('actorId','Required parameter requestParameters.actorId was null or undefined when calling createNonce.'); } if (requestParameters.reqCreateNonce === null || requestParameters.reqCreateNonce === undefined) { throw new runtime.RequiredError('reqCreateNonce','Required parameter requestParameters.reqCreateNonce was null or undefined when calling createNonce.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { queryParameters["x-nonce"] = this.configuration.apiKey("x-nonce"); // nonce authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["X-JWT-Assertion-DEV"] = this.configuration.apiKey("X-JWT-Assertion-DEV"); // wso2jwtDevAuth authentication } const response = await this.request({ path: `/v3/actors/{actor_id}/nonces`.replace(`{${"actor_id"}}`, encodeURIComponent(String(requestParameters.actorId))), method: 'POST', headers: headerParameters, query: queryParameters, body: ReqCreateNonceToJSON(requestParameters.reqCreateNonce), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespCreateNonceFromJSON(jsonValue)); } /** * Create a nonce for an actor. * create_nonce */ async createNonce(requestParameters: CreateNonceRequest, initOverrides?: RequestInit): Promise { const response = await this.createNonceRaw(requestParameters, initOverrides); return await response.value(); } /** * Delete a nonce. * delete_nonce */ async deleteNonceRaw(requestParameters: DeleteNonceRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.actorId === null || requestParameters.actorId === undefined) { throw new runtime.RequiredError('actorId','Required parameter requestParameters.actorId was null or undefined when calling deleteNonce.'); } if (requestParameters.nonceId === null || requestParameters.nonceId === undefined) { throw new runtime.RequiredError('nonceId','Required parameter requestParameters.nonceId was null or undefined when calling deleteNonce.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { queryParameters["x-nonce"] = this.configuration.apiKey("x-nonce"); // nonce authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["X-JWT-Assertion-DEV"] = this.configuration.apiKey("X-JWT-Assertion-DEV"); // wso2jwtDevAuth authentication } const response = await this.request({ path: `/v3/actors/{actor_id}/nonces/{nonce_id}`.replace(`{${"actor_id"}}`, encodeURIComponent(String(requestParameters.actorId))).replace(`{${"nonce_id"}}`, encodeURIComponent(String(requestParameters.nonceId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespDeleteNonceFromJSON(jsonValue)); } /** * Delete a nonce. * delete_nonce */ async deleteNonce(requestParameters: DeleteNonceRequest, initOverrides?: RequestInit): Promise { const response = await this.deleteNonceRaw(requestParameters, initOverrides); return await response.value(); } /** * Get details about a nonce for an actor. * get_nonce */ async getNonceRaw(requestParameters: GetNonceRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.actorId === null || requestParameters.actorId === undefined) { throw new runtime.RequiredError('actorId','Required parameter requestParameters.actorId was null or undefined when calling getNonce.'); } if (requestParameters.nonceId === null || requestParameters.nonceId === undefined) { throw new runtime.RequiredError('nonceId','Required parameter requestParameters.nonceId was null or undefined when calling getNonce.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { queryParameters["x-nonce"] = this.configuration.apiKey("x-nonce"); // nonce authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["X-JWT-Assertion-DEV"] = this.configuration.apiKey("X-JWT-Assertion-DEV"); // wso2jwtDevAuth authentication } const response = await this.request({ path: `/v3/actors/{actor_id}/nonces/{nonce_id}`.replace(`{${"actor_id"}}`, encodeURIComponent(String(requestParameters.actorId))).replace(`{${"nonce_id"}}`, encodeURIComponent(String(requestParameters.nonceId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespGetNonceFromJSON(jsonValue)); } /** * Get details about a nonce for an actor. * get_nonce */ async getNonce(requestParameters: GetNonceRequest, initOverrides?: RequestInit): Promise { const response = await this.getNonceRaw(requestParameters, initOverrides); return await response.value(); } /** * List nonces for an actor. * list_nonces */ async listNoncesRaw(requestParameters: ListNoncesRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.actorId === null || requestParameters.actorId === undefined) { throw new runtime.RequiredError('actorId','Required parameter requestParameters.actorId was null or undefined when calling listNonces.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { queryParameters["x-nonce"] = this.configuration.apiKey("x-nonce"); // nonce authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["X-JWT-Assertion-DEV"] = this.configuration.apiKey("X-JWT-Assertion-DEV"); // wso2jwtDevAuth authentication } const response = await this.request({ path: `/v3/actors/{actor_id}/nonces`.replace(`{${"actor_id"}}`, encodeURIComponent(String(requestParameters.actorId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespListNoncesFromJSON(jsonValue)); } /** * List nonces for an actor. * list_nonces */ async listNonces(requestParameters: ListNoncesRequest, initOverrides?: RequestInit): Promise { const response = await this.listNoncesRaw(requestParameters, initOverrides); return await response.value(); } }