/* tslint:disable */ /* eslint-disable */ /** * Tapis Workflows API * Create and manage pipelines * * The version of the OpenAPI document: 1.6.0 * 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 { ReqGroupSecret, ReqGroupSecretFromJSON, ReqGroupSecretToJSON, RespBase, RespBaseFromJSON, RespBaseToJSON, RespError, RespErrorFromJSON, RespErrorToJSON, RespGroupSecret, RespGroupSecretFromJSON, RespGroupSecretToJSON, RespGroupSecretList, RespGroupSecretListFromJSON, RespGroupSecretListToJSON, } from '../models'; export interface AddGroupSecretRequest { groupId: string; reqGroupSecret: ReqGroupSecret; } export interface GetGroupSecretRequest { groupId: string; groupSecretId: string; } export interface ListGroupSecretsRequest { groupId: string; } export interface RemoveGroupSecretRequest { groupId: string; groupSecretId: string; } /** * */ export class GroupSecretsApi extends runtime.BaseAPI { /** * Add a user\'s secret to a group. * Add a user\'s secret to a group */ async addGroupSecretRaw(requestParameters: AddGroupSecretRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling addGroupSecret.'); } if (requestParameters.reqGroupSecret === null || requestParameters.reqGroupSecret === undefined) { throw new runtime.RequiredError('reqGroupSecret','Required parameter requestParameters.reqGroupSecret was null or undefined when calling addGroupSecret.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-TAPIS-TOKEN"] = this.configuration.apiKey("X-TAPIS-TOKEN"); // TapisJWT authentication } const response = await this.request({ path: `/v3/workflows/groups/{group_id}/secrets`.replace(`{${"group_id"}}`, encodeURIComponent(String(requestParameters.groupId))), method: 'POST', headers: headerParameters, query: queryParameters, body: ReqGroupSecretToJSON(requestParameters.reqGroupSecret), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespGroupSecretFromJSON(jsonValue)); } /** * Add a user\'s secret to a group. * Add a user\'s secret to a group */ async addGroupSecret(requestParameters: AddGroupSecretRequest, initOverrides?: RequestInit): Promise { const response = await this.addGroupSecretRaw(requestParameters, initOverrides); return await response.value(); } /** * Get a group secret * Get group secret */ async getGroupSecretRaw(requestParameters: GetGroupSecretRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling getGroupSecret.'); } if (requestParameters.groupSecretId === null || requestParameters.groupSecretId === undefined) { throw new runtime.RequiredError('groupSecretId','Required parameter requestParameters.groupSecretId was null or undefined when calling getGroupSecret.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-TAPIS-TOKEN"] = this.configuration.apiKey("X-TAPIS-TOKEN"); // TapisJWT authentication } const response = await this.request({ path: `/v3/workflows/groups/{group_id}/secrets/{group_secret_id}`.replace(`{${"group_id"}}`, encodeURIComponent(String(requestParameters.groupId))).replace(`{${"group_secret_id"}}`, encodeURIComponent(String(requestParameters.groupSecretId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespGroupSecretFromJSON(jsonValue)); } /** * Get a group secret * Get group secret */ async getGroupSecret(requestParameters: GetGroupSecretRequest, initOverrides?: RequestInit): Promise { const response = await this.getGroupSecretRaw(requestParameters, initOverrides); return await response.value(); } /** * List group_secrets. * List group secrets */ async listGroupSecretsRaw(requestParameters: ListGroupSecretsRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling listGroupSecrets.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-TAPIS-TOKEN"] = this.configuration.apiKey("X-TAPIS-TOKEN"); // TapisJWT authentication } const response = await this.request({ path: `/v3/workflows/groups/{group_id}/secrets`.replace(`{${"group_id"}}`, encodeURIComponent(String(requestParameters.groupId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespGroupSecretListFromJSON(jsonValue)); } /** * List group_secrets. * List group secrets */ async listGroupSecrets(requestParameters: ListGroupSecretsRequest, initOverrides?: RequestInit): Promise { const response = await this.listGroupSecretsRaw(requestParameters, initOverrides); return await response.value(); } /** * Remove a user from a group. * Remove user from group */ async removeGroupSecretRaw(requestParameters: RemoveGroupSecretRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling removeGroupSecret.'); } if (requestParameters.groupSecretId === null || requestParameters.groupSecretId === undefined) { throw new runtime.RequiredError('groupSecretId','Required parameter requestParameters.groupSecretId was null or undefined when calling removeGroupSecret.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-TAPIS-TOKEN"] = this.configuration.apiKey("X-TAPIS-TOKEN"); // TapisJWT authentication } const response = await this.request({ path: `/v3/workflows/groups/{group_id}/secrets/{group_secret_id}`.replace(`{${"group_id"}}`, encodeURIComponent(String(requestParameters.groupId))).replace(`{${"group_secret_id"}}`, encodeURIComponent(String(requestParameters.groupSecretId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => RespBaseFromJSON(jsonValue)); } /** * Remove a user from a group. * Remove user from group */ async removeGroupSecret(requestParameters: RemoveGroupSecretRequest, initOverrides?: RequestInit): Promise { const response = await this.removeGroupSecretRaw(requestParameters, initOverrides); return await response.value(); } }