UNPKG

@devopness/sdk-js

Version:

Devopness API JS/TS SDK - Painless essential DevOps to everyone

86 lines (85 loc) 3.77 kB
"use strict"; /* eslint-disable */ /** * devopness API * Devopness API - Painless essential DevOps to everyone * * The version of the OpenAPI document: latest * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TeamsApiService = void 0; const ApiBaseService_1 = require("../../../services/ApiBaseService"); const ApiResponse_1 = require("../../../common/ApiResponse"); const Exceptions_1 = require("../../../common/Exceptions"); /** * TeamsApiService - Auto-generated */ class TeamsApiService extends ApiBaseService_1.ApiBaseService { /** * * @summary Delete a given team * @param {number} teamId The ID of the team. */ deleteTeam(teamId) { return __awaiter(this, void 0, void 0, function* () { if (teamId === null || teamId === undefined) { throw new Exceptions_1.ArgumentNullException('teamId', 'deleteTeam'); } let queryString = ''; const requestUrl = '/teams/{team_id}' + (queryString ? `?${queryString}` : ''); const response = yield this.delete(requestUrl.replace(`{${"team_id"}}`, encodeURIComponent(String(teamId)))); return new ApiResponse_1.ApiResponse(response); }); } /** * * @summary Get a team by ID * @param {number} teamId The ID of the team. */ getTeam(teamId) { return __awaiter(this, void 0, void 0, function* () { if (teamId === null || teamId === undefined) { throw new Exceptions_1.ArgumentNullException('teamId', 'getTeam'); } let queryString = ''; const requestUrl = '/teams/{team_id}' + (queryString ? `?${queryString}` : ''); const response = yield this.get(requestUrl.replace(`{${"team_id"}}`, encodeURIComponent(String(teamId)))); return new ApiResponse_1.ApiResponse(response); }); } /** * * @summary Update an existing team * @param {number} teamId The ID of the team. * @param {TeamUpdate} teamUpdate A JSON object containing the resource data */ updateTeam(teamId, teamUpdate) { return __awaiter(this, void 0, void 0, function* () { if (teamId === null || teamId === undefined) { throw new Exceptions_1.ArgumentNullException('teamId', 'updateTeam'); } if (teamUpdate === null || teamUpdate === undefined) { throw new Exceptions_1.ArgumentNullException('teamUpdate', 'updateTeam'); } let queryString = ''; const requestUrl = '/teams/{team_id}' + (queryString ? `?${queryString}` : ''); const response = yield this.put(requestUrl.replace(`{${"team_id"}}`, encodeURIComponent(String(teamId))), teamUpdate); return new ApiResponse_1.ApiResponse(response); }); } } exports.TeamsApiService = TeamsApiService;