UNPKG

@datadog/datadog-api-client

Version:
876 lines 109 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()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OrgGroupsApi = exports.OrgGroupsApiResponseProcessor = exports.OrgGroupsApiRequestFactory = 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 OrgGroupsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory { bulkUpdateOrgGroupMemberships(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'bulkUpdateOrgGroupMemberships'"); if (!_config.unstableOperations["v2.bulkUpdateOrgGroupMemberships"]) { throw new Error("Unstable operation 'bulkUpdateOrgGroupMemberships' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "bulkUpdateOrgGroupMemberships"); } // Path Params const localVarPath = "/api/v2/org_group_memberships/bulk"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.bulkUpdateOrgGroupMemberships") .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, "OrgGroupMembershipBulkUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createOrgGroup(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createOrgGroup'"); if (!_config.unstableOperations["v2.createOrgGroup"]) { throw new Error("Unstable operation 'createOrgGroup' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createOrgGroup"); } // Path Params const localVarPath = "/api/v2/org_groups"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.createOrgGroup") .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, "OrgGroupCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createOrgGroupPolicy(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createOrgGroupPolicy'"); if (!_config.unstableOperations["v2.createOrgGroupPolicy"]) { throw new Error("Unstable operation 'createOrgGroupPolicy' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createOrgGroupPolicy"); } // Path Params const localVarPath = "/api/v2/org_group_policies"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.createOrgGroupPolicy") .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, "OrgGroupPolicyCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } createOrgGroupPolicyOverride(body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'createOrgGroupPolicyOverride'"); if (!_config.unstableOperations["v2.createOrgGroupPolicyOverride"]) { throw new Error("Unstable operation 'createOrgGroupPolicyOverride' is disabled"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "createOrgGroupPolicyOverride"); } // Path Params const localVarPath = "/api/v2/org_group_policy_overrides"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.createOrgGroupPolicyOverride") .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, "OrgGroupPolicyOverrideCreateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } deleteOrgGroup(orgGroupId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteOrgGroup'"); if (!_config.unstableOperations["v2.deleteOrgGroup"]) { throw new Error("Unstable operation 'deleteOrgGroup' is disabled"); } // verify required parameter 'orgGroupId' is not null or undefined if (orgGroupId === null || orgGroupId === undefined) { throw new baseapi_1.RequiredError("orgGroupId", "deleteOrgGroup"); } // Path Params const localVarPath = "/api/v2/org_groups/{org_group_id}".replace("{org_group_id}", encodeURIComponent(String(orgGroupId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.deleteOrgGroup") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } deleteOrgGroupPolicy(orgGroupPolicyId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteOrgGroupPolicy'"); if (!_config.unstableOperations["v2.deleteOrgGroupPolicy"]) { throw new Error("Unstable operation 'deleteOrgGroupPolicy' is disabled"); } // verify required parameter 'orgGroupPolicyId' is not null or undefined if (orgGroupPolicyId === null || orgGroupPolicyId === undefined) { throw new baseapi_1.RequiredError("orgGroupPolicyId", "deleteOrgGroupPolicy"); } // Path Params const localVarPath = "/api/v2/org_group_policies/{org_group_policy_id}".replace("{org_group_policy_id}", encodeURIComponent(String(orgGroupPolicyId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.deleteOrgGroupPolicy") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } deleteOrgGroupPolicyOverride(orgGroupPolicyOverrideId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'deleteOrgGroupPolicyOverride'"); if (!_config.unstableOperations["v2.deleteOrgGroupPolicyOverride"]) { throw new Error("Unstable operation 'deleteOrgGroupPolicyOverride' is disabled"); } // verify required parameter 'orgGroupPolicyOverrideId' is not null or undefined if (orgGroupPolicyOverrideId === null || orgGroupPolicyOverrideId === undefined) { throw new baseapi_1.RequiredError("orgGroupPolicyOverrideId", "deleteOrgGroupPolicyOverride"); } // Path Params const localVarPath = "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}".replace("{org_group_policy_override_id}", encodeURIComponent(String(orgGroupPolicyOverrideId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.deleteOrgGroupPolicyOverride") .makeRequestContext(localVarPath, http_1.HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } getOrgGroup(orgGroupId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getOrgGroup'"); if (!_config.unstableOperations["v2.getOrgGroup"]) { throw new Error("Unstable operation 'getOrgGroup' is disabled"); } // verify required parameter 'orgGroupId' is not null or undefined if (orgGroupId === null || orgGroupId === undefined) { throw new baseapi_1.RequiredError("orgGroupId", "getOrgGroup"); } // Path Params const localVarPath = "/api/v2/org_groups/{org_group_id}".replace("{org_group_id}", encodeURIComponent(String(orgGroupId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.getOrgGroup") .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", ]); return requestContext; }); } getOrgGroupMembership(orgGroupMembershipId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getOrgGroupMembership'"); if (!_config.unstableOperations["v2.getOrgGroupMembership"]) { throw new Error("Unstable operation 'getOrgGroupMembership' is disabled"); } // verify required parameter 'orgGroupMembershipId' is not null or undefined if (orgGroupMembershipId === null || orgGroupMembershipId === undefined) { throw new baseapi_1.RequiredError("orgGroupMembershipId", "getOrgGroupMembership"); } // Path Params const localVarPath = "/api/v2/org_group_memberships/{org_group_membership_id}".replace("{org_group_membership_id}", encodeURIComponent(String(orgGroupMembershipId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.getOrgGroupMembership") .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", ]); return requestContext; }); } getOrgGroupPolicy(orgGroupPolicyId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getOrgGroupPolicy'"); if (!_config.unstableOperations["v2.getOrgGroupPolicy"]) { throw new Error("Unstable operation 'getOrgGroupPolicy' is disabled"); } // verify required parameter 'orgGroupPolicyId' is not null or undefined if (orgGroupPolicyId === null || orgGroupPolicyId === undefined) { throw new baseapi_1.RequiredError("orgGroupPolicyId", "getOrgGroupPolicy"); } // Path Params const localVarPath = "/api/v2/org_group_policies/{org_group_policy_id}".replace("{org_group_policy_id}", encodeURIComponent(String(orgGroupPolicyId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.getOrgGroupPolicy") .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", ]); return requestContext; }); } getOrgGroupPolicyOverride(orgGroupPolicyOverrideId, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'getOrgGroupPolicyOverride'"); if (!_config.unstableOperations["v2.getOrgGroupPolicyOverride"]) { throw new Error("Unstable operation 'getOrgGroupPolicyOverride' is disabled"); } // verify required parameter 'orgGroupPolicyOverrideId' is not null or undefined if (orgGroupPolicyOverrideId === null || orgGroupPolicyOverrideId === undefined) { throw new baseapi_1.RequiredError("orgGroupPolicyOverrideId", "getOrgGroupPolicyOverride"); } // Path Params const localVarPath = "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}".replace("{org_group_policy_override_id}", encodeURIComponent(String(orgGroupPolicyOverrideId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.getOrgGroupPolicyOverride") .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", ]); return requestContext; }); } listOrgGroupMemberships(filterOrgGroupId, filterOrgUuid, pageNumber, pageSize, sort, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listOrgGroupMemberships'"); if (!_config.unstableOperations["v2.listOrgGroupMemberships"]) { throw new Error("Unstable operation 'listOrgGroupMemberships' is disabled"); } // Path Params const localVarPath = "/api/v2/org_group_memberships"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.listOrgGroupMemberships") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (filterOrgGroupId !== undefined) { requestContext.setQueryParam("filter[org_group_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterOrgGroupId, "string", "uuid"), ""); } if (filterOrgUuid !== undefined) { requestContext.setQueryParam("filter[org_uuid]", ObjectSerializer_1.ObjectSerializer.serialize(filterOrgUuid, "string", "uuid"), ""); } 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, "OrgGroupMembershipSortOption", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } listOrgGroupPolicies(filterOrgGroupId, filterPolicyName, pageNumber, pageSize, sort, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listOrgGroupPolicies'"); if (!_config.unstableOperations["v2.listOrgGroupPolicies"]) { throw new Error("Unstable operation 'listOrgGroupPolicies' is disabled"); } // verify required parameter 'filterOrgGroupId' is not null or undefined if (filterOrgGroupId === null || filterOrgGroupId === undefined) { throw new baseapi_1.RequiredError("filterOrgGroupId", "listOrgGroupPolicies"); } // Path Params const localVarPath = "/api/v2/org_group_policies"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.listOrgGroupPolicies") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (filterOrgGroupId !== undefined) { requestContext.setQueryParam("filter[org_group_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterOrgGroupId, "string", "uuid"), ""); } if (filterPolicyName !== undefined) { requestContext.setQueryParam("filter[policy_name]", ObjectSerializer_1.ObjectSerializer.serialize(filterPolicyName, "string", ""), ""); } 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, "OrgGroupPolicySortOption", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } listOrgGroupPolicyConfigs(_options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listOrgGroupPolicyConfigs'"); if (!_config.unstableOperations["v2.listOrgGroupPolicyConfigs"]) { throw new Error("Unstable operation 'listOrgGroupPolicyConfigs' is disabled"); } // Path Params const localVarPath = "/api/v2/org_group_policy_configs"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.listOrgGroupPolicyConfigs") .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", ]); return requestContext; }); } listOrgGroupPolicyOverrides(filterOrgGroupId, filterPolicyId, pageNumber, pageSize, sort, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listOrgGroupPolicyOverrides'"); if (!_config.unstableOperations["v2.listOrgGroupPolicyOverrides"]) { throw new Error("Unstable operation 'listOrgGroupPolicyOverrides' is disabled"); } // verify required parameter 'filterOrgGroupId' is not null or undefined if (filterOrgGroupId === null || filterOrgGroupId === undefined) { throw new baseapi_1.RequiredError("filterOrgGroupId", "listOrgGroupPolicyOverrides"); } // Path Params const localVarPath = "/api/v2/org_group_policy_overrides"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.listOrgGroupPolicyOverrides") .makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); // Query Params if (filterOrgGroupId !== undefined) { requestContext.setQueryParam("filter[org_group_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterOrgGroupId, "string", "uuid"), ""); } if (filterPolicyId !== undefined) { requestContext.setQueryParam("filter[policy_id]", ObjectSerializer_1.ObjectSerializer.serialize(filterPolicyId, "string", "uuid"), ""); } 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, "OrgGroupPolicyOverrideSortOption", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } listOrgGroups(pageNumber, pageSize, sort, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'listOrgGroups'"); if (!_config.unstableOperations["v2.listOrgGroups"]) { throw new Error("Unstable operation 'listOrgGroups' is disabled"); } // Path Params const localVarPath = "/api/v2/org_groups"; // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.listOrgGroups") .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, "OrgGroupSortOption", ""), ""); } // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } updateOrgGroup(orgGroupId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'updateOrgGroup'"); if (!_config.unstableOperations["v2.updateOrgGroup"]) { throw new Error("Unstable operation 'updateOrgGroup' is disabled"); } // verify required parameter 'orgGroupId' is not null or undefined if (orgGroupId === null || orgGroupId === undefined) { throw new baseapi_1.RequiredError("orgGroupId", "updateOrgGroup"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateOrgGroup"); } // Path Params const localVarPath = "/api/v2/org_groups/{org_group_id}".replace("{org_group_id}", encodeURIComponent(String(orgGroupId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.updateOrgGroup") .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, "OrgGroupUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } updateOrgGroupMembership(orgGroupMembershipId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'updateOrgGroupMembership'"); if (!_config.unstableOperations["v2.updateOrgGroupMembership"]) { throw new Error("Unstable operation 'updateOrgGroupMembership' is disabled"); } // verify required parameter 'orgGroupMembershipId' is not null or undefined if (orgGroupMembershipId === null || orgGroupMembershipId === undefined) { throw new baseapi_1.RequiredError("orgGroupMembershipId", "updateOrgGroupMembership"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateOrgGroupMembership"); } // Path Params const localVarPath = "/api/v2/org_group_memberships/{org_group_membership_id}".replace("{org_group_membership_id}", encodeURIComponent(String(orgGroupMembershipId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.updateOrgGroupMembership") .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, "OrgGroupMembershipUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } updateOrgGroupPolicy(orgGroupPolicyId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'updateOrgGroupPolicy'"); if (!_config.unstableOperations["v2.updateOrgGroupPolicy"]) { throw new Error("Unstable operation 'updateOrgGroupPolicy' is disabled"); } // verify required parameter 'orgGroupPolicyId' is not null or undefined if (orgGroupPolicyId === null || orgGroupPolicyId === undefined) { throw new baseapi_1.RequiredError("orgGroupPolicyId", "updateOrgGroupPolicy"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateOrgGroupPolicy"); } // Path Params const localVarPath = "/api/v2/org_group_policies/{org_group_policy_id}".replace("{org_group_policy_id}", encodeURIComponent(String(orgGroupPolicyId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.updateOrgGroupPolicy") .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, "OrgGroupPolicyUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } updateOrgGroupPolicyOverride(orgGroupPolicyOverrideId, body, _options) { return __awaiter(this, void 0, void 0, function* () { const _config = _options || this.configuration; logger_1.logger.warn("Using unstable operation 'updateOrgGroupPolicyOverride'"); if (!_config.unstableOperations["v2.updateOrgGroupPolicyOverride"]) { throw new Error("Unstable operation 'updateOrgGroupPolicyOverride' is disabled"); } // verify required parameter 'orgGroupPolicyOverrideId' is not null or undefined if (orgGroupPolicyOverrideId === null || orgGroupPolicyOverrideId === undefined) { throw new baseapi_1.RequiredError("orgGroupPolicyOverrideId", "updateOrgGroupPolicyOverride"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new baseapi_1.RequiredError("body", "updateOrgGroupPolicyOverride"); } // Path Params const localVarPath = "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}".replace("{org_group_policy_override_id}", encodeURIComponent(String(orgGroupPolicyOverrideId))); // Make Request Context const requestContext = _config .getServer("v2.OrgGroupsApi.updateOrgGroupPolicyOverride") .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, "OrgGroupPolicyOverrideUpdateRequest", ""), contentType); requestContext.setBody(serializedBody); // Apply auth methods (0, configuration_1.applySecurityAuthentication)(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", ]); return requestContext; }); } } exports.OrgGroupsApiRequestFactory = OrgGroupsApiRequestFactory; class OrgGroupsApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to bulkUpdateOrgGroupMemberships * @throws ApiException if the response code was not in [200, 299] */ bulkUpdateOrgGroupMemberships(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (response.httpStatusCode === 200) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupMembershipListResponse"); return body; } if (response.httpStatusCode === 400 || response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 404) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } if (response.httpStatusCode === 429) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupMembershipListResponse", ""); return body; } const body = (yield response.body.text()) || ""; throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"'); }); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createOrgGroup * @throws ApiException if the response code was not in [200, 299] */ createOrgGroup(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (response.httpStatusCode === 201) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupResponse"); return body; } if (response.httpStatusCode === 400 || response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 409) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } if (response.httpStatusCode === 429) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupResponse", ""); return body; } const body = (yield response.body.text()) || ""; throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"'); }); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createOrgGroupPolicy * @throws ApiException if the response code was not in [200, 299] */ createOrgGroupPolicy(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (response.httpStatusCode === 201) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupPolicyResponse"); return body; } if (response.httpStatusCode === 400 || response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 409) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } if (response.httpStatusCode === 429) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupPolicyResponse", ""); return body; } const body = (yield response.body.text()) || ""; throw new exception_1.ApiException(response.httpStatusCode, 'Unknown API Status Code!\nBody: "' + body + '"'); }); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createOrgGroupPolicyOverride * @throws ApiException if the response code was not in [200, 299] */ createOrgGroupPolicyOverride(response) { return __awaiter(this, void 0, void 0, function* () { const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (response.httpStatusCode === 201) { const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType), "OrgGroupPolicyOverrideResponse"); return body; } if (response.httpStatusCode === 400 || response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 409) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "JSONAPIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } if (response.httpStatusCode === 429) { const bodyText = ObjectSerializer_1.ObjectSerializer.parse(yield response.body.text(), contentType); let body; try { body = ObjectSerializer_1.ObjectSerializer.deserialize(bodyText, "APIErrorResponse"); } catch (error) { logger_1.logger.debug(`Got error deserializing error: ${error}`); throw new exception_1.ApiException(response.httpStatusCode, bodyText); } throw new exception_1.ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 29