UNPKG

@datadog/datadog-api-client

Version:

OpenAPI client for Datadog APIs

939 lines (938 loc) 140 kB
"use strict"; 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()); }); }; var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TeamsApi = exports.TeamsApiResponseProcessor = exports.TeamsApiRequestFactory = void 0; const baseapi_1 = require("../../datadog-api-client-common/baseapi"); const configuration_1 = require("../../datadog-api-client-common/configuration"); const http_1 = require("../../datadog-api-client-common/http/http"); const logger_1 = require("../../../logger"); const ObjectSerializer_1 = require("../models/ObjectSerializer"); const exception_1 = require("../../datadog-api-client-common/exception"); class TeamsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory { addMemberTeam(superTeamId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'addMemberTeam'"); if (!_config.unstableOperations["v2.addMemberTeam"]) { throw new Error("Unstable operation 'addMemberTeam' is disabled"); } // verify required parameter 'superTeamId' is not null or undefined if (superTeamId === null || superTeamId === undefined) { throw new baseapi_1.RequiredError("superTeamId", "addMemberTeam"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "addMemberTeam"); } // Path Params const localVarPath = "/api/v2/team/{super_team_id}/member_teams".replace("{super_team_id}", encodeURIComponent(String(superTeamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.addMemberTeam") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "AddMemberTeamRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } addTeamHierarchyLink(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "addTeamHierarchyLink"); } // Path Params const localVarPath = "/api/v2/team-hierarchy-links"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.addTeamHierarchyLink") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamHierarchyLinkCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createTeam(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createTeam"); } // Path Params const localVarPath = "/api/v2/team"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.createTeam") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createTeamConnections(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createTeamConnections'"); if (!_config.unstableOperations["v2.createTeamConnections"]) { throw new Error("Unstable operation 'createTeamConnections' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createTeamConnections"); } // Path Params const localVarPath = "/api/v2/team/connections"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.createTeamConnections") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamConnectionCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createTeamLink(teamId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "createTeamLink"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createTeamLink"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/links".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.createTeamLink") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamLinkCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } createTeamMembership(teamId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "createTeamMembership"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createTeamMembership"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/memberships".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.createTeamMembership") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "UserTeamRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteTeam(teamId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "deleteTeam"); } // Path Params const localVarPath = "/api/v2/team/{team_id}".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.deleteTeam") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteTeamConnections(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteTeamConnections'"); if (!_config.unstableOperations["v2.deleteTeamConnections"]) { throw new Error("Unstable operation 'deleteTeamConnections' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "deleteTeamConnections"); } // Path Params const localVarPath = "/api/v2/team/connections"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.deleteTeamConnections") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamConnectionDeleteRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteTeamLink(teamId, linkId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "deleteTeamLink"); } // verify required parameter 'linkId' is not null or undefined if (linkId === null || linkId === undefined) { throw new baseapi_1.RequiredError("linkId", "deleteTeamLink"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/links/{link_id}" .replace("{team_id}", encodeURIComponent(String(teamId))) .replace("{link_id}", encodeURIComponent(String(linkId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.deleteTeamLink") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } deleteTeamMembership(teamId, userId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "deleteTeamMembership"); } // verify required parameter 'userId' is not null or undefined if (userId === null || userId === undefined) { throw new baseapi_1.RequiredError("userId", "deleteTeamMembership"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/memberships/{user_id}" .replace("{team_id}", encodeURIComponent(String(teamId))) .replace("{user_id}", encodeURIComponent(String(userId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.deleteTeamMembership") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeam(teamId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "getTeam"); } // Path Params const localVarPath = "/api/v2/team/{team_id}".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeam") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeamHierarchyLink(linkId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'linkId' is not null or undefined if (linkId === null || linkId === undefined) { throw new baseapi_1.RequiredError("linkId", "getTeamHierarchyLink"); } // Path Params const localVarPath = "/api/v2/team-hierarchy-links/{link_id}".replace("{link_id}", encodeURIComponent(String(linkId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeamHierarchyLink") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeamLink(teamId, linkId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "getTeamLink"); } // verify required parameter 'linkId' is not null or undefined if (linkId === null || linkId === undefined) { throw new baseapi_1.RequiredError("linkId", "getTeamLink"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/links/{link_id}" .replace("{team_id}", encodeURIComponent(String(teamId))) .replace("{link_id}", encodeURIComponent(String(linkId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeamLink") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeamLinks(teamId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "getTeamLinks"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/links".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeamLinks") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeamMemberships(teamId, pageSize, pageNumber, sort, filterKeyword, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "getTeamMemberships"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/memberships".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeamMemberships") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (pageSize !== undefined) { requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), ""); } if (pageNumber !== undefined) { requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), ""); } if (sort !== undefined) { requestContext.setQueryParam("sort", ObjectSerializer_1.ObjectSerializer.serialize(sort, "GetTeamMembershipsSort", ""), ""); } if (filterKeyword !== undefined) { requestContext.setQueryParam("filter[keyword]", ObjectSerializer_1.ObjectSerializer.serialize(filterKeyword, "string", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeamPermissionSettings(teamId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "getTeamPermissionSettings"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/permission-settings".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeamPermissionSettings") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getTeamSync(filterSource, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getTeamSync'"); if (!_config.unstableOperations["v2.getTeamSync"]) { throw new Error("Unstable operation 'getTeamSync' is disabled"); } // verify required parameter 'filterSource' is not null or undefined if (filterSource === null || filterSource === undefined) { throw new baseapi_1.RequiredError("filterSource", "getTeamSync"); } // Path Params const localVarPath = "/api/v2/team/sync"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getTeamSync") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (filterSource !== undefined) { requestContext.setQueryParam("filter[source]", ObjectSerializer_1.ObjectSerializer.serialize(filterSource, "TeamSyncAttributesSource", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } getUserMemberships(userUuid, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'userUuid' is not null or undefined if (userUuid === null || userUuid === undefined) { throw new baseapi_1.RequiredError("userUuid", "getUserMemberships"); } // Path Params const localVarPath = "/api/v2/users/{user_uuid}/memberships".replace("{user_uuid}", encodeURIComponent(String(userUuid))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.getUserMemberships") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } listMemberTeams(superTeamId, pageSize, pageNumber, fieldsTeam, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listMemberTeams'"); if (!_config.unstableOperations["v2.listMemberTeams"]) { throw new Error("Unstable operation 'listMemberTeams' is disabled"); } // verify required parameter 'superTeamId' is not null or undefined if (superTeamId === null || superTeamId === undefined) { throw new baseapi_1.RequiredError("superTeamId", "listMemberTeams"); } // Path Params const localVarPath = "/api/v2/team/{super_team_id}/member_teams".replace("{super_team_id}", encodeURIComponent(String(superTeamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.listMemberTeams") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (pageSize !== undefined) { requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), ""); } if (pageNumber !== undefined) { requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), ""); } if (fieldsTeam !== undefined) { requestContext.setQueryParam("fields[team]", ObjectSerializer_1.ObjectSerializer.serialize(fieldsTeam, "Array<TeamsField>", ""), "csv"); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } listTeamConnections(pageSize, pageNumber, filterSources, filterTeamIds, filterConnectedTeamIds, filterConnectionIds, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listTeamConnections'"); if (!_config.unstableOperations["v2.listTeamConnections"]) { throw new Error("Unstable operation 'listTeamConnections' is disabled"); } // Path Params const localVarPath = "/api/v2/team/connections"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.listTeamConnections") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (pageSize !== undefined) { requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), ""); } if (pageNumber !== undefined) { requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), ""); } if (filterSources !== undefined) { requestContext.setQueryParam("filter[sources]", ObjectSerializer_1.ObjectSerializer.serialize(filterSources, "Array<string>", ""), "csv"); } if (filterTeamIds !== undefined) { requestContext.setQueryParam("filter[team_ids]", ObjectSerializer_1.ObjectSerializer.serialize(filterTeamIds, "Array<string>", ""), "csv"); } if (filterConnectedTeamIds !== undefined) { requestContext.setQueryParam("filter[connected_team_ids]", ObjectSerializer_1.ObjectSerializer.serialize(filterConnectedTeamIds, "Array<string>", ""), "csv"); } if (filterConnectionIds !== undefined) { requestContext.setQueryParam("filter[connection_ids]", ObjectSerializer_1.ObjectSerializer.serialize(filterConnectionIds, "Array<string>", ""), "csv"); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } listTeamHierarchyLinks(pageNumber, pageSize, filterParentTeam, filterSubTeam, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // Path Params const localVarPath = "/api/v2/team-hierarchy-links"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.listTeamHierarchyLinks") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (pageNumber !== undefined) { requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), ""); } if (pageSize !== undefined) { requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), ""); } if (filterParentTeam !== undefined) { requestContext.setQueryParam("filter[parent_team]", ObjectSerializer_1.ObjectSerializer.serialize(filterParentTeam, "string", ""), ""); } if (filterSubTeam !== undefined) { requestContext.setQueryParam("filter[sub_team]", ObjectSerializer_1.ObjectSerializer.serialize(filterSubTeam, "string", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } listTeams(pageNumber, pageSize, sort, include, filterKeyword, filterMe, fieldsTeam, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // Path Params const localVarPath = "/api/v2/team"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.listTeams") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (pageNumber !== undefined) { requestContext.setQueryParam("page[number]", ObjectSerializer_1.ObjectSerializer.serialize(pageNumber, "number", "int64"), ""); } if (pageSize !== undefined) { requestContext.setQueryParam("page[size]", ObjectSerializer_1.ObjectSerializer.serialize(pageSize, "number", "int64"), ""); } if (sort !== undefined) { requestContext.setQueryParam("sort", ObjectSerializer_1.ObjectSerializer.serialize(sort, "ListTeamsSort", ""), ""); } if (include !== undefined) { requestContext.setQueryParam("include", ObjectSerializer_1.ObjectSerializer.serialize(include, "Array<ListTeamsInclude>", ""), "multi"); } if (filterKeyword !== undefined) { requestContext.setQueryParam("filter[keyword]", ObjectSerializer_1.ObjectSerializer.serialize(filterKeyword, "string", ""), ""); } if (filterMe !== undefined) { requestContext.setQueryParam("filter[me]", ObjectSerializer_1.ObjectSerializer.serialize(filterMe, "boolean", ""), ""); } if (fieldsTeam !== undefined) { requestContext.setQueryParam("fields[team]", ObjectSerializer_1.ObjectSerializer.serialize(fieldsTeam, "Array<TeamsField>", ""), "csv"); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } removeMemberTeam(superTeamId, memberTeamId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'removeMemberTeam'"); if (!_config.unstableOperations["v2.removeMemberTeam"]) { throw new Error("Unstable operation 'removeMemberTeam' is disabled"); } // verify required parameter 'superTeamId' is not null or undefined if (superTeamId === null || superTeamId === undefined) { throw new baseapi_1.RequiredError("superTeamId", "removeMemberTeam"); } // verify required parameter 'memberTeamId' is not null or undefined if (memberTeamId === null || memberTeamId === undefined) { throw new baseapi_1.RequiredError("memberTeamId", "removeMemberTeam"); } // Path Params const localVarPath = "/api/v2/team/{super_team_id}/member_teams/{member_team_id}" .replace("{super_team_id}", encodeURIComponent(String(superTeamId))) .replace("{member_team_id}", encodeURIComponent(String(memberTeamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.removeMemberTeam") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } removeTeamHierarchyLink(linkId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'linkId' is not null or undefined if (linkId === null || linkId === undefined) { throw new baseapi_1.RequiredError("linkId", "removeTeamHierarchyLink"); } // Path Params const localVarPath = "/api/v2/team-hierarchy-links/{link_id}".replace("{link_id}", encodeURIComponent(String(linkId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.removeTeamHierarchyLink") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } syncTeams(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'syncTeams'"); if (!_config.unstableOperations["v2.syncTeams"]) { throw new Error("Unstable operation 'syncTeams' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "syncTeams"); } // Path Params const localVarPath = "/api/v2/team/sync"; // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.syncTeams") .makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamSyncRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } updateTeam(teamId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "updateTeam"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateTeam"); } // Path Params const localVarPath = "/api/v2/team/{team_id}".replace("{team_id}", encodeURIComponent(String(teamId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.updateTeam") .makeRequestContext(localVarPath, http_1.HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } updateTeamLink(teamId, linkId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "updateTeamLink"); } // verify required parameter 'linkId' is not null or undefined if (linkId === null || linkId === undefined) { throw new baseapi_1.RequiredError("linkId", "updateTeamLink"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateTeamLink"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/links/{link_id}" .replace("{team_id}", encodeURIComponent(String(teamId))) .replace("{link_id}", encodeURIComponent(String(linkId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.updateTeamLink") .makeRequestContext(localVarPath, http_1.HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "TeamLinkCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]); return requestContext; }); } updateTeamMembership(teamId, userId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; // verify required parameter 'teamId' is not null or undefined if (teamId === null || teamId === undefined) { throw new baseapi_1.RequiredError("teamId", "updateTeamMembership"); } // verify required parameter 'userId' is not null or undefined if (userId === null || userId === undefined) { throw new baseapi_1.RequiredError("userId", "updateTeamMembership"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateTeamMembership"); } // Path Params const localVarPath = "/api/v2/team/{team_id}/memberships/{user_id}" .replace("{team_id}", encodeURIComponent(String(teamId))) .replace("{user_id}", encodeURIComponent(String(userId))); // Make Request Context const requestContext = _config .getServer("v2.TeamsApi.updateTeamMembership") .makeRequestContext(localVarPath, http_1.HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Body Params const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json", ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(body, "UserTeamUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", "AuthZ", ]);