@tapis/tapis-typescript-sk 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/.openapi-generator/FILES +16 -6
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +5 -4
  4. package/dist/apis/AdminApi.d.ts +26 -0
  5. package/dist/apis/AdminApi.js +128 -0
  6. package/dist/apis/GeneralApi.d.ts +25 -16
  7. package/dist/apis/GeneralApi.js +72 -23
  8. package/dist/apis/RoleApi.d.ts +99 -76
  9. package/dist/apis/RoleApi.js +540 -340
  10. package/dist/apis/ShareApi.d.ts +110 -0
  11. package/dist/apis/ShareApi.js +469 -0
  12. package/dist/apis/UserApi.d.ts +84 -126
  13. package/dist/apis/UserApi.js +467 -538
  14. package/dist/apis/VaultApi.d.ts +52 -49
  15. package/dist/apis/VaultApi.js +413 -341
  16. package/dist/apis/index.d.ts +2 -0
  17. package/dist/apis/index.js +20 -7
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +17 -6
  20. package/dist/models/Options.d.ts +8 -3
  21. package/dist/models/Options.js +23 -15
  22. package/dist/models/ReqAddChildRole.d.ts +11 -6
  23. package/dist/models/ReqAddChildRole.js +33 -19
  24. package/dist/models/ReqAddRolePermission.d.ts +18 -6
  25. package/dist/models/ReqAddRolePermission.js +36 -19
  26. package/dist/models/ReqCreateRole.d.ts +18 -6
  27. package/dist/models/ReqCreateRole.js +36 -19
  28. package/dist/models/ReqGrantRole.d.ts +51 -0
  29. package/dist/models/ReqGrantRole.js +62 -0
  30. package/dist/models/ReqGrantRoleWithPermission.d.ts +57 -0
  31. package/dist/models/ReqGrantRoleWithPermission.js +66 -0
  32. package/dist/models/ReqGrantUserPermission.d.ts +11 -6
  33. package/dist/models/ReqGrantUserPermission.js +33 -19
  34. package/dist/models/ReqPreviewPathPrefix.d.ts +19 -7
  35. package/dist/models/ReqPreviewPathPrefix.js +46 -27
  36. package/dist/models/ReqRemoveChildRole.d.ts +11 -6
  37. package/dist/models/ReqRemoveChildRole.js +33 -19
  38. package/dist/models/ReqRemovePermissionFromAllRoles.d.ts +38 -0
  39. package/dist/models/ReqRemovePermissionFromAllRoles.js +55 -0
  40. package/dist/models/ReqRemoveRolePermission.d.ts +18 -6
  41. package/dist/models/ReqRemoveRolePermission.js +36 -19
  42. package/dist/models/ReqReplacePathPrefix.d.ts +19 -7
  43. package/dist/models/ReqReplacePathPrefix.js +46 -27
  44. package/dist/models/ReqRevokeRole.d.ts +51 -0
  45. package/dist/models/ReqRevokeRole.js +62 -0
  46. package/dist/models/ReqRevokeUserPermission.d.ts +11 -6
  47. package/dist/models/ReqRevokeUserPermission.js +33 -19
  48. package/dist/models/ReqRolePermits.d.ts +45 -0
  49. package/dist/models/ReqRolePermits.js +60 -0
  50. package/dist/models/ReqShareResource.d.ts +68 -0
  51. package/dist/models/ReqShareResource.js +73 -0
  52. package/dist/models/ReqUpdateRoleDescription.d.ts +17 -5
  53. package/dist/models/ReqUpdateRoleDescription.js +32 -17
  54. package/dist/models/ReqUpdateRoleName.d.ts +17 -5
  55. package/dist/models/ReqUpdateRoleName.js +32 -17
  56. package/dist/models/ReqUpdateRoleOwner.d.ts +17 -5
  57. package/dist/models/ReqUpdateRoleOwner.js +34 -19
  58. package/dist/models/ReqUserHasRole.d.ts +18 -6
  59. package/dist/models/ReqUserHasRole.js +38 -21
  60. package/dist/models/ReqUserHasRoleMulti.d.ts +11 -6
  61. package/dist/models/ReqUserHasRoleMulti.js +35 -21
  62. package/dist/models/ReqUserIsAdmin.d.ts +10 -5
  63. package/dist/models/ReqUserIsAdmin.js +29 -17
  64. package/dist/models/ReqUserIsPermitted.d.ts +11 -6
  65. package/dist/models/ReqUserIsPermitted.js +35 -21
  66. package/dist/models/ReqUserIsPermittedMulti.d.ts +11 -6
  67. package/dist/models/ReqUserIsPermittedMulti.js +35 -21
  68. package/dist/models/ReqValidatePwd.d.ts +44 -0
  69. package/dist/models/ReqValidatePwd.js +59 -0
  70. package/dist/models/ReqVersions.d.ts +11 -6
  71. package/dist/models/ReqVersions.js +33 -19
  72. package/dist/models/ReqWriteSecret.d.ts +12 -7
  73. package/dist/models/ReqWriteSecret.js +36 -22
  74. package/dist/models/RespAuthorized.d.ts +27 -4
  75. package/dist/models/RespAuthorized.js +36 -22
  76. package/dist/models/RespBasic.d.ts +26 -3
  77. package/dist/models/RespBasic.js +35 -21
  78. package/dist/models/RespBoolean.d.ts +69 -0
  79. package/dist/models/RespBoolean.js +62 -0
  80. package/dist/models/RespChangeCount.d.ts +27 -4
  81. package/dist/models/RespChangeCount.js +36 -22
  82. package/dist/models/RespName.d.ts +27 -4
  83. package/dist/models/RespName.js +36 -22
  84. package/dist/models/RespNameArray.d.ts +27 -4
  85. package/dist/models/RespNameArray.js +36 -22
  86. package/dist/models/RespPathPrefixes.d.ts +27 -4
  87. package/dist/models/RespPathPrefixes.js +36 -22
  88. package/dist/models/RespProbe.d.ts +27 -4
  89. package/dist/models/RespProbe.js +36 -22
  90. package/dist/models/RespResourceUrl.d.ts +27 -4
  91. package/dist/models/RespResourceUrl.js +36 -22
  92. package/dist/models/RespRole.d.ts +27 -4
  93. package/dist/models/RespRole.js +36 -22
  94. package/dist/models/RespSecret.d.ts +27 -4
  95. package/dist/models/RespSecret.js +36 -22
  96. package/dist/models/RespSecretList.d.ts +27 -4
  97. package/dist/models/RespSecretList.js +36 -22
  98. package/dist/models/RespSecretMeta.d.ts +27 -4
  99. package/dist/models/RespSecretMeta.js +36 -22
  100. package/dist/models/RespSecretVersionMetadata.d.ts +27 -4
  101. package/dist/models/RespSecretVersionMetadata.js +36 -22
  102. package/dist/models/RespShare.d.ts +69 -0
  103. package/dist/models/RespShare.js +62 -0
  104. package/dist/models/RespShareList.d.ts +69 -0
  105. package/dist/models/RespShareList.js +62 -0
  106. package/dist/models/RespVersions.d.ts +26 -3
  107. package/dist/models/RespVersions.js +35 -21
  108. package/dist/models/ResultAuthorized.d.ts +8 -3
  109. package/dist/models/ResultAuthorized.js +23 -15
  110. package/dist/models/ResultBoolean.d.ts +32 -0
  111. package/dist/models/ResultBoolean.js +49 -0
  112. package/dist/models/ResultChangeCount.d.ts +8 -3
  113. package/dist/models/ResultChangeCount.js +23 -15
  114. package/dist/models/ResultName.d.ts +8 -3
  115. package/dist/models/ResultName.js +23 -15
  116. package/dist/models/ResultNameArray.d.ts +8 -3
  117. package/dist/models/ResultNameArray.js +23 -15
  118. package/dist/models/ResultResourceUrl.d.ts +8 -3
  119. package/dist/models/ResultResourceUrl.js +23 -15
  120. package/dist/models/RoleTypeEnum.d.ts +28 -0
  121. package/dist/models/RoleTypeEnum.js +54 -0
  122. package/dist/models/SkProbe.d.ts +8 -21
  123. package/dist/models/SkProbe.js +23 -21
  124. package/dist/models/SkRole.d.ts +19 -7
  125. package/dist/models/SkRole.js +48 -37
  126. package/dist/models/SkSecret.d.ts +9 -4
  127. package/dist/models/SkSecret.js +26 -18
  128. package/dist/models/SkSecretList.d.ts +8 -3
  129. package/dist/models/SkSecretList.js +25 -17
  130. package/dist/models/SkSecretMetadata.d.ts +8 -3
  131. package/dist/models/SkSecretMetadata.js +29 -21
  132. package/dist/models/SkSecretVersion.d.ts +8 -3
  133. package/dist/models/SkSecretVersion.js +29 -21
  134. package/dist/models/SkSecretVersionMetadata.d.ts +9 -4
  135. package/dist/models/SkSecretVersionMetadata.js +34 -26
  136. package/dist/models/SkShare.d.ts +92 -0
  137. package/dist/models/SkShare.js +69 -0
  138. package/dist/models/SkShareList.d.ts +33 -0
  139. package/dist/models/SkShareList.js +50 -0
  140. package/dist/models/Transformation.d.ts +8 -3
  141. package/dist/models/Transformation.js +27 -19
  142. package/dist/models/index.d.ts +14 -6
  143. package/dist/models/index.js +75 -56
  144. package/dist/runtime.d.ts +80 -38
  145. package/dist/runtime.js +313 -171
  146. package/package.json +6 -2
  147. package/src/apis/AdminApi.ts +63 -0
  148. package/src/apis/GeneralApi.ts +48 -24
  149. package/src/apis/RoleApi.ts +374 -220
  150. package/src/apis/ShareApi.ts +418 -0
  151. package/src/apis/UserApi.ts +258 -383
  152. package/src/apis/VaultApi.ts +347 -275
  153. package/src/apis/index.ts +2 -0
  154. package/src/index.ts +2 -2
  155. package/src/models/Options.ts +21 -12
  156. package/src/models/ReqAddChildRole.ts +31 -19
  157. package/src/models/ReqAddRolePermission.ts +49 -19
  158. package/src/models/ReqCreateRole.ts +49 -19
  159. package/src/models/ReqGrantRole.ts +102 -0
  160. package/src/models/ReqGrantRoleWithPermission.ts +111 -0
  161. package/src/models/ReqGrantUserPermission.ts +31 -19
  162. package/src/models/ReqPreviewPathPrefix.ts +59 -28
  163. package/src/models/ReqRemoveChildRole.ts +31 -19
  164. package/src/models/ReqRemovePermissionFromAllRoles.ts +75 -0
  165. package/src/models/ReqRemoveRolePermission.ts +49 -19
  166. package/src/models/ReqReplacePathPrefix.ts +59 -28
  167. package/src/models/ReqRevokeRole.ts +102 -0
  168. package/src/models/ReqRevokeUserPermission.ts +31 -19
  169. package/src/models/ReqRolePermits.ts +94 -0
  170. package/src/models/ReqShareResource.ts +119 -0
  171. package/src/models/ReqUpdateRoleDescription.ts +45 -16
  172. package/src/models/ReqUpdateRoleName.ts +45 -16
  173. package/src/models/ReqUpdateRoleOwner.ts +47 -18
  174. package/src/models/ReqUserHasRole.ts +51 -21
  175. package/src/models/ReqUserHasRoleMulti.ts +33 -21
  176. package/src/models/ReqUserIsAdmin.ts +27 -16
  177. package/src/models/ReqUserIsPermitted.ts +33 -21
  178. package/src/models/ReqUserIsPermittedMulti.ts +33 -21
  179. package/src/models/ReqValidatePwd.ts +84 -0
  180. package/src/models/ReqVersions.ts +31 -19
  181. package/src/models/ReqWriteSecret.ts +36 -23
  182. package/src/models/RespAuthorized.ts +54 -20
  183. package/src/models/RespBasic.ts +51 -18
  184. package/src/models/RespBoolean.ts +121 -0
  185. package/src/models/RespChangeCount.ts +54 -20
  186. package/src/models/RespName.ts +54 -20
  187. package/src/models/RespNameArray.ts +54 -20
  188. package/src/models/RespPathPrefixes.ts +54 -20
  189. package/src/models/RespProbe.ts +54 -20
  190. package/src/models/RespResourceUrl.ts +54 -20
  191. package/src/models/RespRole.ts +54 -20
  192. package/src/models/RespSecret.ts +54 -20
  193. package/src/models/RespSecretList.ts +54 -20
  194. package/src/models/RespSecretMeta.ts +54 -20
  195. package/src/models/RespSecretVersionMetadata.ts +54 -20
  196. package/src/models/RespShare.ts +121 -0
  197. package/src/models/RespShareList.ts +121 -0
  198. package/src/models/RespVersions.ts +51 -18
  199. package/src/models/ResultAuthorized.ts +21 -12
  200. package/src/models/ResultBoolean.ts +65 -0
  201. package/src/models/ResultChangeCount.ts +21 -12
  202. package/src/models/ResultName.ts +21 -12
  203. package/src/models/ResultNameArray.ts +21 -12
  204. package/src/models/ResultResourceUrl.ts +21 -12
  205. package/src/models/RoleTypeEnum.ts +56 -0
  206. package/src/models/SkProbe.ts +21 -36
  207. package/src/models/SkRole.ts +65 -38
  208. package/src/models/SkSecret.ts +26 -16
  209. package/src/models/SkSecretList.ts +23 -14
  210. package/src/models/SkSecretMetadata.ts +27 -18
  211. package/src/models/SkSecretVersion.ts +27 -18
  212. package/src/models/SkSecretVersionMetadata.ts +34 -24
  213. package/src/models/SkShare.ts +145 -0
  214. package/src/models/SkShareList.ts +73 -0
  215. package/src/models/Transformation.ts +25 -16
  216. package/src/models/index.ts +14 -6
  217. package/src/runtime.ts +219 -108
  218. package/dist/models/ReqGrantAdminRole.d.ts +0 -33
  219. package/dist/models/ReqGrantAdminRole.js +0 -43
  220. package/dist/models/ReqGrantUserRole.d.ts +0 -39
  221. package/dist/models/ReqGrantUserRole.js +0 -45
  222. package/dist/models/ReqGrantUserRoleWithPermission.d.ts +0 -45
  223. package/dist/models/ReqGrantUserRoleWithPermission.js +0 -47
  224. package/dist/models/ReqRevokeAdminRole.d.ts +0 -33
  225. package/dist/models/ReqRevokeAdminRole.js +0 -43
  226. package/dist/models/ReqRevokeUserRole.d.ts +0 -39
  227. package/dist/models/ReqRevokeUserRole.js +0 -45
  228. package/dist/models/ReqValidateServicePwd.d.ts +0 -39
  229. package/dist/models/ReqValidateServicePwd.js +0 -45
  230. package/src/models/ReqGrantAdminRole.ts +0 -64
  231. package/src/models/ReqGrantUserRole.ts +0 -72
  232. package/src/models/ReqGrantUserRoleWithPermission.ts +0 -80
  233. package/src/models/ReqRevokeAdminRole.ts +0 -64
  234. package/src/models/ReqRevokeUserRole.ts +0 -72
  235. package/src/models/ReqValidateServicePwd.ts +0 -72
@@ -3,9 +3,9 @@
3
3
  /* eslint-disable */
4
4
  /**
5
5
  * Tapis Security API
6
- * The Tapis Security API provides access to the Tapis Security Kernel authorization and secrets facilities.
6
+ * The Tapis Security API provides for management of Security Kernel (SK) role-based authorization and secrets resources.
7
7
  *
8
- * The version of the OpenAPI document: 0.1
8
+ * The version of the OpenAPI document: 1.8.2
9
9
  * Contact: cicsupport@tacc.utexas.edu
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,30 +13,36 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  var __extends = (this && this.__extends) || (function () {
16
- var extendStatics = Object.setPrototypeOf ||
17
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
19
22
  return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
20
25
  extendStatics(d, b);
21
26
  function __() { this.constructor = d; }
22
27
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23
28
  };
24
29
  })();
25
30
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
32
  return new (P || (P = Promise))(function (resolve, reject) {
27
33
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
34
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
36
  step((generator = generator.apply(thisArg, _arguments || [])).next());
31
37
  });
32
38
  };
33
39
  var __generator = (this && this.__generator) || function (thisArg, body) {
34
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
35
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
41
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
42
  function verb(n) { return function (v) { return step([n, v]); }; }
37
43
  function step(op) {
38
44
  if (f) throw new TypeError("Generator is already executing.");
39
- while (_) try {
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
40
46
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
41
47
  if (y = 0, t) op = [op[0] & 2, t.value];
42
48
  switch (op[0]) {
@@ -58,8 +64,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
58
64
  }
59
65
  };
60
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.UserApi = void 0;
61
68
  var runtime = require("../runtime");
62
- var models_1 = require("../models");
69
+ var index_1 = require("../models/index");
63
70
  /**
64
71
  *
65
72
  */
@@ -69,40 +76,41 @@ var UserApi = /** @class */ (function (_super) {
69
76
  return _super !== null && _super.apply(this, arguments) || this;
70
77
  }
71
78
  /**
72
- * Get all users assigned the tenant administrator role ($!tenant_admin). This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
79
+ * Get all users assigned the tenant administrator role ($!tenant_admin). This request is authorized if the requestor is a service or a user that has access to the specified tenant.
73
80
  */
74
81
  UserApi.prototype.getAdminsRaw = function (requestParameters, initOverrides) {
75
82
  return __awaiter(this, void 0, void 0, function () {
76
- var queryParameters, headerParameters, response;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
83
+ var queryParameters, headerParameters, _a, _b, response;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
79
86
  case 0:
80
- if (requestParameters.tenant === null || requestParameters.tenant === undefined) {
81
- throw new runtime.RequiredError('tenant', 'Required parameter requestParameters.tenant was null or undefined when calling getAdmins.');
87
+ if (requestParameters['tenant'] == null) {
88
+ throw new runtime.RequiredError('tenant', 'Required parameter "tenant" was null or undefined when calling getAdmins().');
82
89
  }
83
90
  queryParameters = {};
84
- if (requestParameters.pretty !== undefined) {
85
- queryParameters['pretty'] = requestParameters.pretty;
86
- }
87
91
  headerParameters = {};
88
- if (this.configuration && this.configuration.apiKey) {
89
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
90
- }
91
- return [4 /*yield*/, this.request({
92
- path: "/security/user/admins/{tenant}".replace("{" + "tenant" + "}", encodeURIComponent(String(requestParameters.tenant))),
93
- method: 'GET',
94
- headers: headerParameters,
95
- query: queryParameters,
96
- }, initOverrides)];
92
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
93
+ _a = headerParameters;
94
+ _b = "X-Tapis-Token";
95
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
97
96
  case 1:
98
- response = _a.sent();
99
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
97
+ _a[_b] = _c.sent(); // TapisJWT authentication
98
+ _c.label = 2;
99
+ case 2: return [4 /*yield*/, this.request({
100
+ path: "/security/user/admins/{tenant}".replace("{".concat("tenant", "}"), encodeURIComponent(String(requestParameters['tenant']))),
101
+ method: 'GET',
102
+ headers: headerParameters,
103
+ query: queryParameters,
104
+ }, initOverrides)];
105
+ case 3:
106
+ response = _c.sent();
107
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
100
108
  }
101
109
  });
102
110
  });
103
111
  };
104
112
  /**
105
- * Get all users assigned the tenant administrator role ($!tenant_admin). This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
113
+ * Get all users assigned the tenant administrator role ($!tenant_admin). This request is authorized if the requestor is a service or a user that has access to the specified tenant.
106
114
  */
107
115
  UserApi.prototype.getAdmins = function (requestParameters, initOverrides) {
108
116
  return __awaiter(this, void 0, void 0, function () {
@@ -119,37 +127,41 @@ var UserApi = /** @class */ (function (_super) {
119
127
  });
120
128
  };
121
129
  /**
122
- * Get a user\'s default role. The default role is implicitly created by the system when needed if it doesn\'t already exist. No authorization required. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. This implies the maximum length of a user name is 58 since role names are limited to 60 characters.
130
+ * Get a user\'s default role. The default role is implicitly created by the system when needed if it doesn\'t already exist. No authorization required. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. This implies the maximum length of a user name is 58 since role names are limited to 60 characters.
123
131
  */
124
132
  UserApi.prototype.getDefaultUserRole1Raw = function (requestParameters, initOverrides) {
125
133
  return __awaiter(this, void 0, void 0, function () {
126
- var queryParameters, headerParameters, response;
127
- return __generator(this, function (_a) {
128
- switch (_a.label) {
134
+ var queryParameters, headerParameters, _a, _b, response;
135
+ return __generator(this, function (_c) {
136
+ switch (_c.label) {
129
137
  case 0:
130
- if (requestParameters.user === null || requestParameters.user === undefined) {
131
- throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling getDefaultUserRole1.');
138
+ if (requestParameters['user'] == null) {
139
+ throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling getDefaultUserRole1().');
132
140
  }
133
141
  queryParameters = {};
134
- if (requestParameters.pretty !== undefined) {
135
- queryParameters['pretty'] = requestParameters.pretty;
136
- }
137
142
  headerParameters = {};
138
- return [4 /*yield*/, this.request({
139
- path: "/security/user/defaultRole/{user}".replace("{" + "user" + "}", encodeURIComponent(String(requestParameters.user))),
140
- method: 'GET',
141
- headers: headerParameters,
142
- query: queryParameters,
143
- }, initOverrides)];
143
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
144
+ _a = headerParameters;
145
+ _b = "X-Tapis-Token";
146
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
144
147
  case 1:
145
- response = _a.sent();
146
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameFromJSON(jsonValue); })];
148
+ _a[_b] = _c.sent(); // TapisJWT authentication
149
+ _c.label = 2;
150
+ case 2: return [4 /*yield*/, this.request({
151
+ path: "/security/user/defaultRole/{user}".replace("{".concat("user", "}"), encodeURIComponent(String(requestParameters['user']))),
152
+ method: 'GET',
153
+ headers: headerParameters,
154
+ query: queryParameters,
155
+ }, initOverrides)];
156
+ case 3:
157
+ response = _c.sent();
158
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameFromJSON)(jsonValue); })];
147
159
  }
148
160
  });
149
161
  });
150
162
  };
151
163
  /**
152
- * Get a user\'s default role. The default role is implicitly created by the system when needed if it doesn\'t already exist. No authorization required. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. This implies the maximum length of a user name is 58 since role names are limited to 60 characters.
164
+ * Get a user\'s default role. The default role is implicitly created by the system when needed if it doesn\'t already exist. No authorization required. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. This implies the maximum length of a user name is 58 since role names are limited to 60 characters.
153
165
  */
154
166
  UserApi.prototype.getDefaultUserRole1 = function (requestParameters, initOverrides) {
155
167
  return __awaiter(this, void 0, void 0, function () {
@@ -166,44 +178,46 @@ var UserApi = /** @class */ (function (_super) {
166
178
  });
167
179
  };
168
180
  /**
169
- * Get the names of all users in the tenant that have been granted a role or permission. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
181
+ * Get the names of all users in the tenant that have been granted a role or permission. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
170
182
  */
171
183
  UserApi.prototype.getUserNamesRaw = function (requestParameters, initOverrides) {
172
184
  return __awaiter(this, void 0, void 0, function () {
173
- var queryParameters, headerParameters, response;
174
- return __generator(this, function (_a) {
175
- switch (_a.label) {
185
+ var queryParameters, headerParameters, _a, _b, response;
186
+ return __generator(this, function (_c) {
187
+ switch (_c.label) {
176
188
  case 0:
177
189
  queryParameters = {};
178
- if (requestParameters.tenant !== undefined) {
179
- queryParameters['tenant'] = requestParameters.tenant;
180
- }
181
- if (requestParameters.pretty !== undefined) {
182
- queryParameters['pretty'] = requestParameters.pretty;
190
+ if (requestParameters['tenant'] != null) {
191
+ queryParameters['tenant'] = requestParameters['tenant'];
183
192
  }
184
193
  headerParameters = {};
185
- if (this.configuration && this.configuration.apiKey) {
186
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
187
- }
188
- return [4 /*yield*/, this.request({
189
- path: "/security/user",
190
- method: 'GET',
191
- headers: headerParameters,
192
- query: queryParameters,
193
- }, initOverrides)];
194
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
195
+ _a = headerParameters;
196
+ _b = "X-Tapis-Token";
197
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
194
198
  case 1:
195
- response = _a.sent();
196
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
199
+ _a[_b] = _c.sent(); // TapisJWT authentication
200
+ _c.label = 2;
201
+ case 2: return [4 /*yield*/, this.request({
202
+ path: "/security/user",
203
+ method: 'GET',
204
+ headers: headerParameters,
205
+ query: queryParameters,
206
+ }, initOverrides)];
207
+ case 3:
208
+ response = _c.sent();
209
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
197
210
  }
198
211
  });
199
212
  });
200
213
  };
201
214
  /**
202
- * Get the names of all users in the tenant that have been granted a role or permission. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
215
+ * Get the names of all users in the tenant that have been granted a role or permission. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
203
216
  */
204
- UserApi.prototype.getUserNames = function (requestParameters, initOverrides) {
205
- return __awaiter(this, void 0, void 0, function () {
217
+ UserApi.prototype.getUserNames = function () {
218
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
206
219
  var response;
220
+ if (requestParameters === void 0) { requestParameters = {}; }
207
221
  return __generator(this, function (_a) {
208
222
  switch (_a.label) {
209
223
  case 0: return [4 /*yield*/, this.getUserNamesRaw(requestParameters, initOverrides)];
@@ -216,49 +230,50 @@ var UserApi = /** @class */ (function (_super) {
216
230
  });
217
231
  };
218
232
  /**
219
- * Get the permissions assigned to a user in a tenant, including those assigned transively. The result list can be optionally filtered by the one or both of the query parameters: implies and impliedBy. The implied parameter removes permissions from the result list that the specified permission do not imply. The impliedBy parameter removes permissions from the result list that the specified permission are not implied by. Below are some examples.Consider a user that is assigned these permissions: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 **Using the *implies* Query Parameter** When _implies=stream:dev:*:project1_, this endpoint returns: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 When _implies=stream:dev:write:project1_, this endpoint returns an empty list. **Using the *impliedBy* Query Parameter** When _impliedBy=stream:dev:*:project1_, this endpoint returns an empty list. When _impliedBy=stream:dev:write:project1_, this endpoint returns: stream:dev:read,write:project1 stream:dev:read,write,exec:project1 This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
233
+ * Get the permissions assigned to a user in a tenant, including those assigned transively. The result list can be optionally filtered by the one or both of the query parameters: implies and impliedBy. When implies is set, the filter _implies_ each entry in the result set. When impliedBy is set, each entry in the result set is _implied by_ the filter. Below are some examples. Consider a user that is assigned these permissions: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 **Using the *implies* Query Parameter** When _implies=stream:dev:*:project1_, this endpoint returns: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 When _implies=stream:dev:write:project1_, this endpoint returns an empty list. **Using the *impliedBy* Query Parameter** When _impliedBy=stream:dev:*:project1_, this endpoint returns an empty list. When _impliedBy=stream:dev:write:project1_, this endpoint returns: stream:dev:read,write:project1 stream:dev:read,write,exec:project1 This request is authorized if the requestor is a service or a user that has access to the specified tenant.
220
234
  */
221
235
  UserApi.prototype.getUserPermsRaw = function (requestParameters, initOverrides) {
222
236
  return __awaiter(this, void 0, void 0, function () {
223
- var queryParameters, headerParameters, response;
224
- return __generator(this, function (_a) {
225
- switch (_a.label) {
237
+ var queryParameters, headerParameters, _a, _b, response;
238
+ return __generator(this, function (_c) {
239
+ switch (_c.label) {
226
240
  case 0:
227
- if (requestParameters.user === null || requestParameters.user === undefined) {
228
- throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling getUserPerms.');
241
+ if (requestParameters['user'] == null) {
242
+ throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling getUserPerms().');
229
243
  }
230
244
  queryParameters = {};
231
- if (requestParameters.tenant !== undefined) {
232
- queryParameters['tenant'] = requestParameters.tenant;
245
+ if (requestParameters['tenant'] != null) {
246
+ queryParameters['tenant'] = requestParameters['tenant'];
233
247
  }
234
- if (requestParameters.implies !== undefined) {
235
- queryParameters['implies'] = requestParameters.implies;
248
+ if (requestParameters['implies'] != null) {
249
+ queryParameters['implies'] = requestParameters['implies'];
236
250
  }
237
- if (requestParameters.impliedBy !== undefined) {
238
- queryParameters['impliedBy'] = requestParameters.impliedBy;
239
- }
240
- if (requestParameters.pretty !== undefined) {
241
- queryParameters['pretty'] = requestParameters.pretty;
251
+ if (requestParameters['impliedBy'] != null) {
252
+ queryParameters['impliedBy'] = requestParameters['impliedBy'];
242
253
  }
243
254
  headerParameters = {};
244
- if (this.configuration && this.configuration.apiKey) {
245
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
246
- }
247
- return [4 /*yield*/, this.request({
248
- path: "/security/user/perms/{user}".replace("{" + "user" + "}", encodeURIComponent(String(requestParameters.user))),
249
- method: 'GET',
250
- headers: headerParameters,
251
- query: queryParameters,
252
- }, initOverrides)];
255
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
256
+ _a = headerParameters;
257
+ _b = "X-Tapis-Token";
258
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
253
259
  case 1:
254
- response = _a.sent();
255
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
260
+ _a[_b] = _c.sent(); // TapisJWT authentication
261
+ _c.label = 2;
262
+ case 2: return [4 /*yield*/, this.request({
263
+ path: "/security/user/perms/{user}".replace("{".concat("user", "}"), encodeURIComponent(String(requestParameters['user']))),
264
+ method: 'GET',
265
+ headers: headerParameters,
266
+ query: queryParameters,
267
+ }, initOverrides)];
268
+ case 3:
269
+ response = _c.sent();
270
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
256
271
  }
257
272
  });
258
273
  });
259
274
  };
260
275
  /**
261
- * Get the permissions assigned to a user in a tenant, including those assigned transively. The result list can be optionally filtered by the one or both of the query parameters: implies and impliedBy. The implied parameter removes permissions from the result list that the specified permission do not imply. The impliedBy parameter removes permissions from the result list that the specified permission are not implied by. Below are some examples.Consider a user that is assigned these permissions: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 **Using the *implies* Query Parameter** When _implies=stream:dev:*:project1_, this endpoint returns: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 When _implies=stream:dev:write:project1_, this endpoint returns an empty list. **Using the *impliedBy* Query Parameter** When _impliedBy=stream:dev:*:project1_, this endpoint returns an empty list. When _impliedBy=stream:dev:write:project1_, this endpoint returns: stream:dev:read,write:project1 stream:dev:read,write,exec:project1 This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
276
+ * Get the permissions assigned to a user in a tenant, including those assigned transively. The result list can be optionally filtered by the one or both of the query parameters: implies and impliedBy. When implies is set, the filter _implies_ each entry in the result set. When impliedBy is set, each entry in the result set is _implied by_ the filter. Below are some examples. Consider a user that is assigned these permissions: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 **Using the *implies* Query Parameter** When _implies=stream:dev:*:project1_, this endpoint returns: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 When _implies=stream:dev:write:project1_, this endpoint returns an empty list. **Using the *impliedBy* Query Parameter** When _impliedBy=stream:dev:*:project1_, this endpoint returns an empty list. When _impliedBy=stream:dev:write:project1_, this endpoint returns: stream:dev:read,write:project1 stream:dev:read,write,exec:project1 This request is authorized if the requestor is a service or a user that has access to the specified tenant.
262
277
  */
263
278
  UserApi.prototype.getUserPerms = function (requestParameters, initOverrides) {
264
279
  return __awaiter(this, void 0, void 0, function () {
@@ -275,43 +290,44 @@ var UserApi = /** @class */ (function (_super) {
275
290
  });
276
291
  };
277
292
  /**
278
- * Get the roles assigned to a user in the specified tenant, including those assigned transively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
293
+ * Get the roles assigned to a user in the specified tenant, including those assigned transively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
279
294
  */
280
295
  UserApi.prototype.getUserRolesRaw = function (requestParameters, initOverrides) {
281
296
  return __awaiter(this, void 0, void 0, function () {
282
- var queryParameters, headerParameters, response;
283
- return __generator(this, function (_a) {
284
- switch (_a.label) {
297
+ var queryParameters, headerParameters, _a, _b, response;
298
+ return __generator(this, function (_c) {
299
+ switch (_c.label) {
285
300
  case 0:
286
- if (requestParameters.user === null || requestParameters.user === undefined) {
287
- throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling getUserRoles.');
301
+ if (requestParameters['user'] == null) {
302
+ throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling getUserRoles().');
288
303
  }
289
304
  queryParameters = {};
290
- if (requestParameters.tenant !== undefined) {
291
- queryParameters['tenant'] = requestParameters.tenant;
292
- }
293
- if (requestParameters.pretty !== undefined) {
294
- queryParameters['pretty'] = requestParameters.pretty;
305
+ if (requestParameters['tenant'] != null) {
306
+ queryParameters['tenant'] = requestParameters['tenant'];
295
307
  }
296
308
  headerParameters = {};
297
- if (this.configuration && this.configuration.apiKey) {
298
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
299
- }
300
- return [4 /*yield*/, this.request({
301
- path: "/security/user/roles/{user}".replace("{" + "user" + "}", encodeURIComponent(String(requestParameters.user))),
302
- method: 'GET',
303
- headers: headerParameters,
304
- query: queryParameters,
305
- }, initOverrides)];
309
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
310
+ _a = headerParameters;
311
+ _b = "X-Tapis-Token";
312
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
306
313
  case 1:
307
- response = _a.sent();
308
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
314
+ _a[_b] = _c.sent(); // TapisJWT authentication
315
+ _c.label = 2;
316
+ case 2: return [4 /*yield*/, this.request({
317
+ path: "/security/user/roles/{user}".replace("{".concat("user", "}"), encodeURIComponent(String(requestParameters['user']))),
318
+ method: 'GET',
319
+ headers: headerParameters,
320
+ query: queryParameters,
321
+ }, initOverrides)];
322
+ case 3:
323
+ response = _c.sent();
324
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
309
325
  }
310
326
  });
311
327
  });
312
328
  };
313
329
  /**
314
- * Get the roles assigned to a user in the specified tenant, including those assigned transively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
330
+ * Get the roles assigned to a user in the specified tenant, including those assigned transively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
315
331
  */
316
332
  UserApi.prototype.getUserRoles = function (requestParameters, initOverrides) {
317
333
  return __awaiter(this, void 0, void 0, function () {
@@ -328,43 +344,44 @@ var UserApi = /** @class */ (function (_super) {
328
344
  });
329
345
  };
330
346
  /**
331
- * Get all users in a tenant assigned a permission. The permSpec parameter is a permission specification that uses colons as separators, the asterisk as a wildcard character and commas to define lists. Here are examples of permission specifications: system:mytenant:read:mysystem system:mytenant:*:mysystem system:mytenant files:mytenant:read,write:mysystems This method recognizes the percent sign (%) as a string wildcard only in the context of database searching. If a percent sign (%) appears in the permSpec it is interpreted as a zero or more character wildcard. For example, the following specification would match the first three of the above example specifications but not the fourth: system:mytenant:% The wildcard character cannot appear as the first character in the permSpec. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
347
+ * Get all users in a tenant assigned a permission. The permSpec parameter is a permission specification that uses colons as separators, the asterisk as a wildcard character and commas to define lists. Here are examples of permission specifications: system:mytenant:read:mysystem system:mytenant:*:mysystem system:mytenant files:mytenant:read,write:mysystems This method recognizes the percent sign (%) as a string wildcard only in the context of database searching. If a percent sign (%) appears in the permSpec it is interpreted as a zero or more character wildcard. For example, the following specification would match the first three of the above example specifications but not the fourth: system:mytenant:% The wildcard character cannot appear as the first character in the permSpec. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
332
348
  */
333
349
  UserApi.prototype.getUsersWithPermissionRaw = function (requestParameters, initOverrides) {
334
350
  return __awaiter(this, void 0, void 0, function () {
335
- var queryParameters, headerParameters, response;
336
- return __generator(this, function (_a) {
337
- switch (_a.label) {
351
+ var queryParameters, headerParameters, _a, _b, response;
352
+ return __generator(this, function (_c) {
353
+ switch (_c.label) {
338
354
  case 0:
339
- if (requestParameters.permSpec === null || requestParameters.permSpec === undefined) {
340
- throw new runtime.RequiredError('permSpec', 'Required parameter requestParameters.permSpec was null or undefined when calling getUsersWithPermission.');
355
+ if (requestParameters['permSpec'] == null) {
356
+ throw new runtime.RequiredError('permSpec', 'Required parameter "permSpec" was null or undefined when calling getUsersWithPermission().');
341
357
  }
342
358
  queryParameters = {};
343
- if (requestParameters.tenant !== undefined) {
344
- queryParameters['tenant'] = requestParameters.tenant;
345
- }
346
- if (requestParameters.pretty !== undefined) {
347
- queryParameters['pretty'] = requestParameters.pretty;
359
+ if (requestParameters['tenant'] != null) {
360
+ queryParameters['tenant'] = requestParameters['tenant'];
348
361
  }
349
362
  headerParameters = {};
350
- if (this.configuration && this.configuration.apiKey) {
351
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
352
- }
353
- return [4 /*yield*/, this.request({
354
- path: "/security/user/withPermission/{permSpec}".replace("{" + "permSpec" + "}", encodeURIComponent(String(requestParameters.permSpec))),
355
- method: 'GET',
356
- headers: headerParameters,
357
- query: queryParameters,
358
- }, initOverrides)];
363
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
364
+ _a = headerParameters;
365
+ _b = "X-Tapis-Token";
366
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
359
367
  case 1:
360
- response = _a.sent();
361
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
368
+ _a[_b] = _c.sent(); // TapisJWT authentication
369
+ _c.label = 2;
370
+ case 2: return [4 /*yield*/, this.request({
371
+ path: "/security/user/withPermission/{permSpec}".replace("{".concat("permSpec", "}"), encodeURIComponent(String(requestParameters['permSpec']))),
372
+ method: 'GET',
373
+ headers: headerParameters,
374
+ query: queryParameters,
375
+ }, initOverrides)];
376
+ case 3:
377
+ response = _c.sent();
378
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
362
379
  }
363
380
  });
364
381
  });
365
382
  };
366
383
  /**
367
- * Get all users in a tenant assigned a permission. The permSpec parameter is a permission specification that uses colons as separators, the asterisk as a wildcard character and commas to define lists. Here are examples of permission specifications: system:mytenant:read:mysystem system:mytenant:*:mysystem system:mytenant files:mytenant:read,write:mysystems This method recognizes the percent sign (%) as a string wildcard only in the context of database searching. If a percent sign (%) appears in the permSpec it is interpreted as a zero or more character wildcard. For example, the following specification would match the first three of the above example specifications but not the fourth: system:mytenant:% The wildcard character cannot appear as the first character in the permSpec. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
384
+ * Get all users in a tenant assigned a permission. The permSpec parameter is a permission specification that uses colons as separators, the asterisk as a wildcard character and commas to define lists. Here are examples of permission specifications: system:mytenant:read:mysystem system:mytenant:*:mysystem system:mytenant files:mytenant:read,write:mysystems This method recognizes the percent sign (%) as a string wildcard only in the context of database searching. If a percent sign (%) appears in the permSpec it is interpreted as a zero or more character wildcard. For example, the following specification would match the first three of the above example specifications but not the fourth: system:mytenant:% The wildcard character cannot appear as the first character in the permSpec. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
368
385
  */
369
386
  UserApi.prototype.getUsersWithPermission = function (requestParameters, initOverrides) {
370
387
  return __awaiter(this, void 0, void 0, function () {
@@ -381,43 +398,47 @@ var UserApi = /** @class */ (function (_super) {
381
398
  });
382
399
  };
383
400
  /**
384
- * Get all users assigned a role. The role must exist in the tenant. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
401
+ * Get all users assigned a role. The role must exist in the tenant. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
385
402
  */
386
403
  UserApi.prototype.getUsersWithRoleRaw = function (requestParameters, initOverrides) {
387
404
  return __awaiter(this, void 0, void 0, function () {
388
- var queryParameters, headerParameters, response;
389
- return __generator(this, function (_a) {
390
- switch (_a.label) {
405
+ var queryParameters, headerParameters, _a, _b, response;
406
+ return __generator(this, function (_c) {
407
+ switch (_c.label) {
391
408
  case 0:
392
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
393
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling getUsersWithRole.');
409
+ if (requestParameters['roleName'] == null) {
410
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling getUsersWithRole().');
394
411
  }
395
412
  queryParameters = {};
396
- if (requestParameters.tenant !== undefined) {
397
- queryParameters['tenant'] = requestParameters.tenant;
413
+ if (requestParameters['tenant'] != null) {
414
+ queryParameters['tenant'] = requestParameters['tenant'];
398
415
  }
399
- if (requestParameters.pretty !== undefined) {
400
- queryParameters['pretty'] = requestParameters.pretty;
416
+ if (requestParameters['roleType'] != null) {
417
+ queryParameters['roleType'] = requestParameters['roleType'];
401
418
  }
402
419
  headerParameters = {};
403
- if (this.configuration && this.configuration.apiKey) {
404
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
405
- }
406
- return [4 /*yield*/, this.request({
407
- path: "/security/user/withRole/{roleName}".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
408
- method: 'GET',
409
- headers: headerParameters,
410
- query: queryParameters,
411
- }, initOverrides)];
420
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
421
+ _a = headerParameters;
422
+ _b = "X-Tapis-Token";
423
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
412
424
  case 1:
413
- response = _a.sent();
414
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
425
+ _a[_b] = _c.sent(); // TapisJWT authentication
426
+ _c.label = 2;
427
+ case 2: return [4 /*yield*/, this.request({
428
+ path: "/security/user/withRole/{roleName}".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
429
+ method: 'GET',
430
+ headers: headerParameters,
431
+ query: queryParameters,
432
+ }, initOverrides)];
433
+ case 3:
434
+ response = _c.sent();
435
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
415
436
  }
416
437
  });
417
438
  });
418
439
  };
419
440
  /**
420
- * Get all users assigned a role. The role must exist in the tenant. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
441
+ * Get all users assigned a role. The role must exist in the tenant. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
421
442
  */
422
443
  UserApi.prototype.getUsersWithRole = function (requestParameters, initOverrides) {
423
444
  return __awaiter(this, void 0, void 0, function () {
@@ -434,94 +455,43 @@ var UserApi = /** @class */ (function (_super) {
434
455
  });
435
456
  };
436
457
  /**
437
- * Grant a user the tenant administrator role. A valid tenant and user must be specified in the request body. The user specified in the JWT must be an administrator in the tenant specified in the request body.
438
- */
439
- UserApi.prototype.grantAdminRoleRaw = function (requestParameters, initOverrides) {
440
- return __awaiter(this, void 0, void 0, function () {
441
- var queryParameters, headerParameters, response;
442
- return __generator(this, function (_a) {
443
- switch (_a.label) {
444
- case 0:
445
- if (requestParameters.reqGrantAdminRole === null || requestParameters.reqGrantAdminRole === undefined) {
446
- throw new runtime.RequiredError('reqGrantAdminRole', 'Required parameter requestParameters.reqGrantAdminRole was null or undefined when calling grantAdminRole.');
447
- }
448
- queryParameters = {};
449
- if (requestParameters.pretty !== undefined) {
450
- queryParameters['pretty'] = requestParameters.pretty;
451
- }
452
- headerParameters = {};
453
- headerParameters['Content-Type'] = 'application/json';
454
- if (this.configuration && this.configuration.apiKey) {
455
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
456
- }
457
- return [4 /*yield*/, this.request({
458
- path: "/security/user/grantAdminRole",
459
- method: 'POST',
460
- headers: headerParameters,
461
- query: queryParameters,
462
- body: models_1.ReqGrantAdminRoleToJSON(requestParameters.reqGrantAdminRole),
463
- }, initOverrides)];
464
- case 1:
465
- response = _a.sent();
466
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
467
- }
468
- });
469
- });
470
- };
471
- /**
472
- * Grant a user the tenant administrator role. A valid tenant and user must be specified in the request body. The user specified in the JWT must be an administrator in the tenant specified in the request body.
473
- */
474
- UserApi.prototype.grantAdminRole = function (requestParameters, initOverrides) {
475
- return __awaiter(this, void 0, void 0, function () {
476
- var response;
477
- return __generator(this, function (_a) {
478
- switch (_a.label) {
479
- case 0: return [4 /*yield*/, this.grantAdminRoleRaw(requestParameters, initOverrides)];
480
- case 1:
481
- response = _a.sent();
482
- return [4 /*yield*/, response.value()];
483
- case 2: return [2 /*return*/, _a.sent()];
484
- }
485
- });
486
- });
487
- };
488
- /**
489
- * Grant a user the specified role. A valid tenant and user must be specified in the request body. This request is authorized only if the requestor is the role owner or an administrator. The user and the role must be in the same tenant.
458
+ * Grant a user the specified role. A valid tenant and user must be specified in the request body. The type of role to grant may be specified in the request body. Allowed types are USER, TENANT_ADMIN and RESTRICTED_SVC. Default type is USER. The user and the role must be in the same tenant. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
490
459
  */
491
460
  UserApi.prototype.grantRoleRaw = function (requestParameters, initOverrides) {
492
461
  return __awaiter(this, void 0, void 0, function () {
493
- var queryParameters, headerParameters, response;
494
- return __generator(this, function (_a) {
495
- switch (_a.label) {
462
+ var queryParameters, headerParameters, _a, _b, response;
463
+ return __generator(this, function (_c) {
464
+ switch (_c.label) {
496
465
  case 0:
497
- if (requestParameters.reqGrantUserRole === null || requestParameters.reqGrantUserRole === undefined) {
498
- throw new runtime.RequiredError('reqGrantUserRole', 'Required parameter requestParameters.reqGrantUserRole was null or undefined when calling grantRole.');
466
+ if (requestParameters['reqGrantRole'] == null) {
467
+ throw new runtime.RequiredError('reqGrantRole', 'Required parameter "reqGrantRole" was null or undefined when calling grantRole().');
499
468
  }
500
469
  queryParameters = {};
501
- if (requestParameters.pretty !== undefined) {
502
- queryParameters['pretty'] = requestParameters.pretty;
503
- }
504
470
  headerParameters = {};
505
471
  headerParameters['Content-Type'] = 'application/json';
506
- if (this.configuration && this.configuration.apiKey) {
507
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
508
- }
509
- return [4 /*yield*/, this.request({
510
- path: "/security/user/grantRole",
511
- method: 'POST',
512
- headers: headerParameters,
513
- query: queryParameters,
514
- body: models_1.ReqGrantUserRoleToJSON(requestParameters.reqGrantUserRole),
515
- }, initOverrides)];
472
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
473
+ _a = headerParameters;
474
+ _b = "X-Tapis-Token";
475
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
516
476
  case 1:
517
- response = _a.sent();
518
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
477
+ _a[_b] = _c.sent(); // TapisJWT authentication
478
+ _c.label = 2;
479
+ case 2: return [4 /*yield*/, this.request({
480
+ path: "/security/user/grantRole",
481
+ method: 'POST',
482
+ headers: headerParameters,
483
+ query: queryParameters,
484
+ body: (0, index_1.ReqGrantRoleToJSON)(requestParameters['reqGrantRole']),
485
+ }, initOverrides)];
486
+ case 3:
487
+ response = _c.sent();
488
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
519
489
  }
520
490
  });
521
491
  });
522
492
  };
523
493
  /**
524
- * Grant a user the specified role. A valid tenant and user must be specified in the request body. This request is authorized only if the requestor is the role owner or an administrator. The user and the role must be in the same tenant.
494
+ * Grant a user the specified role. A valid tenant and user must be specified in the request body. The type of role to grant may be specified in the request body. Allowed types are USER, TENANT_ADMIN and RESTRICTED_SVC. Default type is USER. The user and the role must be in the same tenant. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
525
495
  */
526
496
  UserApi.prototype.grantRole = function (requestParameters, initOverrides) {
527
497
  return __awaiter(this, void 0, void 0, function () {
@@ -538,42 +508,43 @@ var UserApi = /** @class */ (function (_super) {
538
508
  });
539
509
  };
540
510
  /**
541
- * Grant a user the specified role containing the specified permission. This compound request first adds the permission to the role if it is not already a member of the role and then assigns the role to the user. The change count returned can range from zero to two depending on how many insertions were actually required. Only the role owner or an administrator is authorized to make this request. The user and the role must be in the same tenant.
511
+ * Grant a user the specified role containing the specified permission. This compound request first adds the permission to the role if it is not already a member of the role and then assigns the role to the user. The change count returned can range from zero to two depending on how many insertions were actually required. The user and the role must be in the same tenant. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
542
512
  */
543
513
  UserApi.prototype.grantRoleWithPermissionRaw = function (requestParameters, initOverrides) {
544
514
  return __awaiter(this, void 0, void 0, function () {
545
- var queryParameters, headerParameters, response;
546
- return __generator(this, function (_a) {
547
- switch (_a.label) {
515
+ var queryParameters, headerParameters, _a, _b, response;
516
+ return __generator(this, function (_c) {
517
+ switch (_c.label) {
548
518
  case 0:
549
- if (requestParameters.reqGrantUserRoleWithPermission === null || requestParameters.reqGrantUserRoleWithPermission === undefined) {
550
- throw new runtime.RequiredError('reqGrantUserRoleWithPermission', 'Required parameter requestParameters.reqGrantUserRoleWithPermission was null or undefined when calling grantRoleWithPermission.');
519
+ if (requestParameters['reqGrantRoleWithPermission'] == null) {
520
+ throw new runtime.RequiredError('reqGrantRoleWithPermission', 'Required parameter "reqGrantRoleWithPermission" was null or undefined when calling grantRoleWithPermission().');
551
521
  }
552
522
  queryParameters = {};
553
- if (requestParameters.pretty !== undefined) {
554
- queryParameters['pretty'] = requestParameters.pretty;
555
- }
556
523
  headerParameters = {};
557
524
  headerParameters['Content-Type'] = 'application/json';
558
- if (this.configuration && this.configuration.apiKey) {
559
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
560
- }
561
- return [4 /*yield*/, this.request({
562
- path: "/security/user/grantRoleWithPerm",
563
- method: 'POST',
564
- headers: headerParameters,
565
- query: queryParameters,
566
- body: models_1.ReqGrantUserRoleWithPermissionToJSON(requestParameters.reqGrantUserRoleWithPermission),
567
- }, initOverrides)];
525
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
526
+ _a = headerParameters;
527
+ _b = "X-Tapis-Token";
528
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
568
529
  case 1:
569
- response = _a.sent();
570
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
530
+ _a[_b] = _c.sent(); // TapisJWT authentication
531
+ _c.label = 2;
532
+ case 2: return [4 /*yield*/, this.request({
533
+ path: "/security/user/grantRoleWithPerm",
534
+ method: 'POST',
535
+ headers: headerParameters,
536
+ query: queryParameters,
537
+ body: (0, index_1.ReqGrantRoleWithPermissionToJSON)(requestParameters['reqGrantRoleWithPermission']),
538
+ }, initOverrides)];
539
+ case 3:
540
+ response = _c.sent();
541
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
571
542
  }
572
543
  });
573
544
  });
574
545
  };
575
546
  /**
576
- * Grant a user the specified role containing the specified permission. This compound request first adds the permission to the role if it is not already a member of the role and then assigns the role to the user. The change count returned can range from zero to two depending on how many insertions were actually required. Only the role owner or an administrator is authorized to make this request. The user and the role must be in the same tenant.
547
+ * Grant a user the specified role containing the specified permission. This compound request first adds the permission to the role if it is not already a member of the role and then assigns the role to the user. The change count returned can range from zero to two depending on how many insertions were actually required. The user and the role must be in the same tenant. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
577
548
  */
578
549
  UserApi.prototype.grantRoleWithPermission = function (requestParameters, initOverrides) {
579
550
  return __awaiter(this, void 0, void 0, function () {
@@ -590,42 +561,43 @@ var UserApi = /** @class */ (function (_super) {
590
561
  });
591
562
  };
592
563
  /**
593
- * Grant a user the specified permission by assigning that permission to to the user\'s default role. If the user\'s default role does not exist,this request will create that role and grant it to the user before assigning the permission to the role. A user\'s default role name is discoverable by calling either of the user/defaultRole or role/defaultRole endpoints. The change count returned can range from zero to three depending on how many insertions and updates were actually required The caller must be an administrator or service allowed to perform updates in the user\'s tenant.
564
+ * Grant a user the specified permission by assigning that permission to to the user\'s default role. If the user\'s default role does not exist it will be created. A user\'s default role name is discoverable by calling either of the user/defaultRole or role/defaultRole endpoints. The change count returned can range from zero to three depending on how many insertions and updates were actually required. The caller must be an administrator or service allowed to perform updates in the user\'s tenant.
594
565
  */
595
566
  UserApi.prototype.grantUserPermissionRaw = function (requestParameters, initOverrides) {
596
567
  return __awaiter(this, void 0, void 0, function () {
597
- var queryParameters, headerParameters, response;
598
- return __generator(this, function (_a) {
599
- switch (_a.label) {
568
+ var queryParameters, headerParameters, _a, _b, response;
569
+ return __generator(this, function (_c) {
570
+ switch (_c.label) {
600
571
  case 0:
601
- if (requestParameters.reqGrantUserPermission === null || requestParameters.reqGrantUserPermission === undefined) {
602
- throw new runtime.RequiredError('reqGrantUserPermission', 'Required parameter requestParameters.reqGrantUserPermission was null or undefined when calling grantUserPermission.');
572
+ if (requestParameters['reqGrantUserPermission'] == null) {
573
+ throw new runtime.RequiredError('reqGrantUserPermission', 'Required parameter "reqGrantUserPermission" was null or undefined when calling grantUserPermission().');
603
574
  }
604
575
  queryParameters = {};
605
- if (requestParameters.pretty !== undefined) {
606
- queryParameters['pretty'] = requestParameters.pretty;
607
- }
608
576
  headerParameters = {};
609
577
  headerParameters['Content-Type'] = 'application/json';
610
- if (this.configuration && this.configuration.apiKey) {
611
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
612
- }
613
- return [4 /*yield*/, this.request({
614
- path: "/security/user/grantUserPermission",
615
- method: 'POST',
616
- headers: headerParameters,
617
- query: queryParameters,
618
- body: models_1.ReqGrantUserPermissionToJSON(requestParameters.reqGrantUserPermission),
619
- }, initOverrides)];
578
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
579
+ _a = headerParameters;
580
+ _b = "X-Tapis-Token";
581
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
620
582
  case 1:
621
- response = _a.sent();
622
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
583
+ _a[_b] = _c.sent(); // TapisJWT authentication
584
+ _c.label = 2;
585
+ case 2: return [4 /*yield*/, this.request({
586
+ path: "/security/user/grantUserPermission",
587
+ method: 'POST',
588
+ headers: headerParameters,
589
+ query: queryParameters,
590
+ body: (0, index_1.ReqGrantUserPermissionToJSON)(requestParameters['reqGrantUserPermission']),
591
+ }, initOverrides)];
592
+ case 3:
593
+ response = _c.sent();
594
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
623
595
  }
624
596
  });
625
597
  });
626
598
  };
627
599
  /**
628
- * Grant a user the specified permission by assigning that permission to to the user\'s default role. If the user\'s default role does not exist,this request will create that role and grant it to the user before assigning the permission to the role. A user\'s default role name is discoverable by calling either of the user/defaultRole or role/defaultRole endpoints. The change count returned can range from zero to three depending on how many insertions and updates were actually required The caller must be an administrator or service allowed to perform updates in the user\'s tenant.
600
+ * Grant a user the specified permission by assigning that permission to to the user\'s default role. If the user\'s default role does not exist it will be created. A user\'s default role name is discoverable by calling either of the user/defaultRole or role/defaultRole endpoints. The change count returned can range from zero to three depending on how many insertions and updates were actually required. The caller must be an administrator or service allowed to perform updates in the user\'s tenant.
629
601
  */
630
602
  UserApi.prototype.grantUserPermission = function (requestParameters, initOverrides) {
631
603
  return __awaiter(this, void 0, void 0, function () {
@@ -642,42 +614,43 @@ var UserApi = /** @class */ (function (_super) {
642
614
  });
643
615
  };
644
616
  /**
645
- * Check whether a user in a tenant has been assigned the specified role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
617
+ * Check whether a user in a tenant has been assigned the specified role, either directly or transitively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
646
618
  */
647
619
  UserApi.prototype.hasRoleRaw = function (requestParameters, initOverrides) {
648
620
  return __awaiter(this, void 0, void 0, function () {
649
- var queryParameters, headerParameters, response;
650
- return __generator(this, function (_a) {
651
- switch (_a.label) {
621
+ var queryParameters, headerParameters, _a, _b, response;
622
+ return __generator(this, function (_c) {
623
+ switch (_c.label) {
652
624
  case 0:
653
- if (requestParameters.reqUserHasRole === null || requestParameters.reqUserHasRole === undefined) {
654
- throw new runtime.RequiredError('reqUserHasRole', 'Required parameter requestParameters.reqUserHasRole was null or undefined when calling hasRole.');
625
+ if (requestParameters['reqUserHasRole'] == null) {
626
+ throw new runtime.RequiredError('reqUserHasRole', 'Required parameter "reqUserHasRole" was null or undefined when calling hasRole().');
655
627
  }
656
628
  queryParameters = {};
657
- if (requestParameters.pretty !== undefined) {
658
- queryParameters['pretty'] = requestParameters.pretty;
659
- }
660
629
  headerParameters = {};
661
630
  headerParameters['Content-Type'] = 'application/json';
662
- if (this.configuration && this.configuration.apiKey) {
663
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
664
- }
665
- return [4 /*yield*/, this.request({
666
- path: "/security/user/hasRole",
667
- method: 'POST',
668
- headers: headerParameters,
669
- query: queryParameters,
670
- body: models_1.ReqUserHasRoleToJSON(requestParameters.reqUserHasRole),
671
- }, initOverrides)];
631
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
632
+ _a = headerParameters;
633
+ _b = "X-Tapis-Token";
634
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
672
635
  case 1:
673
- response = _a.sent();
674
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
636
+ _a[_b] = _c.sent(); // TapisJWT authentication
637
+ _c.label = 2;
638
+ case 2: return [4 /*yield*/, this.request({
639
+ path: "/security/user/hasRole",
640
+ method: 'POST',
641
+ headers: headerParameters,
642
+ query: queryParameters,
643
+ body: (0, index_1.ReqUserHasRoleToJSON)(requestParameters['reqUserHasRole']),
644
+ }, initOverrides)];
645
+ case 3:
646
+ response = _c.sent();
647
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
675
648
  }
676
649
  });
677
650
  });
678
651
  };
679
652
  /**
680
- * Check whether a user in a tenant has been assigned the specified role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
653
+ * Check whether a user in a tenant has been assigned the specified role, either directly or transitively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
681
654
  */
682
655
  UserApi.prototype.hasRole = function (requestParameters, initOverrides) {
683
656
  return __awaiter(this, void 0, void 0, function () {
@@ -694,42 +667,43 @@ var UserApi = /** @class */ (function (_super) {
694
667
  });
695
668
  };
696
669
  /**
697
- * Check whether a user in a tenant has been assigned all of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
670
+ * Check whether a user in a tenant has been assigned all of the roles specified in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
698
671
  */
699
672
  UserApi.prototype.hasRoleAllRaw = function (requestParameters, initOverrides) {
700
673
  return __awaiter(this, void 0, void 0, function () {
701
- var queryParameters, headerParameters, response;
702
- return __generator(this, function (_a) {
703
- switch (_a.label) {
674
+ var queryParameters, headerParameters, _a, _b, response;
675
+ return __generator(this, function (_c) {
676
+ switch (_c.label) {
704
677
  case 0:
705
- if (requestParameters.reqUserHasRoleMulti === null || requestParameters.reqUserHasRoleMulti === undefined) {
706
- throw new runtime.RequiredError('reqUserHasRoleMulti', 'Required parameter requestParameters.reqUserHasRoleMulti was null or undefined when calling hasRoleAll.');
678
+ if (requestParameters['reqUserHasRoleMulti'] == null) {
679
+ throw new runtime.RequiredError('reqUserHasRoleMulti', 'Required parameter "reqUserHasRoleMulti" was null or undefined when calling hasRoleAll().');
707
680
  }
708
681
  queryParameters = {};
709
- if (requestParameters.pretty !== undefined) {
710
- queryParameters['pretty'] = requestParameters.pretty;
711
- }
712
682
  headerParameters = {};
713
683
  headerParameters['Content-Type'] = 'application/json';
714
- if (this.configuration && this.configuration.apiKey) {
715
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
716
- }
717
- return [4 /*yield*/, this.request({
718
- path: "/security/user/hasRoleAll",
719
- method: 'POST',
720
- headers: headerParameters,
721
- query: queryParameters,
722
- body: models_1.ReqUserHasRoleMultiToJSON(requestParameters.reqUserHasRoleMulti),
723
- }, initOverrides)];
684
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
685
+ _a = headerParameters;
686
+ _b = "X-Tapis-Token";
687
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
724
688
  case 1:
725
- response = _a.sent();
726
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
689
+ _a[_b] = _c.sent(); // TapisJWT authentication
690
+ _c.label = 2;
691
+ case 2: return [4 /*yield*/, this.request({
692
+ path: "/security/user/hasRoleAll",
693
+ method: 'POST',
694
+ headers: headerParameters,
695
+ query: queryParameters,
696
+ body: (0, index_1.ReqUserHasRoleMultiToJSON)(requestParameters['reqUserHasRoleMulti']),
697
+ }, initOverrides)];
698
+ case 3:
699
+ response = _c.sent();
700
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
727
701
  }
728
702
  });
729
703
  });
730
704
  };
731
705
  /**
732
- * Check whether a user in a tenant has been assigned all of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
706
+ * Check whether a user in a tenant has been assigned all of the roles specified in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
733
707
  */
734
708
  UserApi.prototype.hasRoleAll = function (requestParameters, initOverrides) {
735
709
  return __awaiter(this, void 0, void 0, function () {
@@ -746,42 +720,43 @@ var UserApi = /** @class */ (function (_super) {
746
720
  });
747
721
  };
748
722
  /**
749
- * Check whether a user in a tenant has been assigned any of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
723
+ * Check whether a user in a tenant has been assigned any of the roles specified in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
750
724
  */
751
725
  UserApi.prototype.hasRoleAnyRaw = function (requestParameters, initOverrides) {
752
726
  return __awaiter(this, void 0, void 0, function () {
753
- var queryParameters, headerParameters, response;
754
- return __generator(this, function (_a) {
755
- switch (_a.label) {
727
+ var queryParameters, headerParameters, _a, _b, response;
728
+ return __generator(this, function (_c) {
729
+ switch (_c.label) {
756
730
  case 0:
757
- if (requestParameters.reqUserHasRoleMulti === null || requestParameters.reqUserHasRoleMulti === undefined) {
758
- throw new runtime.RequiredError('reqUserHasRoleMulti', 'Required parameter requestParameters.reqUserHasRoleMulti was null or undefined when calling hasRoleAny.');
731
+ if (requestParameters['reqUserHasRoleMulti'] == null) {
732
+ throw new runtime.RequiredError('reqUserHasRoleMulti', 'Required parameter "reqUserHasRoleMulti" was null or undefined when calling hasRoleAny().');
759
733
  }
760
734
  queryParameters = {};
761
- if (requestParameters.pretty !== undefined) {
762
- queryParameters['pretty'] = requestParameters.pretty;
763
- }
764
735
  headerParameters = {};
765
736
  headerParameters['Content-Type'] = 'application/json';
766
- if (this.configuration && this.configuration.apiKey) {
767
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
768
- }
769
- return [4 /*yield*/, this.request({
770
- path: "/security/user/hasRoleAny",
771
- method: 'POST',
772
- headers: headerParameters,
773
- query: queryParameters,
774
- body: models_1.ReqUserHasRoleMultiToJSON(requestParameters.reqUserHasRoleMulti),
775
- }, initOverrides)];
737
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
738
+ _a = headerParameters;
739
+ _b = "X-Tapis-Token";
740
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
776
741
  case 1:
777
- response = _a.sent();
778
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
742
+ _a[_b] = _c.sent(); // TapisJWT authentication
743
+ _c.label = 2;
744
+ case 2: return [4 /*yield*/, this.request({
745
+ path: "/security/user/hasRoleAny",
746
+ method: 'POST',
747
+ headers: headerParameters,
748
+ query: queryParameters,
749
+ body: (0, index_1.ReqUserHasRoleMultiToJSON)(requestParameters['reqUserHasRoleMulti']),
750
+ }, initOverrides)];
751
+ case 3:
752
+ response = _c.sent();
753
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
779
754
  }
780
755
  });
781
756
  });
782
757
  };
783
758
  /**
784
- * Check whether a user in a tenant has been assigned any of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
759
+ * Check whether a user in a tenant has been assigned any of the roles specified in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
785
760
  */
786
761
  UserApi.prototype.hasRoleAny = function (requestParameters, initOverrides) {
787
762
  return __awaiter(this, void 0, void 0, function () {
@@ -798,42 +773,43 @@ var UserApi = /** @class */ (function (_super) {
798
773
  });
799
774
  };
800
775
  /**
801
- * Check whether a user in a tenant has been assigned the tenant administrator role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
776
+ * Check whether a user in a tenant has been assigned the tenant administrator role, either directly or transitively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
802
777
  */
803
778
  UserApi.prototype.isAdminRaw = function (requestParameters, initOverrides) {
804
779
  return __awaiter(this, void 0, void 0, function () {
805
- var queryParameters, headerParameters, response;
806
- return __generator(this, function (_a) {
807
- switch (_a.label) {
780
+ var queryParameters, headerParameters, _a, _b, response;
781
+ return __generator(this, function (_c) {
782
+ switch (_c.label) {
808
783
  case 0:
809
- if (requestParameters.reqUserIsAdmin === null || requestParameters.reqUserIsAdmin === undefined) {
810
- throw new runtime.RequiredError('reqUserIsAdmin', 'Required parameter requestParameters.reqUserIsAdmin was null or undefined when calling isAdmin.');
784
+ if (requestParameters['reqUserIsAdmin'] == null) {
785
+ throw new runtime.RequiredError('reqUserIsAdmin', 'Required parameter "reqUserIsAdmin" was null or undefined when calling isAdmin().');
811
786
  }
812
787
  queryParameters = {};
813
- if (requestParameters.pretty !== undefined) {
814
- queryParameters['pretty'] = requestParameters.pretty;
815
- }
816
788
  headerParameters = {};
817
789
  headerParameters['Content-Type'] = 'application/json';
818
- if (this.configuration && this.configuration.apiKey) {
819
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
820
- }
821
- return [4 /*yield*/, this.request({
822
- path: "/security/user/isAdmin",
823
- method: 'POST',
824
- headers: headerParameters,
825
- query: queryParameters,
826
- body: models_1.ReqUserIsAdminToJSON(requestParameters.reqUserIsAdmin),
827
- }, initOverrides)];
790
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
791
+ _a = headerParameters;
792
+ _b = "X-Tapis-Token";
793
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
828
794
  case 1:
829
- response = _a.sent();
830
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
795
+ _a[_b] = _c.sent(); // TapisJWT authentication
796
+ _c.label = 2;
797
+ case 2: return [4 /*yield*/, this.request({
798
+ path: "/security/user/isAdmin",
799
+ method: 'POST',
800
+ headers: headerParameters,
801
+ query: queryParameters,
802
+ body: (0, index_1.ReqUserIsAdminToJSON)(requestParameters['reqUserIsAdmin']),
803
+ }, initOverrides)];
804
+ case 3:
805
+ response = _c.sent();
806
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
831
807
  }
832
808
  });
833
809
  });
834
810
  };
835
811
  /**
836
- * Check whether a user in a tenant has been assigned the tenant administrator role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
812
+ * Check whether a user in a tenant has been assigned the tenant administrator role, either directly or transitively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
837
813
  */
838
814
  UserApi.prototype.isAdmin = function (requestParameters, initOverrides) {
839
815
  return __awaiter(this, void 0, void 0, function () {
@@ -850,42 +826,43 @@ var UserApi = /** @class */ (function (_super) {
850
826
  });
851
827
  };
852
828
  /**
853
- * Check whether specified permission matches a permission assigned to the user, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
829
+ * Check whether specified permission matches a permission assigned to the user, either directly or transitively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
854
830
  */
855
831
  UserApi.prototype.isPermittedRaw = function (requestParameters, initOverrides) {
856
832
  return __awaiter(this, void 0, void 0, function () {
857
- var queryParameters, headerParameters, response;
858
- return __generator(this, function (_a) {
859
- switch (_a.label) {
833
+ var queryParameters, headerParameters, _a, _b, response;
834
+ return __generator(this, function (_c) {
835
+ switch (_c.label) {
860
836
  case 0:
861
- if (requestParameters.reqUserIsPermitted === null || requestParameters.reqUserIsPermitted === undefined) {
862
- throw new runtime.RequiredError('reqUserIsPermitted', 'Required parameter requestParameters.reqUserIsPermitted was null or undefined when calling isPermitted.');
837
+ if (requestParameters['reqUserIsPermitted'] == null) {
838
+ throw new runtime.RequiredError('reqUserIsPermitted', 'Required parameter "reqUserIsPermitted" was null or undefined when calling isPermitted().');
863
839
  }
864
840
  queryParameters = {};
865
- if (requestParameters.pretty !== undefined) {
866
- queryParameters['pretty'] = requestParameters.pretty;
867
- }
868
841
  headerParameters = {};
869
842
  headerParameters['Content-Type'] = 'application/json';
870
- if (this.configuration && this.configuration.apiKey) {
871
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
872
- }
873
- return [4 /*yield*/, this.request({
874
- path: "/security/user/isPermitted",
875
- method: 'POST',
876
- headers: headerParameters,
877
- query: queryParameters,
878
- body: models_1.ReqUserIsPermittedToJSON(requestParameters.reqUserIsPermitted),
879
- }, initOverrides)];
843
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
844
+ _a = headerParameters;
845
+ _b = "X-Tapis-Token";
846
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
880
847
  case 1:
881
- response = _a.sent();
882
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
848
+ _a[_b] = _c.sent(); // TapisJWT authentication
849
+ _c.label = 2;
850
+ case 2: return [4 /*yield*/, this.request({
851
+ path: "/security/user/isPermitted",
852
+ method: 'POST',
853
+ headers: headerParameters,
854
+ query: queryParameters,
855
+ body: (0, index_1.ReqUserIsPermittedToJSON)(requestParameters['reqUserIsPermitted']),
856
+ }, initOverrides)];
857
+ case 3:
858
+ response = _c.sent();
859
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
883
860
  }
884
861
  });
885
862
  });
886
863
  };
887
864
  /**
888
- * Check whether specified permission matches a permission assigned to the user, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
865
+ * Check whether specified permission matches a permission assigned to the user, either directly or transitively. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
889
866
  */
890
867
  UserApi.prototype.isPermitted = function (requestParameters, initOverrides) {
891
868
  return __awaiter(this, void 0, void 0, function () {
@@ -902,42 +879,43 @@ var UserApi = /** @class */ (function (_super) {
902
879
  });
903
880
  };
904
881
  /**
905
- * Check whether a user\'s permissions satisfy all of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
882
+ * Check whether a user\'s permissions satisfy all of the permission specifications contained in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
906
883
  */
907
884
  UserApi.prototype.isPermittedAllRaw = function (requestParameters, initOverrides) {
908
885
  return __awaiter(this, void 0, void 0, function () {
909
- var queryParameters, headerParameters, response;
910
- return __generator(this, function (_a) {
911
- switch (_a.label) {
886
+ var queryParameters, headerParameters, _a, _b, response;
887
+ return __generator(this, function (_c) {
888
+ switch (_c.label) {
912
889
  case 0:
913
- if (requestParameters.reqUserIsPermittedMulti === null || requestParameters.reqUserIsPermittedMulti === undefined) {
914
- throw new runtime.RequiredError('reqUserIsPermittedMulti', 'Required parameter requestParameters.reqUserIsPermittedMulti was null or undefined when calling isPermittedAll.');
890
+ if (requestParameters['reqUserIsPermittedMulti'] == null) {
891
+ throw new runtime.RequiredError('reqUserIsPermittedMulti', 'Required parameter "reqUserIsPermittedMulti" was null or undefined when calling isPermittedAll().');
915
892
  }
916
893
  queryParameters = {};
917
- if (requestParameters.pretty !== undefined) {
918
- queryParameters['pretty'] = requestParameters.pretty;
919
- }
920
894
  headerParameters = {};
921
895
  headerParameters['Content-Type'] = 'application/json';
922
- if (this.configuration && this.configuration.apiKey) {
923
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
924
- }
925
- return [4 /*yield*/, this.request({
926
- path: "/security/user/isPermittedAll",
927
- method: 'POST',
928
- headers: headerParameters,
929
- query: queryParameters,
930
- body: models_1.ReqUserIsPermittedMultiToJSON(requestParameters.reqUserIsPermittedMulti),
931
- }, initOverrides)];
896
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
897
+ _a = headerParameters;
898
+ _b = "X-Tapis-Token";
899
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
932
900
  case 1:
933
- response = _a.sent();
934
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
901
+ _a[_b] = _c.sent(); // TapisJWT authentication
902
+ _c.label = 2;
903
+ case 2: return [4 /*yield*/, this.request({
904
+ path: "/security/user/isPermittedAll",
905
+ method: 'POST',
906
+ headers: headerParameters,
907
+ query: queryParameters,
908
+ body: (0, index_1.ReqUserIsPermittedMultiToJSON)(requestParameters['reqUserIsPermittedMulti']),
909
+ }, initOverrides)];
910
+ case 3:
911
+ response = _c.sent();
912
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
935
913
  }
936
914
  });
937
915
  });
938
916
  };
939
917
  /**
940
- * Check whether a user\'s permissions satisfy all of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
918
+ * Check whether a user\'s permissions satisfy all of the permission specifications contained in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
941
919
  */
942
920
  UserApi.prototype.isPermittedAll = function (requestParameters, initOverrides) {
943
921
  return __awaiter(this, void 0, void 0, function () {
@@ -954,42 +932,43 @@ var UserApi = /** @class */ (function (_super) {
954
932
  });
955
933
  };
956
934
  /**
957
- * Check whether a user\'s permissions satisfy any of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
935
+ * Check whether a user\'s permissions satisfy any of the permission specifications contained in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
958
936
  */
959
937
  UserApi.prototype.isPermittedAnyRaw = function (requestParameters, initOverrides) {
960
938
  return __awaiter(this, void 0, void 0, function () {
961
- var queryParameters, headerParameters, response;
962
- return __generator(this, function (_a) {
963
- switch (_a.label) {
939
+ var queryParameters, headerParameters, _a, _b, response;
940
+ return __generator(this, function (_c) {
941
+ switch (_c.label) {
964
942
  case 0:
965
- if (requestParameters.reqUserIsPermittedMulti === null || requestParameters.reqUserIsPermittedMulti === undefined) {
966
- throw new runtime.RequiredError('reqUserIsPermittedMulti', 'Required parameter requestParameters.reqUserIsPermittedMulti was null or undefined when calling isPermittedAny.');
943
+ if (requestParameters['reqUserIsPermittedMulti'] == null) {
944
+ throw new runtime.RequiredError('reqUserIsPermittedMulti', 'Required parameter "reqUserIsPermittedMulti" was null or undefined when calling isPermittedAny().');
967
945
  }
968
946
  queryParameters = {};
969
- if (requestParameters.pretty !== undefined) {
970
- queryParameters['pretty'] = requestParameters.pretty;
971
- }
972
947
  headerParameters = {};
973
948
  headerParameters['Content-Type'] = 'application/json';
974
- if (this.configuration && this.configuration.apiKey) {
975
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
976
- }
977
- return [4 /*yield*/, this.request({
978
- path: "/security/user/isPermittedAny",
979
- method: 'POST',
980
- headers: headerParameters,
981
- query: queryParameters,
982
- body: models_1.ReqUserIsPermittedMultiToJSON(requestParameters.reqUserIsPermittedMulti),
983
- }, initOverrides)];
949
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
950
+ _a = headerParameters;
951
+ _b = "X-Tapis-Token";
952
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
984
953
  case 1:
985
- response = _a.sent();
986
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
954
+ _a[_b] = _c.sent(); // TapisJWT authentication
955
+ _c.label = 2;
956
+ case 2: return [4 /*yield*/, this.request({
957
+ path: "/security/user/isPermittedAny",
958
+ method: 'POST',
959
+ headers: headerParameters,
960
+ query: queryParameters,
961
+ body: (0, index_1.ReqUserIsPermittedMultiToJSON)(requestParameters['reqUserIsPermittedMulti']),
962
+ }, initOverrides)];
963
+ case 3:
964
+ response = _c.sent();
965
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
987
966
  }
988
967
  });
989
968
  });
990
969
  };
991
970
  /**
992
- * Check whether a user\'s permissions satisfy any of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
971
+ * Check whether a user\'s permissions satisfy any of the permission specifications contained in the request body. This request is authorized if the requestor is a service or a user that has access to the specified tenant.
993
972
  */
994
973
  UserApi.prototype.isPermittedAny = function (requestParameters, initOverrides) {
995
974
  return __awaiter(this, void 0, void 0, function () {
@@ -1006,49 +985,50 @@ var UserApi = /** @class */ (function (_super) {
1006
985
  });
1007
986
  };
1008
987
  /**
1009
- * Revoke the previously granted tenant administrator role from a user. No action is taken if the user is not currently assigned the role (the request is idempotent). The request will not be honored if revoking the role would leave the tenant with no administrator. The user specified in the JWT must themselves be an administrator and a valid tenant and user must be specified in the request body.
988
+ * Revoke a previously granted role from a user. No action is taken if the user is not currently assigned the role. This request is idempotent. The type of role to grant may be specified in the request body. Allowed types are USER, TENANT_ADMIN and RESTRICTED_SVC. Default type is USER. The user and the role must be in the same tenant. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
1010
989
  */
1011
- UserApi.prototype.revokeAdminRoleRaw = function (requestParameters, initOverrides) {
990
+ UserApi.prototype.revokeRoleRaw = function (requestParameters, initOverrides) {
1012
991
  return __awaiter(this, void 0, void 0, function () {
1013
- var queryParameters, headerParameters, response;
1014
- return __generator(this, function (_a) {
1015
- switch (_a.label) {
992
+ var queryParameters, headerParameters, _a, _b, response;
993
+ return __generator(this, function (_c) {
994
+ switch (_c.label) {
1016
995
  case 0:
1017
- if (requestParameters.reqRevokeAdminRole === null || requestParameters.reqRevokeAdminRole === undefined) {
1018
- throw new runtime.RequiredError('reqRevokeAdminRole', 'Required parameter requestParameters.reqRevokeAdminRole was null or undefined when calling revokeAdminRole.');
996
+ if (requestParameters['reqRevokeRole'] == null) {
997
+ throw new runtime.RequiredError('reqRevokeRole', 'Required parameter "reqRevokeRole" was null or undefined when calling revokeRole().');
1019
998
  }
1020
999
  queryParameters = {};
1021
- if (requestParameters.pretty !== undefined) {
1022
- queryParameters['pretty'] = requestParameters.pretty;
1023
- }
1024
1000
  headerParameters = {};
1025
1001
  headerParameters['Content-Type'] = 'application/json';
1026
- if (this.configuration && this.configuration.apiKey) {
1027
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
1028
- }
1029
- return [4 /*yield*/, this.request({
1030
- path: "/security/user/revokeAdminRole",
1031
- method: 'POST',
1032
- headers: headerParameters,
1033
- query: queryParameters,
1034
- body: models_1.ReqRevokeAdminRoleToJSON(requestParameters.reqRevokeAdminRole),
1035
- }, initOverrides)];
1002
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
1003
+ _a = headerParameters;
1004
+ _b = "X-Tapis-Token";
1005
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
1036
1006
  case 1:
1037
- response = _a.sent();
1038
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
1007
+ _a[_b] = _c.sent(); // TapisJWT authentication
1008
+ _c.label = 2;
1009
+ case 2: return [4 /*yield*/, this.request({
1010
+ path: "/security/user/revokeRole",
1011
+ method: 'POST',
1012
+ headers: headerParameters,
1013
+ query: queryParameters,
1014
+ body: (0, index_1.ReqRevokeRoleToJSON)(requestParameters['reqRevokeRole']),
1015
+ }, initOverrides)];
1016
+ case 3:
1017
+ response = _c.sent();
1018
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
1039
1019
  }
1040
1020
  });
1041
1021
  });
1042
1022
  };
1043
1023
  /**
1044
- * Revoke the previously granted tenant administrator role from a user. No action is taken if the user is not currently assigned the role (the request is idempotent). The request will not be honored if revoking the role would leave the tenant with no administrator. The user specified in the JWT must themselves be an administrator and a valid tenant and user must be specified in the request body.
1024
+ * Revoke a previously granted role from a user. No action is taken if the user is not currently assigned the role. This request is idempotent. The type of role to grant may be specified in the request body. Allowed types are USER, TENANT_ADMIN and RESTRICTED_SVC. Default type is USER. The user and the role must be in the same tenant. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
1045
1025
  */
1046
- UserApi.prototype.revokeAdminRole = function (requestParameters, initOverrides) {
1026
+ UserApi.prototype.revokeRole = function (requestParameters, initOverrides) {
1047
1027
  return __awaiter(this, void 0, void 0, function () {
1048
1028
  var response;
1049
1029
  return __generator(this, function (_a) {
1050
1030
  switch (_a.label) {
1051
- case 0: return [4 /*yield*/, this.revokeAdminRoleRaw(requestParameters, initOverrides)];
1031
+ case 0: return [4 /*yield*/, this.revokeRoleRaw(requestParameters, initOverrides)];
1052
1032
  case 1:
1053
1033
  response = _a.sent();
1054
1034
  return [4 /*yield*/, response.value()];
@@ -1058,42 +1038,43 @@ var UserApi = /** @class */ (function (_super) {
1058
1038
  });
1059
1039
  };
1060
1040
  /**
1061
- * Revoke the specified permission from the user\'s default role. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. Default roles are created on demand. If the role does not exist when this method is called no error is reported and no changes occur. The change count returned can be zero or one depending on how many permissions were revoked. A valid tenant and user must be specified in the request body. The caller must be an administrator, a service or the user themselves.
1041
+ * Revoke the specified permission from the user\'s default role. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. Default roles are created on demand. If the role does not exist when this method is called no error is reported and no changes occur. The change count returned can be zero or one depending on how many permissions were revoked. A valid tenant and user must be specified in the request body. The caller must be an administrator, a service or the user themselves.
1062
1042
  */
1063
1043
  UserApi.prototype.revokeUserPermissionRaw = function (requestParameters, initOverrides) {
1064
1044
  return __awaiter(this, void 0, void 0, function () {
1065
- var queryParameters, headerParameters, response;
1066
- return __generator(this, function (_a) {
1067
- switch (_a.label) {
1045
+ var queryParameters, headerParameters, _a, _b, response;
1046
+ return __generator(this, function (_c) {
1047
+ switch (_c.label) {
1068
1048
  case 0:
1069
- if (requestParameters.reqRevokeUserPermission === null || requestParameters.reqRevokeUserPermission === undefined) {
1070
- throw new runtime.RequiredError('reqRevokeUserPermission', 'Required parameter requestParameters.reqRevokeUserPermission was null or undefined when calling revokeUserPermission.');
1049
+ if (requestParameters['reqRevokeUserPermission'] == null) {
1050
+ throw new runtime.RequiredError('reqRevokeUserPermission', 'Required parameter "reqRevokeUserPermission" was null or undefined when calling revokeUserPermission().');
1071
1051
  }
1072
1052
  queryParameters = {};
1073
- if (requestParameters.pretty !== undefined) {
1074
- queryParameters['pretty'] = requestParameters.pretty;
1075
- }
1076
1053
  headerParameters = {};
1077
1054
  headerParameters['Content-Type'] = 'application/json';
1078
- if (this.configuration && this.configuration.apiKey) {
1079
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
1080
- }
1081
- return [4 /*yield*/, this.request({
1082
- path: "/security/user/revokeUserPermission",
1083
- method: 'POST',
1084
- headers: headerParameters,
1085
- query: queryParameters,
1086
- body: models_1.ReqRevokeUserPermissionToJSON(requestParameters.reqRevokeUserPermission),
1087
- }, initOverrides)];
1055
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
1056
+ _a = headerParameters;
1057
+ _b = "X-Tapis-Token";
1058
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
1088
1059
  case 1:
1089
- response = _a.sent();
1090
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
1060
+ _a[_b] = _c.sent(); // TapisJWT authentication
1061
+ _c.label = 2;
1062
+ case 2: return [4 /*yield*/, this.request({
1063
+ path: "/security/user/revokeUserPermission",
1064
+ method: 'POST',
1065
+ headers: headerParameters,
1066
+ query: queryParameters,
1067
+ body: (0, index_1.ReqRevokeUserPermissionToJSON)(requestParameters['reqRevokeUserPermission']),
1068
+ }, initOverrides)];
1069
+ case 3:
1070
+ response = _c.sent();
1071
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
1091
1072
  }
1092
1073
  });
1093
1074
  });
1094
1075
  };
1095
1076
  /**
1096
- * Revoke the specified permission from the user\'s default role. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. Default roles are created on demand. If the role does not exist when this method is called no error is reported and no changes occur. The change count returned can be zero or one depending on how many permissions were revoked. A valid tenant and user must be specified in the request body. The caller must be an administrator, a service or the user themselves.
1077
+ * Revoke the specified permission from the user\'s default role. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. Default roles are created on demand. If the role does not exist when this method is called no error is reported and no changes occur. The change count returned can be zero or one depending on how many permissions were revoked. A valid tenant and user must be specified in the request body. The caller must be an administrator, a service or the user themselves.
1097
1078
  */
1098
1079
  UserApi.prototype.revokeUserPermission = function (requestParameters, initOverrides) {
1099
1080
  return __awaiter(this, void 0, void 0, function () {
@@ -1109,58 +1090,6 @@ var UserApi = /** @class */ (function (_super) {
1109
1090
  });
1110
1091
  });
1111
1092
  };
1112
- /**
1113
- * Revoke a previously granted role from a user. No action is taken if the user is not currently assigned the role. This request is idempotent. This request is authorized only if the requestor is the role owner or an administrator.
1114
- */
1115
- UserApi.prototype.revokeUserRoleRaw = function (requestParameters, initOverrides) {
1116
- return __awaiter(this, void 0, void 0, function () {
1117
- var queryParameters, headerParameters, response;
1118
- return __generator(this, function (_a) {
1119
- switch (_a.label) {
1120
- case 0:
1121
- if (requestParameters.reqRevokeUserRole === null || requestParameters.reqRevokeUserRole === undefined) {
1122
- throw new runtime.RequiredError('reqRevokeUserRole', 'Required parameter requestParameters.reqRevokeUserRole was null or undefined when calling revokeUserRole.');
1123
- }
1124
- queryParameters = {};
1125
- if (requestParameters.pretty !== undefined) {
1126
- queryParameters['pretty'] = requestParameters.pretty;
1127
- }
1128
- headerParameters = {};
1129
- headerParameters['Content-Type'] = 'application/json';
1130
- if (this.configuration && this.configuration.apiKey) {
1131
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
1132
- }
1133
- return [4 /*yield*/, this.request({
1134
- path: "/security/user/revokeUserRole",
1135
- method: 'POST',
1136
- headers: headerParameters,
1137
- query: queryParameters,
1138
- body: models_1.ReqRevokeUserRoleToJSON(requestParameters.reqRevokeUserRole),
1139
- }, initOverrides)];
1140
- case 1:
1141
- response = _a.sent();
1142
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
1143
- }
1144
- });
1145
- });
1146
- };
1147
- /**
1148
- * Revoke a previously granted role from a user. No action is taken if the user is not currently assigned the role. This request is idempotent. This request is authorized only if the requestor is the role owner or an administrator.
1149
- */
1150
- UserApi.prototype.revokeUserRole = function (requestParameters, initOverrides) {
1151
- return __awaiter(this, void 0, void 0, function () {
1152
- var response;
1153
- return __generator(this, function (_a) {
1154
- switch (_a.label) {
1155
- case 0: return [4 /*yield*/, this.revokeUserRoleRaw(requestParameters, initOverrides)];
1156
- case 1:
1157
- response = _a.sent();
1158
- return [4 /*yield*/, response.value()];
1159
- case 2: return [2 /*return*/, _a.sent()];
1160
- }
1161
- });
1162
- });
1163
- };
1164
1093
  return UserApi;
1165
1094
  }(runtime.BaseAPI));
1166
1095
  exports.UserApi = UserApi;