@vendasta/iam 2.2.2 → 2.3.0

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 (119) hide show
  1. package/esm2020/lib/_generated/host.service.mjs +25 -0
  2. package/esm2020/lib/_generated/index.mjs +2 -0
  3. package/esm2020/lib/_internal/enums/api.enum.mjs +22 -0
  4. package/esm2020/lib/_internal/enums/index.mjs +12 -0
  5. package/esm2020/lib/_internal/enums/policies.enum.mjs +18 -0
  6. package/esm2020/lib/_internal/enums/resources.enum.mjs +14 -0
  7. package/esm2020/lib/_internal/enums/subjects.enum.mjs +17 -0
  8. package/esm2020/lib/_internal/enums/users.enum.mjs +13 -0
  9. package/esm2020/lib/_internal/iam.api.service.mjs +189 -0
  10. package/esm2020/lib/_internal/index.mjs +12 -0
  11. package/esm2020/lib/_internal/interfaces/annotations.interface.mjs +8 -0
  12. package/esm2020/lib/_internal/interfaces/api.interface.mjs +2 -0
  13. package/esm2020/lib/_internal/interfaces/attributes.interface.mjs +8 -0
  14. package/esm2020/lib/_internal/interfaces/field-mask.interface.mjs +8 -0
  15. package/esm2020/lib/_internal/interfaces/index.mjs +2 -0
  16. package/esm2020/lib/_internal/interfaces/policies.interface.mjs +3 -0
  17. package/esm2020/lib/_internal/interfaces/resources.interface.mjs +2 -0
  18. package/esm2020/lib/_internal/interfaces/security-logs.interface.mjs +8 -0
  19. package/esm2020/lib/_internal/interfaces/subjects.interface.mjs +2 -0
  20. package/esm2020/lib/_internal/interfaces/users.interface.mjs +2 -0
  21. package/esm2020/lib/_internal/objects/annotations.mjs +30 -0
  22. package/esm2020/lib/_internal/objects/api.mjs +1846 -0
  23. package/esm2020/lib/_internal/objects/attributes.mjs +158 -0
  24. package/esm2020/lib/_internal/objects/field-mask.mjs +27 -0
  25. package/esm2020/lib/_internal/objects/index.mjs +16 -0
  26. package/esm2020/lib/_internal/objects/policies.mjs +264 -0
  27. package/esm2020/lib/_internal/objects/resources.mjs +168 -0
  28. package/esm2020/lib/_internal/objects/security-logs.mjs +42 -0
  29. package/esm2020/lib/_internal/objects/subjects.mjs +352 -0
  30. package/esm2020/lib/_internal/objects/users.mjs +168 -0
  31. package/esm2020/lib/_internal/user-iam.api.service.mjs +65 -0
  32. package/esm2020/lib/http/http.interface.mjs +2 -0
  33. package/esm2020/lib/http/http.mjs +104 -0
  34. package/esm2020/lib/http/iam.http.api.service.mjs +67 -0
  35. package/esm2020/lib/iam.service.mjs +155 -0
  36. package/esm2020/lib/index.mjs +7 -0
  37. package/esm2020/lib/personas/account-group.mjs +9 -0
  38. package/esm2020/lib/personas/base-personas.mjs +93 -0
  39. package/esm2020/lib/personas/developer.mjs +9 -0
  40. package/esm2020/lib/personas/digital-agent.mjs +9 -0
  41. package/esm2020/lib/personas/index.mjs +12 -0
  42. package/esm2020/lib/personas/partner-app.mjs +9 -0
  43. package/esm2020/lib/personas/partner.mjs +25 -0
  44. package/esm2020/lib/personas/persona-type.enum.mjs +13 -0
  45. package/esm2020/lib/personas/personas.mjs +57 -0
  46. package/esm2020/lib/personas/salesperson.mjs +15 -0
  47. package/esm2020/lib/personas/smb.mjs +10 -0
  48. package/esm2020/lib/personas/success.mjs +9 -0
  49. package/esm2020/lib/personas/vendor.mjs +9 -0
  50. package/esm2020/public_api.mjs +2 -0
  51. package/esm2020/vendasta-iam.mjs +5 -0
  52. package/fesm2015/{vendasta-iam.js → vendasta-iam.mjs} +362 -386
  53. package/fesm2015/vendasta-iam.mjs.map +1 -0
  54. package/fesm2020/vendasta-iam.mjs +3937 -0
  55. package/fesm2020/vendasta-iam.mjs.map +1 -0
  56. package/lib/_generated/host.service.d.ts +4 -11
  57. package/lib/_internal/iam.api.service.d.ts +3 -2
  58. package/lib/_internal/user-iam.api.service.d.ts +3 -2
  59. package/lib/http/iam.http.api.service.d.ts +3 -2
  60. package/lib/iam.service.d.ts +2 -2
  61. package/package.json +27 -16
  62. package/{README.md → src/README.md} +0 -0
  63. package/CHANGELOG.md +0 -101
  64. package/bundles/vendasta-iam.umd.js +0 -4531
  65. package/bundles/vendasta-iam.umd.js.map +0 -1
  66. package/bundles/vendasta-iam.umd.min.js +0 -16
  67. package/bundles/vendasta-iam.umd.min.js.map +0 -1
  68. package/esm2015/lib/_generated/host.service.js +0 -64
  69. package/esm2015/lib/_generated/index.js +0 -2
  70. package/esm2015/lib/_internal/enums/api.enum.js +0 -22
  71. package/esm2015/lib/_internal/enums/index.js +0 -12
  72. package/esm2015/lib/_internal/enums/policies.enum.js +0 -18
  73. package/esm2015/lib/_internal/enums/resources.enum.js +0 -14
  74. package/esm2015/lib/_internal/enums/subjects.enum.js +0 -17
  75. package/esm2015/lib/_internal/enums/users.enum.js +0 -13
  76. package/esm2015/lib/_internal/iam.api.service.js +0 -188
  77. package/esm2015/lib/_internal/index.js +0 -12
  78. package/esm2015/lib/_internal/interfaces/annotations.interface.js +0 -8
  79. package/esm2015/lib/_internal/interfaces/api.interface.js +0 -2
  80. package/esm2015/lib/_internal/interfaces/attributes.interface.js +0 -8
  81. package/esm2015/lib/_internal/interfaces/field-mask.interface.js +0 -8
  82. package/esm2015/lib/_internal/interfaces/index.js +0 -2
  83. package/esm2015/lib/_internal/interfaces/policies.interface.js +0 -3
  84. package/esm2015/lib/_internal/interfaces/resources.interface.js +0 -2
  85. package/esm2015/lib/_internal/interfaces/security-logs.interface.js +0 -8
  86. package/esm2015/lib/_internal/interfaces/subjects.interface.js +0 -2
  87. package/esm2015/lib/_internal/interfaces/users.interface.js +0 -2
  88. package/esm2015/lib/_internal/objects/annotations.js +0 -30
  89. package/esm2015/lib/_internal/objects/api.js +0 -1846
  90. package/esm2015/lib/_internal/objects/attributes.js +0 -158
  91. package/esm2015/lib/_internal/objects/field-mask.js +0 -27
  92. package/esm2015/lib/_internal/objects/index.js +0 -16
  93. package/esm2015/lib/_internal/objects/policies.js +0 -264
  94. package/esm2015/lib/_internal/objects/resources.js +0 -168
  95. package/esm2015/lib/_internal/objects/security-logs.js +0 -42
  96. package/esm2015/lib/_internal/objects/subjects.js +0 -352
  97. package/esm2015/lib/_internal/objects/users.js +0 -168
  98. package/esm2015/lib/_internal/user-iam.api.service.js +0 -64
  99. package/esm2015/lib/http/http.interface.js +0 -2
  100. package/esm2015/lib/http/http.js +0 -102
  101. package/esm2015/lib/http/iam.http.api.service.js +0 -65
  102. package/esm2015/lib/iam.service.js +0 -152
  103. package/esm2015/lib/index.js +0 -7
  104. package/esm2015/lib/personas/account-group.js +0 -9
  105. package/esm2015/lib/personas/base-personas.js +0 -89
  106. package/esm2015/lib/personas/developer.js +0 -9
  107. package/esm2015/lib/personas/digital-agent.js +0 -9
  108. package/esm2015/lib/personas/index.js +0 -12
  109. package/esm2015/lib/personas/partner-app.js +0 -9
  110. package/esm2015/lib/personas/partner.js +0 -25
  111. package/esm2015/lib/personas/persona-type.enum.js +0 -13
  112. package/esm2015/lib/personas/personas.js +0 -57
  113. package/esm2015/lib/personas/salesperson.js +0 -15
  114. package/esm2015/lib/personas/smb.js +0 -10
  115. package/esm2015/lib/personas/success.js +0 -9
  116. package/esm2015/lib/personas/vendor.js +0 -9
  117. package/esm2015/public_api.js +0 -2
  118. package/esm2015/vendasta-iam.js +0 -5
  119. package/fesm2015/vendasta-iam.js.map +0 -1
@@ -0,0 +1,3937 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i3 from '@vendasta/core';
4
+ import { map, share, switchMap } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common/http';
6
+ import { HttpHeaders } from '@angular/common/http';
7
+
8
+ function enumStringToValue$8(enumRef, value) {
9
+ if (typeof value === 'number') {
10
+ return value;
11
+ }
12
+ return enumRef[value];
13
+ }
14
+ class Attribute {
15
+ constructor(kwargs) {
16
+ if (!kwargs) {
17
+ return;
18
+ }
19
+ Object.assign(this, kwargs);
20
+ }
21
+ static fromProto(proto) {
22
+ let m = new Attribute();
23
+ m = Object.assign(m, proto);
24
+ if (proto.intAttribute) {
25
+ m.intAttribute = parseInt(proto.intAttribute, 10);
26
+ }
27
+ if (proto.structAttribute) {
28
+ m.structAttribute = StructAttribute.fromProto(proto.structAttribute);
29
+ }
30
+ if (proto.listAttribute) {
31
+ m.listAttribute = ListAttribute.fromProto(proto.listAttribute);
32
+ }
33
+ if (proto.timestampAttribute) {
34
+ m.timestampAttribute = new Date(proto.timestampAttribute);
35
+ }
36
+ if (proto.geopointAttribute) {
37
+ m.geopointAttribute = GeoPointAttribute.fromProto(proto.geopointAttribute);
38
+ }
39
+ return m;
40
+ }
41
+ toApiJson() {
42
+ const toReturn = {};
43
+ if (typeof this.intAttribute !== 'undefined') {
44
+ toReturn['intAttribute'] = this.intAttribute;
45
+ }
46
+ if (typeof this.doubleAttribute !== 'undefined') {
47
+ toReturn['doubleAttribute'] = this.doubleAttribute;
48
+ }
49
+ if (typeof this.stringAttribute !== 'undefined') {
50
+ toReturn['stringAttribute'] = this.stringAttribute;
51
+ }
52
+ if (typeof this.boolAttribute !== 'undefined') {
53
+ toReturn['boolAttribute'] = this.boolAttribute;
54
+ }
55
+ if (typeof this.structAttribute !== 'undefined' && this.structAttribute !== null) {
56
+ toReturn['structAttribute'] = 'toApiJson' in this.structAttribute ? this.structAttribute.toApiJson() : this.structAttribute;
57
+ }
58
+ if (typeof this.listAttribute !== 'undefined' && this.listAttribute !== null) {
59
+ toReturn['listAttribute'] = 'toApiJson' in this.listAttribute ? this.listAttribute.toApiJson() : this.listAttribute;
60
+ }
61
+ if (typeof this.timestampAttribute !== 'undefined' && this.timestampAttribute !== null) {
62
+ toReturn['timestampAttribute'] = 'toApiJson' in this.timestampAttribute ? this.timestampAttribute.toApiJson() : this.timestampAttribute;
63
+ }
64
+ if (typeof this.geopointAttribute !== 'undefined' && this.geopointAttribute !== null) {
65
+ toReturn['geopointAttribute'] = 'toApiJson' in this.geopointAttribute ? this.geopointAttribute.toApiJson() : this.geopointAttribute;
66
+ }
67
+ return toReturn;
68
+ }
69
+ }
70
+ class StructAttributeAttributesEntry {
71
+ constructor(kwargs) {
72
+ if (!kwargs) {
73
+ return;
74
+ }
75
+ Object.assign(this, kwargs);
76
+ }
77
+ static fromProto(proto) {
78
+ let m = new StructAttributeAttributesEntry();
79
+ m = Object.assign(m, proto);
80
+ if (proto.value) {
81
+ m.value = Attribute.fromProto(proto.value);
82
+ }
83
+ return m;
84
+ }
85
+ toApiJson() {
86
+ const toReturn = {};
87
+ if (typeof this.key !== 'undefined') {
88
+ toReturn['key'] = this.key;
89
+ }
90
+ if (typeof this.value !== 'undefined' && this.value !== null) {
91
+ toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;
92
+ }
93
+ return toReturn;
94
+ }
95
+ }
96
+ class GeoPointAttribute {
97
+ constructor(kwargs) {
98
+ if (!kwargs) {
99
+ return;
100
+ }
101
+ Object.assign(this, kwargs);
102
+ }
103
+ static fromProto(proto) {
104
+ let m = new GeoPointAttribute();
105
+ m = Object.assign(m, proto);
106
+ return m;
107
+ }
108
+ toApiJson() {
109
+ const toReturn = {};
110
+ if (typeof this.latitude !== 'undefined') {
111
+ toReturn['latitude'] = this.latitude;
112
+ }
113
+ if (typeof this.longitude !== 'undefined') {
114
+ toReturn['longitude'] = this.longitude;
115
+ }
116
+ return toReturn;
117
+ }
118
+ }
119
+ class ListAttribute {
120
+ constructor(kwargs) {
121
+ if (!kwargs) {
122
+ return;
123
+ }
124
+ Object.assign(this, kwargs);
125
+ }
126
+ static fromProto(proto) {
127
+ let m = new ListAttribute();
128
+ m = Object.assign(m, proto);
129
+ if (proto.attributes) {
130
+ m.attributes = proto.attributes.map(Attribute.fromProto);
131
+ }
132
+ return m;
133
+ }
134
+ toApiJson() {
135
+ const toReturn = {};
136
+ if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
137
+ toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
138
+ }
139
+ return toReturn;
140
+ }
141
+ }
142
+ class StructAttribute {
143
+ constructor(kwargs) {
144
+ if (!kwargs) {
145
+ return;
146
+ }
147
+ Object.assign(this, kwargs);
148
+ }
149
+ static fromProto(proto) {
150
+ let m = new StructAttribute();
151
+ m = Object.assign(m, proto);
152
+ if (proto.attributes) {
153
+ m.attributes = Object.keys(proto.attributes).reduce((obj, k) => { obj[k] = Attribute.fromProto(proto.attributes[k]); return obj; }, {});
154
+ }
155
+ return m;
156
+ }
157
+ toApiJson() {
158
+ const toReturn = {};
159
+ if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
160
+ toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
161
+ }
162
+ return toReturn;
163
+ }
164
+ }
165
+
166
+ // *********************************
167
+ // Code generated by sdkgen
168
+ // DO NOT EDIT!.
169
+ //
170
+ // Enums.
171
+ // *********************************
172
+ var BooleanOperator;
173
+ (function (BooleanOperator) {
174
+ BooleanOperator[BooleanOperator["AND"] = 0] = "AND";
175
+ BooleanOperator[BooleanOperator["OR"] = 1] = "OR";
176
+ BooleanOperator[BooleanOperator["NOT"] = 2] = "NOT";
177
+ })(BooleanOperator || (BooleanOperator = {}));
178
+ var ForOperator;
179
+ (function (ForOperator) {
180
+ ForOperator[ForOperator["ANY"] = 0] = "ANY";
181
+ ForOperator[ForOperator["ALL"] = 1] = "ALL";
182
+ })(ForOperator || (ForOperator = {}));
183
+
184
+ // *********************************
185
+ // Code generated by sdkgen
186
+ // DO NOT EDIT!.
187
+ //
188
+ // Enums.
189
+ // *********************************
190
+ var AccessScope;
191
+ (function (AccessScope) {
192
+ AccessScope[AccessScope["READ"] = 0] = "READ";
193
+ AccessScope[AccessScope["WRITE"] = 1] = "WRITE";
194
+ AccessScope[AccessScope["DELETE"] = 2] = "DELETE";
195
+ AccessScope[AccessScope["LIST"] = 3] = "LIST";
196
+ })(AccessScope || (AccessScope = {}));
197
+
198
+ // *********************************
199
+ // Code generated by sdkgen
200
+ // DO NOT EDIT!.
201
+ //
202
+ // Enums.
203
+ // *********************************
204
+ var AlgorithmType;
205
+ (function (AlgorithmType) {
206
+ AlgorithmType[AlgorithmType["ALGORITHM_TYPE_ES256"] = 0] = "ALGORITHM_TYPE_ES256";
207
+ AlgorithmType[AlgorithmType["ALGORITHM_TYPE_RS256"] = 1] = "ALGORITHM_TYPE_RS256";
208
+ })(AlgorithmType || (AlgorithmType = {}));
209
+ var OrderByDirection;
210
+ (function (OrderByDirection) {
211
+ OrderByDirection[OrderByDirection["ASCENDING"] = 0] = "ASCENDING";
212
+ OrderByDirection[OrderByDirection["DESCENDING"] = 1] = "DESCENDING";
213
+ })(OrderByDirection || (OrderByDirection = {}));
214
+
215
+ // *********************************
216
+ // Code generated by sdkgen
217
+ // DO NOT EDIT!.
218
+ //
219
+ // Enums.
220
+ // *********************************
221
+ var RestrictionType;
222
+ (function (RestrictionType) {
223
+ RestrictionType[RestrictionType["RESTRICTION_TYPE_UNSET"] = 0] = "RESTRICTION_TYPE_UNSET";
224
+ RestrictionType[RestrictionType["RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN"] = 1] = "RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN";
225
+ RestrictionType[RestrictionType["RESTRICTION_TYPE_FROZEN"] = 2] = "RESTRICTION_TYPE_FROZEN";
226
+ })(RestrictionType || (RestrictionType = {}));
227
+
228
+ // *********************************
229
+ // Code generated by sdkgen
230
+ // DO NOT EDIT!.
231
+ //
232
+ // Enums.
233
+ // *********************************
234
+ var SortDirection;
235
+ (function (SortDirection) {
236
+ SortDirection[SortDirection["SORT_DIRECTION_INVALID"] = 0] = "SORT_DIRECTION_INVALID";
237
+ SortDirection[SortDirection["SORT_DIRECTION_ASCENDING"] = 1] = "SORT_DIRECTION_ASCENDING";
238
+ SortDirection[SortDirection["SORT_DIRECTION_DESCENDING"] = 2] = "SORT_DIRECTION_DESCENDING";
239
+ })(SortDirection || (SortDirection = {}));
240
+ var UserSortField;
241
+ (function (UserSortField) {
242
+ UserSortField[UserSortField["USER_SORT_FIELD_INVALID"] = 0] = "USER_SORT_FIELD_INVALID";
243
+ UserSortField[UserSortField["USER_SORT_FIELD_CREATED"] = 1] = "USER_SORT_FIELD_CREATED";
244
+ UserSortField[UserSortField["USER_SORT_FIELD_FIRST_NAME"] = 2] = "USER_SORT_FIELD_FIRST_NAME";
245
+ UserSortField[UserSortField["USER_SORT_FIELD_LAST_NAME"] = 3] = "USER_SORT_FIELD_LAST_NAME";
246
+ UserSortField[UserSortField["USER_SORT_FIELD_EMAIL"] = 4] = "USER_SORT_FIELD_EMAIL";
247
+ UserSortField[UserSortField["USER_SORT_FIELD_LAST_LOGIN"] = 5] = "USER_SORT_FIELD_LAST_LOGIN";
248
+ })(UserSortField || (UserSortField = {}));
249
+
250
+ // *********************************
251
+
252
+ function enumStringToValue$7(enumRef, value) {
253
+ if (typeof value === 'number') {
254
+ return value;
255
+ }
256
+ return enumRef[value];
257
+ }
258
+ class Context {
259
+ constructor(kwargs) {
260
+ if (!kwargs) {
261
+ return;
262
+ }
263
+ Object.assign(this, kwargs);
264
+ }
265
+ static fromProto(proto) {
266
+ let m = new Context();
267
+ m = Object.assign(m, proto);
268
+ if (proto.namespaced) {
269
+ m.namespaced = NamespacedContext.fromProto(proto.namespaced);
270
+ }
271
+ if (proto.typed) {
272
+ m.typed = TypedContext.fromProto(proto.typed);
273
+ }
274
+ return m;
275
+ }
276
+ toApiJson() {
277
+ const toReturn = {};
278
+ if (typeof this.namespaced !== 'undefined' && this.namespaced !== null) {
279
+ toReturn['namespaced'] = 'toApiJson' in this.namespaced ? this.namespaced.toApiJson() : this.namespaced;
280
+ }
281
+ if (typeof this.typed !== 'undefined' && this.typed !== null) {
282
+ toReturn['typed'] = 'toApiJson' in this.typed ? this.typed.toApiJson() : this.typed;
283
+ }
284
+ return toReturn;
285
+ }
286
+ }
287
+ class MultiValueAttribute {
288
+ constructor(kwargs) {
289
+ if (!kwargs) {
290
+ return;
291
+ }
292
+ Object.assign(this, kwargs);
293
+ }
294
+ static fromProto(proto) {
295
+ let m = new MultiValueAttribute();
296
+ m = Object.assign(m, proto);
297
+ return m;
298
+ }
299
+ toApiJson() {
300
+ const toReturn = {};
301
+ if (typeof this.key !== 'undefined') {
302
+ toReturn['key'] = this.key;
303
+ }
304
+ if (typeof this.values !== 'undefined') {
305
+ toReturn['values'] = this.values;
306
+ }
307
+ return toReturn;
308
+ }
309
+ }
310
+ class Mutation {
311
+ constructor(kwargs) {
312
+ if (!kwargs) {
313
+ return;
314
+ }
315
+ Object.assign(this, kwargs);
316
+ }
317
+ static fromProto(proto) {
318
+ let m = new Mutation();
319
+ m = Object.assign(m, proto);
320
+ if (proto.add) {
321
+ m.add = SingleValueAttribute.fromProto(proto.add);
322
+ }
323
+ if (proto.replace) {
324
+ m.replace = MultiValueAttribute.fromProto(proto.replace);
325
+ }
326
+ if (proto.remove) {
327
+ m.remove = SingleValueAttribute.fromProto(proto.remove);
328
+ }
329
+ if (proto.replaceAttributes) {
330
+ m.replaceAttributes = StructAttribute.fromProto(proto.replaceAttributes);
331
+ }
332
+ if (proto.addAttributes) {
333
+ m.addAttributes = StructAttribute.fromProto(proto.addAttributes);
334
+ }
335
+ if (proto.removeAttributes) {
336
+ m.removeAttributes = StructAttribute.fromProto(proto.removeAttributes);
337
+ }
338
+ return m;
339
+ }
340
+ toApiJson() {
341
+ const toReturn = {};
342
+ if (typeof this.add !== 'undefined' && this.add !== null) {
343
+ toReturn['add'] = 'toApiJson' in this.add ? this.add.toApiJson() : this.add;
344
+ }
345
+ if (typeof this.replace !== 'undefined' && this.replace !== null) {
346
+ toReturn['replace'] = 'toApiJson' in this.replace ? this.replace.toApiJson() : this.replace;
347
+ }
348
+ if (typeof this.remove !== 'undefined' && this.remove !== null) {
349
+ toReturn['remove'] = 'toApiJson' in this.remove ? this.remove.toApiJson() : this.remove;
350
+ }
351
+ if (typeof this.dropKey !== 'undefined') {
352
+ toReturn['dropKey'] = this.dropKey;
353
+ }
354
+ if (typeof this.replaceAttributes !== 'undefined' && this.replaceAttributes !== null) {
355
+ toReturn['replaceAttributes'] = 'toApiJson' in this.replaceAttributes ? this.replaceAttributes.toApiJson() : this.replaceAttributes;
356
+ }
357
+ if (typeof this.addAttributes !== 'undefined' && this.addAttributes !== null) {
358
+ toReturn['addAttributes'] = 'toApiJson' in this.addAttributes ? this.addAttributes.toApiJson() : this.addAttributes;
359
+ }
360
+ if (typeof this.removeAttributes !== 'undefined' && this.removeAttributes !== null) {
361
+ toReturn['removeAttributes'] = 'toApiJson' in this.removeAttributes ? this.removeAttributes.toApiJson() : this.removeAttributes;
362
+ }
363
+ return toReturn;
364
+ }
365
+ }
366
+ class NamespacedContext {
367
+ constructor(kwargs) {
368
+ if (!kwargs) {
369
+ return;
370
+ }
371
+ Object.assign(this, kwargs);
372
+ }
373
+ static fromProto(proto) {
374
+ let m = new NamespacedContext();
375
+ m = Object.assign(m, proto);
376
+ return m;
377
+ }
378
+ toApiJson() {
379
+ const toReturn = {};
380
+ if (typeof this.namespace !== 'undefined') {
381
+ toReturn['namespace'] = this.namespace;
382
+ }
383
+ if (typeof this.type !== 'undefined') {
384
+ toReturn['type'] = this.type;
385
+ }
386
+ return toReturn;
387
+ }
388
+ }
389
+ class Persona {
390
+ constructor(kwargs) {
391
+ if (!kwargs) {
392
+ return;
393
+ }
394
+ Object.assign(this, kwargs);
395
+ }
396
+ static fromProto(proto) {
397
+ let m = new Persona();
398
+ m = Object.assign(m, proto);
399
+ if (proto.subject) {
400
+ m.subject = Subject.fromProto(proto.subject);
401
+ }
402
+ if (proto.context) {
403
+ m.context = Context.fromProto(proto.context);
404
+ }
405
+ return m;
406
+ }
407
+ toApiJson() {
408
+ const toReturn = {};
409
+ if (typeof this.subject !== 'undefined' && this.subject !== null) {
410
+ toReturn['subject'] = 'toApiJson' in this.subject ? this.subject.toApiJson() : this.subject;
411
+ }
412
+ if (typeof this.context !== 'undefined' && this.context !== null) {
413
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
414
+ }
415
+ return toReturn;
416
+ }
417
+ }
418
+ class PublicKey {
419
+ constructor(kwargs) {
420
+ if (!kwargs) {
421
+ return;
422
+ }
423
+ Object.assign(this, kwargs);
424
+ }
425
+ static fromProto(proto) {
426
+ let m = new PublicKey();
427
+ m = Object.assign(m, proto);
428
+ if (proto.algorithmType) {
429
+ m.algorithmType = enumStringToValue$7(AlgorithmType, proto.algorithmType);
430
+ }
431
+ return m;
432
+ }
433
+ toApiJson() {
434
+ const toReturn = {};
435
+ if (typeof this.key !== 'undefined') {
436
+ toReturn['key'] = this.key;
437
+ }
438
+ if (typeof this.id !== 'undefined') {
439
+ toReturn['id'] = this.id;
440
+ }
441
+ if (typeof this.algorithmType !== 'undefined') {
442
+ toReturn['algorithmType'] = this.algorithmType;
443
+ }
444
+ return toReturn;
445
+ }
446
+ }
447
+ class Query {
448
+ constructor(kwargs) {
449
+ if (!kwargs) {
450
+ return;
451
+ }
452
+ Object.assign(this, kwargs);
453
+ }
454
+ static fromProto(proto) {
455
+ let m = new Query();
456
+ m = Object.assign(m, proto);
457
+ return m;
458
+ }
459
+ toApiJson() {
460
+ const toReturn = {};
461
+ if (typeof this.searchTerm !== 'undefined') {
462
+ toReturn['searchTerm'] = this.searchTerm;
463
+ }
464
+ if (typeof this.attributeKeys !== 'undefined') {
465
+ toReturn['attributeKeys'] = this.attributeKeys;
466
+ }
467
+ return toReturn;
468
+ }
469
+ }
470
+ class SingleValueAttribute {
471
+ constructor(kwargs) {
472
+ if (!kwargs) {
473
+ return;
474
+ }
475
+ Object.assign(this, kwargs);
476
+ }
477
+ static fromProto(proto) {
478
+ let m = new SingleValueAttribute();
479
+ m = Object.assign(m, proto);
480
+ return m;
481
+ }
482
+ toApiJson() {
483
+ const toReturn = {};
484
+ if (typeof this.key !== 'undefined') {
485
+ toReturn['key'] = this.key;
486
+ }
487
+ if (typeof this.value !== 'undefined') {
488
+ toReturn['value'] = this.value;
489
+ }
490
+ return toReturn;
491
+ }
492
+ }
493
+ class Subject {
494
+ constructor(kwargs) {
495
+ if (!kwargs) {
496
+ return;
497
+ }
498
+ Object.assign(this, kwargs);
499
+ }
500
+ static fromProto(proto) {
501
+ let m = new Subject();
502
+ m = Object.assign(m, proto);
503
+ if (proto.attributes) {
504
+ m.attributes = proto.attributes.map(MultiValueAttribute.fromProto);
505
+ }
506
+ if (proto.created) {
507
+ m.created = new Date(proto.created);
508
+ }
509
+ if (proto.updated) {
510
+ m.updated = new Date(proto.updated);
511
+ }
512
+ if (proto.lastLogin) {
513
+ m.lastLogin = new Date(proto.lastLogin);
514
+ }
515
+ if (proto.publicKeys) {
516
+ m.publicKeys = proto.publicKeys.map(PublicKey.fromProto);
517
+ }
518
+ if (proto.structAttributes) {
519
+ m.structAttributes = StructAttribute.fromProto(proto.structAttributes);
520
+ }
521
+ return m;
522
+ }
523
+ toApiJson() {
524
+ const toReturn = {};
525
+ if (typeof this.subjectId !== 'undefined') {
526
+ toReturn['subjectId'] = this.subjectId;
527
+ }
528
+ if (typeof this.email !== 'undefined') {
529
+ toReturn['email'] = this.email;
530
+ }
531
+ if (typeof this.userId !== 'undefined') {
532
+ toReturn['userId'] = this.userId;
533
+ }
534
+ if (typeof this.partnerId !== 'undefined') {
535
+ toReturn['partnerId'] = this.partnerId;
536
+ }
537
+ if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
538
+ toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
539
+ }
540
+ if (typeof this.created !== 'undefined' && this.created !== null) {
541
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
542
+ }
543
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
544
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
545
+ }
546
+ if (typeof this.lastLogin !== 'undefined' && this.lastLogin !== null) {
547
+ toReturn['lastLogin'] = 'toApiJson' in this.lastLogin ? this.lastLogin.toApiJson() : this.lastLogin;
548
+ }
549
+ if (typeof this.publicKeys !== 'undefined' && this.publicKeys !== null) {
550
+ toReturn['publicKeys'] = 'toApiJson' in this.publicKeys ? this.publicKeys.toApiJson() : this.publicKeys;
551
+ }
552
+ if (typeof this.structAttributes !== 'undefined' && this.structAttributes !== null) {
553
+ toReturn['structAttributes'] = 'toApiJson' in this.structAttributes ? this.structAttributes.toApiJson() : this.structAttributes;
554
+ }
555
+ return toReturn;
556
+ }
557
+ }
558
+ class SubjectResult {
559
+ constructor(kwargs) {
560
+ if (!kwargs) {
561
+ return;
562
+ }
563
+ Object.assign(this, kwargs);
564
+ }
565
+ static fromProto(proto) {
566
+ let m = new SubjectResult();
567
+ m = Object.assign(m, proto);
568
+ if (proto.subject) {
569
+ m.subject = Subject.fromProto(proto.subject);
570
+ }
571
+ return m;
572
+ }
573
+ toApiJson() {
574
+ const toReturn = {};
575
+ if (typeof this.subject !== 'undefined' && this.subject !== null) {
576
+ toReturn['subject'] = 'toApiJson' in this.subject ? this.subject.toApiJson() : this.subject;
577
+ }
578
+ return toReturn;
579
+ }
580
+ }
581
+ class TypedContext {
582
+ constructor(kwargs) {
583
+ if (!kwargs) {
584
+ return;
585
+ }
586
+ Object.assign(this, kwargs);
587
+ }
588
+ static fromProto(proto) {
589
+ let m = new TypedContext();
590
+ m = Object.assign(m, proto);
591
+ return m;
592
+ }
593
+ toApiJson() {
594
+ const toReturn = {};
595
+ if (typeof this.type !== 'undefined') {
596
+ toReturn['type'] = this.type;
597
+ }
598
+ return toReturn;
599
+ }
600
+ }
601
+
602
+ function enumStringToValue$6(enumRef, value) {
603
+ if (typeof value === 'number') {
604
+ return value;
605
+ }
606
+ return enumRef[value];
607
+ }
608
+ class FieldMask {
609
+ constructor(kwargs) {
610
+ if (!kwargs) {
611
+ return;
612
+ }
613
+ Object.assign(this, kwargs);
614
+ }
615
+ static fromProto(proto) {
616
+ let m = new FieldMask();
617
+ m = Object.assign(m, proto);
618
+ return m;
619
+ }
620
+ toApiJson() {
621
+ const toReturn = {};
622
+ if (typeof this.paths !== 'undefined') {
623
+ toReturn['paths'] = this.paths;
624
+ }
625
+ return toReturn;
626
+ }
627
+ }
628
+
629
+ // NOTE: THIS HAS BEEN MANUALLY EDITED. PLEASE SEE THE BELOW COMMENTS TO SEE WHERE IT HAS BEEN EDITED
630
+ function enumStringToValue$5(enumRef, value) {
631
+ if (typeof value === 'number') {
632
+ return value;
633
+ }
634
+ return enumRef[value];
635
+ }
636
+ class IfClause {
637
+ constructor(kwargs) {
638
+ if (!kwargs) {
639
+ return;
640
+ }
641
+ Object.assign(this, kwargs);
642
+ }
643
+ static fromProto(proto) {
644
+ let m = new IfClause();
645
+ m = Object.assign(m, proto);
646
+ if (proto.resourceAttributeValue) {
647
+ m.resourceAttributeValue = Attribute.fromProto(proto.resourceAttributeValue);
648
+ }
649
+ if (proto.thenPolicy) {
650
+ m.thenPolicy = PolicyNode.fromProto(proto.thenPolicy);
651
+ }
652
+ if (proto.elsePolicy) {
653
+ m.elsePolicy = PolicyNode.fromProto(proto.elsePolicy);
654
+ }
655
+ return m;
656
+ }
657
+ toApiJson() {
658
+ const toReturn = {};
659
+ if (typeof this.resourceAttributeName !== 'undefined') {
660
+ toReturn['resourceAttributeName'] = this.resourceAttributeName;
661
+ }
662
+ if (typeof this.resourceAttributeValue !== 'undefined' && this.resourceAttributeValue !== null) {
663
+ toReturn['resourceAttributeValue'] = 'toApiJson' in this.resourceAttributeValue ? this.resourceAttributeValue.toApiJson() : this.resourceAttributeValue;
664
+ }
665
+ if (typeof this.thenPolicy !== 'undefined' && this.thenPolicy !== null) {
666
+ toReturn['thenPolicy'] = 'toApiJson' in this.thenPolicy ? this.thenPolicy.toApiJson() : this.thenPolicy;
667
+ }
668
+ if (typeof this.elsePolicy !== 'undefined' && this.elsePolicy !== null) {
669
+ toReturn['elsePolicy'] = 'toApiJson' in this.elsePolicy ? this.elsePolicy.toApiJson() : this.elsePolicy;
670
+ }
671
+ return toReturn;
672
+ }
673
+ }
674
+ class Operator {
675
+ constructor(kwargs) {
676
+ if (!kwargs) {
677
+ return;
678
+ }
679
+ Object.assign(this, kwargs);
680
+ }
681
+ static fromProto(proto) {
682
+ let m = new Operator();
683
+ m = Object.assign(m, proto);
684
+ // Edited from e.policiesBooleanOperator to e.BooleanOperator
685
+ if (proto.operator) {
686
+ m.operator = enumStringToValue$5(BooleanOperator, proto.operator);
687
+ }
688
+ if (proto.children) {
689
+ m.children = proto.children.map(PolicyNode.fromProto);
690
+ }
691
+ return m;
692
+ }
693
+ toApiJson() {
694
+ const toReturn = {};
695
+ if (typeof this.operator !== 'undefined') {
696
+ toReturn['operator'] = this.operator;
697
+ }
698
+ if (typeof this.children !== 'undefined' && this.children !== null) {
699
+ toReturn['children'] = 'toApiJson' in this.children ? this.children.toApiJson() : this.children;
700
+ }
701
+ return toReturn;
702
+ }
703
+ }
704
+ class PolicyNode {
705
+ constructor(kwargs) {
706
+ if (!kwargs) {
707
+ return;
708
+ }
709
+ Object.assign(this, kwargs);
710
+ }
711
+ static fromProto(proto) {
712
+ let m = new PolicyNode();
713
+ m = Object.assign(m, proto);
714
+ if (proto.subjectResourceIntersection) {
715
+ m.subjectResourceIntersection = SubjectResourceIntersectionClause.fromProto(proto.subjectResourceIntersection);
716
+ }
717
+ if (proto.operator) {
718
+ m.operator = Operator.fromProto(proto.operator);
719
+ }
720
+ if (proto.subjectValueIntersection) {
721
+ m.subjectValueIntersection = SubjectValueIntersectionClause.fromProto(proto.subjectValueIntersection);
722
+ }
723
+ if (proto.subjectMissingValue) {
724
+ m.subjectMissingValue = SubjectMissingValueClause.fromProto(proto.subjectMissingValue);
725
+ }
726
+ if (proto.subjectResourceSubset) {
727
+ m.subjectResourceSubset = SubjectResourceSubsetClause.fromProto(proto.subjectResourceSubset);
728
+ }
729
+ if (proto.subjectResourceFor) {
730
+ m.subjectResourceFor = SubjectResourceForClause.fromProto(proto.subjectResourceFor);
731
+ }
732
+ if (proto.ifClause) {
733
+ m.ifClause = IfClause.fromProto(proto.ifClause);
734
+ }
735
+ return m;
736
+ }
737
+ toApiJson() {
738
+ const toReturn = {};
739
+ if (typeof this.subjectResourceIntersection !== 'undefined' && this.subjectResourceIntersection !== null) {
740
+ toReturn['subjectResourceIntersection'] = 'toApiJson' in this.subjectResourceIntersection ? this.subjectResourceIntersection.toApiJson() : this.subjectResourceIntersection;
741
+ }
742
+ if (typeof this.operator !== 'undefined' && this.operator !== null) {
743
+ toReturn['operator'] = 'toApiJson' in this.operator ? this.operator.toApiJson() : this.operator;
744
+ }
745
+ if (typeof this.subjectValueIntersection !== 'undefined' && this.subjectValueIntersection !== null) {
746
+ toReturn['subjectValueIntersection'] = 'toApiJson' in this.subjectValueIntersection ? this.subjectValueIntersection.toApiJson() : this.subjectValueIntersection;
747
+ }
748
+ if (typeof this.subjectMissingValue !== 'undefined' && this.subjectMissingValue !== null) {
749
+ toReturn['subjectMissingValue'] = 'toApiJson' in this.subjectMissingValue ? this.subjectMissingValue.toApiJson() : this.subjectMissingValue;
750
+ }
751
+ if (typeof this.subjectResourceSubset !== 'undefined' && this.subjectResourceSubset !== null) {
752
+ toReturn['subjectResourceSubset'] = 'toApiJson' in this.subjectResourceSubset ? this.subjectResourceSubset.toApiJson() : this.subjectResourceSubset;
753
+ }
754
+ if (typeof this.subjectResourceFor !== 'undefined' && this.subjectResourceFor !== null) {
755
+ toReturn['subjectResourceFor'] = 'toApiJson' in this.subjectResourceFor ? this.subjectResourceFor.toApiJson() : this.subjectResourceFor;
756
+ }
757
+ if (typeof this.ifClause !== 'undefined' && this.ifClause !== null) {
758
+ toReturn['ifClause'] = 'toApiJson' in this.ifClause ? this.ifClause.toApiJson() : this.ifClause;
759
+ }
760
+ return toReturn;
761
+ }
762
+ }
763
+ class SubjectMissingValueClause {
764
+ constructor(kwargs) {
765
+ if (!kwargs) {
766
+ return;
767
+ }
768
+ Object.assign(this, kwargs);
769
+ }
770
+ static fromProto(proto) {
771
+ let m = new SubjectMissingValueClause();
772
+ m = Object.assign(m, proto);
773
+ return m;
774
+ }
775
+ toApiJson() {
776
+ const toReturn = {};
777
+ if (typeof this.attributeName !== 'undefined') {
778
+ toReturn['attributeName'] = this.attributeName;
779
+ }
780
+ return toReturn;
781
+ }
782
+ }
783
+ class SubjectResourceForClause {
784
+ constructor(kwargs) {
785
+ if (!kwargs) {
786
+ return;
787
+ }
788
+ Object.assign(this, kwargs);
789
+ }
790
+ static fromProto(proto) {
791
+ let m = new SubjectResourceForClause();
792
+ m = Object.assign(m, proto);
793
+ if (proto.operator) {
794
+ m.operator = enumStringToValue$5(ForOperator, proto.operator);
795
+ }
796
+ if (proto.rules) {
797
+ m.rules = PolicyNode.fromProto(proto.rules);
798
+ }
799
+ return m;
800
+ }
801
+ toApiJson() {
802
+ const toReturn = {};
803
+ if (typeof this.attributeName !== 'undefined') {
804
+ toReturn['attributeName'] = this.attributeName;
805
+ }
806
+ if (typeof this.operator !== 'undefined') {
807
+ toReturn['operator'] = this.operator;
808
+ }
809
+ if (typeof this.rules !== 'undefined' && this.rules !== null) {
810
+ toReturn['rules'] = 'toApiJson' in this.rules ? this.rules.toApiJson() : this.rules;
811
+ }
812
+ return toReturn;
813
+ }
814
+ }
815
+ class SubjectResourceIntersectionClause {
816
+ constructor(kwargs) {
817
+ if (!kwargs) {
818
+ return;
819
+ }
820
+ Object.assign(this, kwargs);
821
+ }
822
+ static fromProto(proto) {
823
+ let m = new SubjectResourceIntersectionClause();
824
+ m = Object.assign(m, proto);
825
+ return m;
826
+ }
827
+ toApiJson() {
828
+ const toReturn = {};
829
+ if (typeof this.attributeName !== 'undefined') {
830
+ toReturn['attributeName'] = this.attributeName;
831
+ }
832
+ if (typeof this.resourceAttributeName !== 'undefined') {
833
+ toReturn['resourceAttributeName'] = this.resourceAttributeName;
834
+ }
835
+ return toReturn;
836
+ }
837
+ }
838
+ class SubjectResourceSubsetClause {
839
+ constructor(kwargs) {
840
+ if (!kwargs) {
841
+ return;
842
+ }
843
+ Object.assign(this, kwargs);
844
+ }
845
+ static fromProto(proto) {
846
+ let m = new SubjectResourceSubsetClause();
847
+ m = Object.assign(m, proto);
848
+ return m;
849
+ }
850
+ toApiJson() {
851
+ const toReturn = {};
852
+ if (typeof this.attributeName !== 'undefined') {
853
+ toReturn['attributeName'] = this.attributeName;
854
+ }
855
+ if (typeof this.resourceAttributeName !== 'undefined') {
856
+ toReturn['resourceAttributeName'] = this.resourceAttributeName;
857
+ }
858
+ return toReturn;
859
+ }
860
+ }
861
+ class SubjectValueIntersectionClause {
862
+ constructor(kwargs) {
863
+ if (!kwargs) {
864
+ return;
865
+ }
866
+ Object.assign(this, kwargs);
867
+ }
868
+ static fromProto(proto) {
869
+ let m = new SubjectValueIntersectionClause();
870
+ m = Object.assign(m, proto);
871
+ if (proto.structuredAttributeValue) {
872
+ m.structuredAttributeValue = Attribute.fromProto(proto.structuredAttributeValue);
873
+ }
874
+ return m;
875
+ }
876
+ toApiJson() {
877
+ const toReturn = {};
878
+ if (typeof this.attributeName !== 'undefined') {
879
+ toReturn['attributeName'] = this.attributeName;
880
+ }
881
+ if (typeof this.attributeValue !== 'undefined') {
882
+ toReturn['attributeValue'] = this.attributeValue;
883
+ }
884
+ if (typeof this.structuredAttributeValue !== 'undefined' && this.structuredAttributeValue !== null) {
885
+ toReturn['structuredAttributeValue'] = 'toApiJson' in this.structuredAttributeValue ? this.structuredAttributeValue.toApiJson() : this.structuredAttributeValue;
886
+ }
887
+ return toReturn;
888
+ }
889
+ }
890
+
891
+ function enumStringToValue$4(enumRef, value) {
892
+ if (typeof value === 'number') {
893
+ return value;
894
+ }
895
+ return enumRef[value];
896
+ }
897
+ class AccessCheckFailures {
898
+ constructor(kwargs) {
899
+ if (!kwargs) {
900
+ return;
901
+ }
902
+ Object.assign(this, kwargs);
903
+ }
904
+ static fromProto(proto) {
905
+ let m = new AccessCheckFailures();
906
+ m = Object.assign(m, proto);
907
+ if (proto.failures) {
908
+ m.failures = proto.failures.map(ResourceIdentifier.fromProto);
909
+ }
910
+ return m;
911
+ }
912
+ toApiJson() {
913
+ const toReturn = {};
914
+ if (typeof this.failures !== 'undefined' && this.failures !== null) {
915
+ toReturn['failures'] = 'toApiJson' in this.failures ? this.failures.toApiJson() : this.failures;
916
+ }
917
+ return toReturn;
918
+ }
919
+ }
920
+ class ResourceIdentifierIdentifiersEntry {
921
+ constructor(kwargs) {
922
+ if (!kwargs) {
923
+ return;
924
+ }
925
+ Object.assign(this, kwargs);
926
+ }
927
+ static fromProto(proto) {
928
+ let m = new ResourceIdentifierIdentifiersEntry();
929
+ m = Object.assign(m, proto);
930
+ if (proto.value) {
931
+ m.value = ValueList.fromProto(proto.value);
932
+ }
933
+ return m;
934
+ }
935
+ toApiJson() {
936
+ const toReturn = {};
937
+ if (typeof this.key !== 'undefined') {
938
+ toReturn['key'] = this.key;
939
+ }
940
+ if (typeof this.value !== 'undefined' && this.value !== null) {
941
+ toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;
942
+ }
943
+ return toReturn;
944
+ }
945
+ }
946
+ class Policy {
947
+ constructor(kwargs) {
948
+ if (!kwargs) {
949
+ return;
950
+ }
951
+ Object.assign(this, kwargs);
952
+ }
953
+ static fromProto(proto) {
954
+ let m = new Policy();
955
+ m = Object.assign(m, proto);
956
+ if (proto.operations) {
957
+ m.operations = proto.operations.map((v) => enumStringToValue$4(AccessScope, v));
958
+ }
959
+ if (proto.policy) {
960
+ m.policy = PolicyNode.fromProto(proto.policy);
961
+ }
962
+ return m;
963
+ }
964
+ toApiJson() {
965
+ const toReturn = {};
966
+ if (typeof this.appId !== 'undefined') {
967
+ toReturn['appId'] = this.appId;
968
+ }
969
+ if (typeof this.resourceId !== 'undefined') {
970
+ toReturn['resourceId'] = this.resourceId;
971
+ }
972
+ if (typeof this.policyId !== 'undefined') {
973
+ toReturn['policyId'] = this.policyId;
974
+ }
975
+ if (typeof this.policyName !== 'undefined') {
976
+ toReturn['policyName'] = this.policyName;
977
+ }
978
+ if (typeof this.operations !== 'undefined') {
979
+ toReturn['operations'] = this.operations;
980
+ }
981
+ if (typeof this.actions !== 'undefined') {
982
+ toReturn['actions'] = this.actions;
983
+ }
984
+ if (typeof this.policy !== 'undefined' && this.policy !== null) {
985
+ toReturn['policy'] = 'toApiJson' in this.policy ? this.policy.toApiJson() : this.policy;
986
+ }
987
+ return toReturn;
988
+ }
989
+ }
990
+ class ResourceIdentifier {
991
+ constructor(kwargs) {
992
+ if (!kwargs) {
993
+ return;
994
+ }
995
+ Object.assign(this, kwargs);
996
+ }
997
+ static fromProto(proto) {
998
+ let m = new ResourceIdentifier();
999
+ m = Object.assign(m, proto);
1000
+ if (proto.identifiers) {
1001
+ m.identifiers = Object.keys(proto.identifiers).reduce((obj, k) => { obj[k] = ValueList.fromProto(proto.identifiers[k]); return obj; }, {});
1002
+ }
1003
+ return m;
1004
+ }
1005
+ toApiJson() {
1006
+ const toReturn = {};
1007
+ if (typeof this.identifiers !== 'undefined' && this.identifiers !== null) {
1008
+ toReturn['identifiers'] = 'toApiJson' in this.identifiers ? this.identifiers.toApiJson() : this.identifiers;
1009
+ }
1010
+ return toReturn;
1011
+ }
1012
+ }
1013
+ class ResourceOwner {
1014
+ constructor(kwargs) {
1015
+ if (!kwargs) {
1016
+ return;
1017
+ }
1018
+ Object.assign(this, kwargs);
1019
+ }
1020
+ static fromProto(proto) {
1021
+ let m = new ResourceOwner();
1022
+ m = Object.assign(m, proto);
1023
+ return m;
1024
+ }
1025
+ toApiJson() {
1026
+ const toReturn = {};
1027
+ if (typeof this.appId !== 'undefined') {
1028
+ toReturn['appId'] = this.appId;
1029
+ }
1030
+ if (typeof this.appName !== 'undefined') {
1031
+ toReturn['appName'] = this.appName;
1032
+ }
1033
+ return toReturn;
1034
+ }
1035
+ }
1036
+ class ValueList {
1037
+ constructor(kwargs) {
1038
+ if (!kwargs) {
1039
+ return;
1040
+ }
1041
+ Object.assign(this, kwargs);
1042
+ }
1043
+ static fromProto(proto) {
1044
+ let m = new ValueList();
1045
+ m = Object.assign(m, proto);
1046
+ return m;
1047
+ }
1048
+ toApiJson() {
1049
+ const toReturn = {};
1050
+ if (typeof this.values !== 'undefined') {
1051
+ toReturn['values'] = this.values;
1052
+ }
1053
+ return toReturn;
1054
+ }
1055
+ }
1056
+
1057
+ function enumStringToValue$3(enumRef, value) {
1058
+ if (typeof value === 'number') {
1059
+ return value;
1060
+ }
1061
+ return enumRef[value];
1062
+ }
1063
+ class SecurityLog {
1064
+ constructor(kwargs) {
1065
+ if (!kwargs) {
1066
+ return;
1067
+ }
1068
+ Object.assign(this, kwargs);
1069
+ }
1070
+ static fromProto(proto) {
1071
+ let m = new SecurityLog();
1072
+ m = Object.assign(m, proto);
1073
+ if (proto.created) {
1074
+ m.created = new Date(proto.created);
1075
+ }
1076
+ return m;
1077
+ }
1078
+ toApiJson() {
1079
+ const toReturn = {};
1080
+ if (typeof this.userId !== 'undefined') {
1081
+ toReturn['userId'] = this.userId;
1082
+ }
1083
+ if (typeof this.actionId !== 'undefined') {
1084
+ toReturn['actionId'] = this.actionId;
1085
+ }
1086
+ if (typeof this.logId !== 'undefined') {
1087
+ toReturn['logId'] = this.logId;
1088
+ }
1089
+ if (typeof this.description !== 'undefined') {
1090
+ toReturn['description'] = this.description;
1091
+ }
1092
+ if (typeof this.created !== 'undefined' && this.created !== null) {
1093
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
1094
+ }
1095
+ return toReturn;
1096
+ }
1097
+ }
1098
+
1099
+ function enumStringToValue$2(enumRef, value) {
1100
+ if (typeof value === 'number') {
1101
+ return value;
1102
+ }
1103
+ return enumRef[value];
1104
+ }
1105
+ class Identifier {
1106
+ constructor(kwargs) {
1107
+ if (!kwargs) {
1108
+ return;
1109
+ }
1110
+ Object.assign(this, kwargs);
1111
+ }
1112
+ static fromProto(proto) {
1113
+ let m = new Identifier();
1114
+ m = Object.assign(m, proto);
1115
+ return m;
1116
+ }
1117
+ toApiJson() {
1118
+ const toReturn = {};
1119
+ if (typeof this.subjectId !== 'undefined') {
1120
+ toReturn['subjectId'] = this.subjectId;
1121
+ }
1122
+ if (typeof this.userId !== 'undefined') {
1123
+ toReturn['userId'] = this.userId;
1124
+ }
1125
+ return toReturn;
1126
+ }
1127
+ }
1128
+ class NamespacedEmail {
1129
+ constructor(kwargs) {
1130
+ if (!kwargs) {
1131
+ return;
1132
+ }
1133
+ Object.assign(this, kwargs);
1134
+ }
1135
+ static fromProto(proto) {
1136
+ let m = new NamespacedEmail();
1137
+ m = Object.assign(m, proto);
1138
+ return m;
1139
+ }
1140
+ toApiJson() {
1141
+ const toReturn = {};
1142
+ if (typeof this.namespace !== 'undefined') {
1143
+ toReturn['namespace'] = this.namespace;
1144
+ }
1145
+ if (typeof this.email !== 'undefined') {
1146
+ toReturn['email'] = this.email;
1147
+ }
1148
+ return toReturn;
1149
+ }
1150
+ }
1151
+ class NamespacedSession {
1152
+ constructor(kwargs) {
1153
+ if (!kwargs) {
1154
+ return;
1155
+ }
1156
+ Object.assign(this, kwargs);
1157
+ }
1158
+ static fromProto(proto) {
1159
+ let m = new NamespacedSession();
1160
+ m = Object.assign(m, proto);
1161
+ return m;
1162
+ }
1163
+ toApiJson() {
1164
+ const toReturn = {};
1165
+ if (typeof this.namespace !== 'undefined') {
1166
+ toReturn['namespace'] = this.namespace;
1167
+ }
1168
+ if (typeof this.session !== 'undefined') {
1169
+ toReturn['session'] = this.session;
1170
+ }
1171
+ return toReturn;
1172
+ }
1173
+ }
1174
+ class TypedExternalIdentifier {
1175
+ constructor(kwargs) {
1176
+ if (!kwargs) {
1177
+ return;
1178
+ }
1179
+ Object.assign(this, kwargs);
1180
+ }
1181
+ static fromProto(proto) {
1182
+ let m = new TypedExternalIdentifier();
1183
+ m = Object.assign(m, proto);
1184
+ return m;
1185
+ }
1186
+ toApiJson() {
1187
+ const toReturn = {};
1188
+ if (typeof this.externalIdType !== 'undefined') {
1189
+ toReturn['externalIdType'] = this.externalIdType;
1190
+ }
1191
+ if (typeof this.externalId !== 'undefined') {
1192
+ toReturn['externalId'] = this.externalId;
1193
+ }
1194
+ return toReturn;
1195
+ }
1196
+ }
1197
+ class User {
1198
+ constructor(kwargs) {
1199
+ if (!kwargs) {
1200
+ return;
1201
+ }
1202
+ Object.assign(this, kwargs);
1203
+ }
1204
+ static fromProto(proto) {
1205
+ let m = new User();
1206
+ m = Object.assign(m, proto);
1207
+ if (proto.created) {
1208
+ m.created = new Date(proto.created);
1209
+ }
1210
+ if (proto.updated) {
1211
+ m.updated = new Date(proto.updated);
1212
+ }
1213
+ if (proto.lastLogin) {
1214
+ m.lastLogin = new Date(proto.lastLogin);
1215
+ }
1216
+ if (proto.publicKeys) {
1217
+ m.publicKeys = proto.publicKeys.map(PublicKey.fromProto);
1218
+ }
1219
+ return m;
1220
+ }
1221
+ toApiJson() {
1222
+ const toReturn = {};
1223
+ if (typeof this.userId !== 'undefined') {
1224
+ toReturn['userId'] = this.userId;
1225
+ }
1226
+ if (typeof this.namespace !== 'undefined') {
1227
+ toReturn['namespace'] = this.namespace;
1228
+ }
1229
+ if (typeof this.email !== 'undefined') {
1230
+ toReturn['email'] = this.email;
1231
+ }
1232
+ if (typeof this.created !== 'undefined' && this.created !== null) {
1233
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
1234
+ }
1235
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
1236
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
1237
+ }
1238
+ if (typeof this.firstName !== 'undefined') {
1239
+ toReturn['firstName'] = this.firstName;
1240
+ }
1241
+ if (typeof this.greetingName !== 'undefined') {
1242
+ toReturn['greetingName'] = this.greetingName;
1243
+ }
1244
+ if (typeof this.lastName !== 'undefined') {
1245
+ toReturn['lastName'] = this.lastName;
1246
+ }
1247
+ if (typeof this.languageCode !== 'undefined') {
1248
+ toReturn['languageCode'] = this.languageCode;
1249
+ }
1250
+ if (typeof this.emailVerified !== 'undefined') {
1251
+ toReturn['emailVerified'] = this.emailVerified;
1252
+ }
1253
+ if (typeof this.roles !== 'undefined') {
1254
+ toReturn['roles'] = this.roles;
1255
+ }
1256
+ if (typeof this.lastLogin !== 'undefined' && this.lastLogin !== null) {
1257
+ toReturn['lastLogin'] = 'toApiJson' in this.lastLogin ? this.lastLogin.toApiJson() : this.lastLogin;
1258
+ }
1259
+ if (typeof this.publicKeys !== 'undefined' && this.publicKeys !== null) {
1260
+ toReturn['publicKeys'] = 'toApiJson' in this.publicKeys ? this.publicKeys.toApiJson() : this.publicKeys;
1261
+ }
1262
+ return toReturn;
1263
+ }
1264
+ }
1265
+
1266
+ function enumStringToValue$1(enumRef, value) {
1267
+ if (typeof value === 'number') {
1268
+ return value;
1269
+ }
1270
+ return enumRef[value];
1271
+ }
1272
+ class AccessResourceRequest {
1273
+ constructor(kwargs) {
1274
+ if (!kwargs) {
1275
+ return;
1276
+ }
1277
+ Object.assign(this, kwargs);
1278
+ }
1279
+ static fromProto(proto) {
1280
+ let m = new AccessResourceRequest();
1281
+ m = Object.assign(m, proto);
1282
+ if (proto.context) {
1283
+ m.context = Context.fromProto(proto.context);
1284
+ }
1285
+ if (proto.resourceEntityIdentifier) {
1286
+ m.resourceEntityIdentifier = Object.keys(proto.resourceEntityIdentifier).reduce((obj, k) => { obj[k] = ValueList.fromProto(proto.resourceEntityIdentifier[k]); return obj; }, {});
1287
+ }
1288
+ if (proto.accessScope) {
1289
+ m.accessScope = proto.accessScope.map((v) => enumStringToValue$1(AccessScope, v));
1290
+ }
1291
+ if (proto.resourceEntityIdentifiers) {
1292
+ m.resourceEntityIdentifiers = proto.resourceEntityIdentifiers.map(ResourceIdentifier.fromProto);
1293
+ }
1294
+ if (proto.resourceAttributes) {
1295
+ m.resourceAttributes = StructAttribute.fromProto(proto.resourceAttributes);
1296
+ }
1297
+ return m;
1298
+ }
1299
+ toApiJson() {
1300
+ const toReturn = {};
1301
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1302
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1303
+ }
1304
+ if (typeof this.subjectId !== 'undefined') {
1305
+ toReturn['subjectId'] = this.subjectId;
1306
+ }
1307
+ if (typeof this.email !== 'undefined') {
1308
+ toReturn['email'] = this.email;
1309
+ }
1310
+ if (typeof this.userId !== 'undefined') {
1311
+ toReturn['userId'] = this.userId;
1312
+ }
1313
+ if (typeof this.session !== 'undefined') {
1314
+ toReturn['session'] = this.session;
1315
+ }
1316
+ if (typeof this.ownerId !== 'undefined') {
1317
+ toReturn['ownerId'] = this.ownerId;
1318
+ }
1319
+ if (typeof this.resourceId !== 'undefined') {
1320
+ toReturn['resourceId'] = this.resourceId;
1321
+ }
1322
+ if (typeof this.resourceEntityIdentifier !== 'undefined' && this.resourceEntityIdentifier !== null) {
1323
+ toReturn['resourceEntityIdentifier'] = 'toApiJson' in this.resourceEntityIdentifier ? this.resourceEntityIdentifier.toApiJson() : this.resourceEntityIdentifier;
1324
+ }
1325
+ if (typeof this.accessScope !== 'undefined') {
1326
+ toReturn['accessScope'] = this.accessScope;
1327
+ }
1328
+ if (typeof this.actions !== 'undefined') {
1329
+ toReturn['actions'] = this.actions;
1330
+ }
1331
+ if (typeof this.resourceEntityIdentifiers !== 'undefined' && this.resourceEntityIdentifiers !== null) {
1332
+ toReturn['resourceEntityIdentifiers'] = 'toApiJson' in this.resourceEntityIdentifiers ? this.resourceEntityIdentifiers.toApiJson() : this.resourceEntityIdentifiers;
1333
+ }
1334
+ if (typeof this.resourceAttributes !== 'undefined' && this.resourceAttributes !== null) {
1335
+ toReturn['resourceAttributes'] = 'toApiJson' in this.resourceAttributes ? this.resourceAttributes.toApiJson() : this.resourceAttributes;
1336
+ }
1337
+ return toReturn;
1338
+ }
1339
+ }
1340
+ class AddKeyRequest {
1341
+ constructor(kwargs) {
1342
+ if (!kwargs) {
1343
+ return;
1344
+ }
1345
+ Object.assign(this, kwargs);
1346
+ }
1347
+ static fromProto(proto) {
1348
+ let m = new AddKeyRequest();
1349
+ m = Object.assign(m, proto);
1350
+ if (proto.context) {
1351
+ m.context = Context.fromProto(proto.context);
1352
+ }
1353
+ if (proto.algorithmType) {
1354
+ m.algorithmType = enumStringToValue$1(AlgorithmType, proto.algorithmType);
1355
+ }
1356
+ if (proto.userIdentifier) {
1357
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
1358
+ }
1359
+ return m;
1360
+ }
1361
+ toApiJson() {
1362
+ const toReturn = {};
1363
+ if (typeof this.email !== 'undefined') {
1364
+ toReturn['email'] = this.email;
1365
+ }
1366
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1367
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1368
+ }
1369
+ if (typeof this.algorithmType !== 'undefined') {
1370
+ toReturn['algorithmType'] = this.algorithmType;
1371
+ }
1372
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
1373
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
1374
+ }
1375
+ return toReturn;
1376
+ }
1377
+ }
1378
+ class AddKeyResponse {
1379
+ constructor(kwargs) {
1380
+ if (!kwargs) {
1381
+ return;
1382
+ }
1383
+ Object.assign(this, kwargs);
1384
+ }
1385
+ static fromProto(proto) {
1386
+ let m = new AddKeyResponse();
1387
+ m = Object.assign(m, proto);
1388
+ return m;
1389
+ }
1390
+ toApiJson() {
1391
+ const toReturn = {};
1392
+ if (typeof this.privateKey !== 'undefined') {
1393
+ toReturn['privateKey'] = this.privateKey;
1394
+ }
1395
+ if (typeof this.keyId !== 'undefined') {
1396
+ toReturn['keyId'] = this.keyId;
1397
+ }
1398
+ return toReturn;
1399
+ }
1400
+ }
1401
+ class AddMultiUserRestrictionRequest {
1402
+ constructor(kwargs) {
1403
+ if (!kwargs) {
1404
+ return;
1405
+ }
1406
+ Object.assign(this, kwargs);
1407
+ }
1408
+ static fromProto(proto) {
1409
+ let m = new AddMultiUserRestrictionRequest();
1410
+ m = Object.assign(m, proto);
1411
+ if (proto.userIdentifiers) {
1412
+ m.userIdentifiers = proto.userIdentifiers.map(UserIdentifier.fromProto);
1413
+ }
1414
+ if (proto.restrictionType) {
1415
+ m.restrictionType = enumStringToValue$1(RestrictionType, proto.restrictionType);
1416
+ }
1417
+ return m;
1418
+ }
1419
+ toApiJson() {
1420
+ const toReturn = {};
1421
+ if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
1422
+ toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
1423
+ }
1424
+ if (typeof this.restrictionType !== 'undefined') {
1425
+ toReturn['restrictionType'] = this.restrictionType;
1426
+ }
1427
+ return toReturn;
1428
+ }
1429
+ }
1430
+ class AuthenticateSubjectRequest {
1431
+ constructor(kwargs) {
1432
+ if (!kwargs) {
1433
+ return;
1434
+ }
1435
+ Object.assign(this, kwargs);
1436
+ }
1437
+ static fromProto(proto) {
1438
+ let m = new AuthenticateSubjectRequest();
1439
+ m = Object.assign(m, proto);
1440
+ if (proto.context) {
1441
+ m.context = Context.fromProto(proto.context);
1442
+ }
1443
+ return m;
1444
+ }
1445
+ toApiJson() {
1446
+ const toReturn = {};
1447
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1448
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1449
+ }
1450
+ if (typeof this.email !== 'undefined') {
1451
+ toReturn['email'] = this.email;
1452
+ }
1453
+ if (typeof this.password !== 'undefined') {
1454
+ toReturn['password'] = this.password;
1455
+ }
1456
+ return toReturn;
1457
+ }
1458
+ }
1459
+ class ChangeSubjectEmailRequest {
1460
+ constructor(kwargs) {
1461
+ if (!kwargs) {
1462
+ return;
1463
+ }
1464
+ Object.assign(this, kwargs);
1465
+ }
1466
+ static fromProto(proto) {
1467
+ let m = new ChangeSubjectEmailRequest();
1468
+ m = Object.assign(m, proto);
1469
+ if (proto.context) {
1470
+ m.context = Context.fromProto(proto.context);
1471
+ }
1472
+ return m;
1473
+ }
1474
+ toApiJson() {
1475
+ const toReturn = {};
1476
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1477
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1478
+ }
1479
+ if (typeof this.subjectId !== 'undefined') {
1480
+ toReturn['subjectId'] = this.subjectId;
1481
+ }
1482
+ if (typeof this.newEmail !== 'undefined') {
1483
+ toReturn['newEmail'] = this.newEmail;
1484
+ }
1485
+ return toReturn;
1486
+ }
1487
+ }
1488
+ class CreateExternalIDRequest {
1489
+ constructor(kwargs) {
1490
+ if (!kwargs) {
1491
+ return;
1492
+ }
1493
+ Object.assign(this, kwargs);
1494
+ }
1495
+ static fromProto(proto) {
1496
+ let m = new CreateExternalIDRequest();
1497
+ m = Object.assign(m, proto);
1498
+ if (proto.userIdentifier) {
1499
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
1500
+ }
1501
+ if (proto.typedExternalIdentifier) {
1502
+ m.typedExternalIdentifier = TypedExternalIdentifier.fromProto(proto.typedExternalIdentifier);
1503
+ }
1504
+ return m;
1505
+ }
1506
+ toApiJson() {
1507
+ const toReturn = {};
1508
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
1509
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
1510
+ }
1511
+ if (typeof this.typedExternalIdentifier !== 'undefined' && this.typedExternalIdentifier !== null) {
1512
+ toReturn['typedExternalIdentifier'] = 'toApiJson' in this.typedExternalIdentifier ? this.typedExternalIdentifier.toApiJson() : this.typedExternalIdentifier;
1513
+ }
1514
+ return toReturn;
1515
+ }
1516
+ }
1517
+ class CreateSessionRequest {
1518
+ constructor(kwargs) {
1519
+ if (!kwargs) {
1520
+ return;
1521
+ }
1522
+ Object.assign(this, kwargs);
1523
+ }
1524
+ static fromProto(proto) {
1525
+ let m = new CreateSessionRequest();
1526
+ m = Object.assign(m, proto);
1527
+ if (proto.context) {
1528
+ m.context = Context.fromProto(proto.context);
1529
+ }
1530
+ if (proto.oauthCredentials) {
1531
+ m.oauthCredentials = OAuthCredentials.fromProto(proto.oauthCredentials);
1532
+ }
1533
+ if (proto.subjectCredentials) {
1534
+ m.subjectCredentials = SubjectCredentials.fromProto(proto.subjectCredentials);
1535
+ }
1536
+ return m;
1537
+ }
1538
+ toApiJson() {
1539
+ const toReturn = {};
1540
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1541
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1542
+ }
1543
+ if (typeof this.oauthCredentials !== 'undefined' && this.oauthCredentials !== null) {
1544
+ toReturn['oauthCredentials'] = 'toApiJson' in this.oauthCredentials ? this.oauthCredentials.toApiJson() : this.oauthCredentials;
1545
+ }
1546
+ if (typeof this.subjectCredentials !== 'undefined' && this.subjectCredentials !== null) {
1547
+ toReturn['subjectCredentials'] = 'toApiJson' in this.subjectCredentials ? this.subjectCredentials.toApiJson() : this.subjectCredentials;
1548
+ }
1549
+ return toReturn;
1550
+ }
1551
+ }
1552
+ class CreateSessionResponse {
1553
+ constructor(kwargs) {
1554
+ if (!kwargs) {
1555
+ return;
1556
+ }
1557
+ Object.assign(this, kwargs);
1558
+ }
1559
+ static fromProto(proto) {
1560
+ let m = new CreateSessionResponse();
1561
+ m = Object.assign(m, proto);
1562
+ return m;
1563
+ }
1564
+ toApiJson() {
1565
+ const toReturn = {};
1566
+ if (typeof this.session !== 'undefined') {
1567
+ toReturn['session'] = this.session;
1568
+ }
1569
+ return toReturn;
1570
+ }
1571
+ }
1572
+ class CreateTemporarySubjectRequest {
1573
+ constructor(kwargs) {
1574
+ if (!kwargs) {
1575
+ return;
1576
+ }
1577
+ Object.assign(this, kwargs);
1578
+ }
1579
+ static fromProto(proto) {
1580
+ let m = new CreateTemporarySubjectRequest();
1581
+ m = Object.assign(m, proto);
1582
+ if (proto.context) {
1583
+ m.context = Context.fromProto(proto.context);
1584
+ }
1585
+ if (proto.attributes) {
1586
+ m.attributes = StructAttribute.fromProto(proto.attributes);
1587
+ }
1588
+ return m;
1589
+ }
1590
+ toApiJson() {
1591
+ const toReturn = {};
1592
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1593
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1594
+ }
1595
+ if (typeof this.subject !== 'undefined') {
1596
+ toReturn['subject'] = this.subject;
1597
+ }
1598
+ if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
1599
+ toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
1600
+ }
1601
+ return toReturn;
1602
+ }
1603
+ }
1604
+ class CreateTemporarySubjectResponse {
1605
+ constructor(kwargs) {
1606
+ if (!kwargs) {
1607
+ return;
1608
+ }
1609
+ Object.assign(this, kwargs);
1610
+ }
1611
+ static fromProto(proto) {
1612
+ let m = new CreateTemporarySubjectResponse();
1613
+ m = Object.assign(m, proto);
1614
+ return m;
1615
+ }
1616
+ toApiJson() {
1617
+ const toReturn = {};
1618
+ if (typeof this.session !== 'undefined') {
1619
+ toReturn['session'] = this.session;
1620
+ }
1621
+ return toReturn;
1622
+ }
1623
+ }
1624
+ class DeleteSubjectRequest {
1625
+ constructor(kwargs) {
1626
+ if (!kwargs) {
1627
+ return;
1628
+ }
1629
+ Object.assign(this, kwargs);
1630
+ }
1631
+ static fromProto(proto) {
1632
+ let m = new DeleteSubjectRequest();
1633
+ m = Object.assign(m, proto);
1634
+ if (proto.context) {
1635
+ m.context = Context.fromProto(proto.context);
1636
+ }
1637
+ return m;
1638
+ }
1639
+ toApiJson() {
1640
+ const toReturn = {};
1641
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1642
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1643
+ }
1644
+ if (typeof this.subjectId !== 'undefined') {
1645
+ toReturn['subjectId'] = this.subjectId;
1646
+ }
1647
+ return toReturn;
1648
+ }
1649
+ }
1650
+ class DeleteUserRequest {
1651
+ constructor(kwargs) {
1652
+ if (!kwargs) {
1653
+ return;
1654
+ }
1655
+ Object.assign(this, kwargs);
1656
+ }
1657
+ static fromProto(proto) {
1658
+ let m = new DeleteUserRequest();
1659
+ m = Object.assign(m, proto);
1660
+ if (proto.userIdentifier) {
1661
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
1662
+ }
1663
+ return m;
1664
+ }
1665
+ toApiJson() {
1666
+ const toReturn = {};
1667
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
1668
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
1669
+ }
1670
+ return toReturn;
1671
+ }
1672
+ }
1673
+ class ListSecurityLogsRequestFilters {
1674
+ constructor(kwargs) {
1675
+ if (!kwargs) {
1676
+ return;
1677
+ }
1678
+ Object.assign(this, kwargs);
1679
+ }
1680
+ static fromProto(proto) {
1681
+ let m = new ListSecurityLogsRequestFilters();
1682
+ m = Object.assign(m, proto);
1683
+ return m;
1684
+ }
1685
+ toApiJson() {
1686
+ const toReturn = {};
1687
+ if (typeof this.actionId !== 'undefined') {
1688
+ toReturn['actionId'] = this.actionId;
1689
+ }
1690
+ return toReturn;
1691
+ }
1692
+ }
1693
+ class GetImpersonationTokenRequest {
1694
+ constructor(kwargs) {
1695
+ if (!kwargs) {
1696
+ return;
1697
+ }
1698
+ Object.assign(this, kwargs);
1699
+ }
1700
+ static fromProto(proto) {
1701
+ let m = new GetImpersonationTokenRequest();
1702
+ m = Object.assign(m, proto);
1703
+ if (proto.impersonatee) {
1704
+ m.impersonatee = UserIdentifier.fromProto(proto.impersonatee);
1705
+ }
1706
+ if (proto.impersonator) {
1707
+ m.impersonator = UserIdentifier.fromProto(proto.impersonator);
1708
+ }
1709
+ return m;
1710
+ }
1711
+ toApiJson() {
1712
+ const toReturn = {};
1713
+ if (typeof this.impersonatee !== 'undefined' && this.impersonatee !== null) {
1714
+ toReturn['impersonatee'] = 'toApiJson' in this.impersonatee ? this.impersonatee.toApiJson() : this.impersonatee;
1715
+ }
1716
+ if (typeof this.impersonator !== 'undefined' && this.impersonator !== null) {
1717
+ toReturn['impersonator'] = 'toApiJson' in this.impersonator ? this.impersonator.toApiJson() : this.impersonator;
1718
+ }
1719
+ return toReturn;
1720
+ }
1721
+ }
1722
+ class GetImpersonationTokenResponse {
1723
+ constructor(kwargs) {
1724
+ if (!kwargs) {
1725
+ return;
1726
+ }
1727
+ Object.assign(this, kwargs);
1728
+ }
1729
+ static fromProto(proto) {
1730
+ let m = new GetImpersonationTokenResponse();
1731
+ m = Object.assign(m, proto);
1732
+ return m;
1733
+ }
1734
+ toApiJson() {
1735
+ const toReturn = {};
1736
+ if (typeof this.token !== 'undefined') {
1737
+ toReturn['token'] = this.token;
1738
+ }
1739
+ return toReturn;
1740
+ }
1741
+ }
1742
+ class GetMultiExternalIDRequest {
1743
+ constructor(kwargs) {
1744
+ if (!kwargs) {
1745
+ return;
1746
+ }
1747
+ Object.assign(this, kwargs);
1748
+ }
1749
+ static fromProto(proto) {
1750
+ let m = new GetMultiExternalIDRequest();
1751
+ m = Object.assign(m, proto);
1752
+ if (proto.userIdentifiers) {
1753
+ m.userIdentifiers = proto.userIdentifiers.map(UserIdentifier.fromProto);
1754
+ }
1755
+ return m;
1756
+ }
1757
+ toApiJson() {
1758
+ const toReturn = {};
1759
+ if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
1760
+ toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
1761
+ }
1762
+ if (typeof this.externalIdType !== 'undefined') {
1763
+ toReturn['externalIdType'] = this.externalIdType;
1764
+ }
1765
+ return toReturn;
1766
+ }
1767
+ }
1768
+ class GetMultiExternalIDResponse {
1769
+ constructor(kwargs) {
1770
+ if (!kwargs) {
1771
+ return;
1772
+ }
1773
+ Object.assign(this, kwargs);
1774
+ }
1775
+ static fromProto(proto) {
1776
+ let m = new GetMultiExternalIDResponse();
1777
+ m = Object.assign(m, proto);
1778
+ return m;
1779
+ }
1780
+ toApiJson() {
1781
+ const toReturn = {};
1782
+ if (typeof this.externalIds !== 'undefined') {
1783
+ toReturn['externalIds'] = this.externalIds;
1784
+ }
1785
+ return toReturn;
1786
+ }
1787
+ }
1788
+ class GetMultiUsersRequest {
1789
+ constructor(kwargs) {
1790
+ if (!kwargs) {
1791
+ return;
1792
+ }
1793
+ Object.assign(this, kwargs);
1794
+ }
1795
+ static fromProto(proto) {
1796
+ let m = new GetMultiUsersRequest();
1797
+ m = Object.assign(m, proto);
1798
+ if (proto.userIdentifiers) {
1799
+ m.userIdentifiers = proto.userIdentifiers.map(UserIdentifier.fromProto);
1800
+ }
1801
+ return m;
1802
+ }
1803
+ toApiJson() {
1804
+ const toReturn = {};
1805
+ if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
1806
+ toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
1807
+ }
1808
+ return toReturn;
1809
+ }
1810
+ }
1811
+ class GetMultiUsersResponse {
1812
+ constructor(kwargs) {
1813
+ if (!kwargs) {
1814
+ return;
1815
+ }
1816
+ Object.assign(this, kwargs);
1817
+ }
1818
+ static fromProto(proto) {
1819
+ let m = new GetMultiUsersResponse();
1820
+ m = Object.assign(m, proto);
1821
+ if (proto.users) {
1822
+ m.users = proto.users.map(GetMultiUsersResponseUserContainer.fromProto);
1823
+ }
1824
+ return m;
1825
+ }
1826
+ toApiJson() {
1827
+ const toReturn = {};
1828
+ if (typeof this.users !== 'undefined' && this.users !== null) {
1829
+ toReturn['users'] = 'toApiJson' in this.users ? this.users.toApiJson() : this.users;
1830
+ }
1831
+ return toReturn;
1832
+ }
1833
+ }
1834
+ class GetResetPasswordTokenRequest {
1835
+ constructor(kwargs) {
1836
+ if (!kwargs) {
1837
+ return;
1838
+ }
1839
+ Object.assign(this, kwargs);
1840
+ }
1841
+ static fromProto(proto) {
1842
+ let m = new GetResetPasswordTokenRequest();
1843
+ m = Object.assign(m, proto);
1844
+ if (proto.context) {
1845
+ m.context = Context.fromProto(proto.context);
1846
+ }
1847
+ if (proto.userIdentifier) {
1848
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
1849
+ }
1850
+ return m;
1851
+ }
1852
+ toApiJson() {
1853
+ const toReturn = {};
1854
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1855
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1856
+ }
1857
+ if (typeof this.email !== 'undefined') {
1858
+ toReturn['email'] = this.email;
1859
+ }
1860
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
1861
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
1862
+ }
1863
+ return toReturn;
1864
+ }
1865
+ }
1866
+ class GetSessionTokenRequest {
1867
+ constructor(kwargs) {
1868
+ if (!kwargs) {
1869
+ return;
1870
+ }
1871
+ Object.assign(this, kwargs);
1872
+ }
1873
+ static fromProto(proto) {
1874
+ let m = new GetSessionTokenRequest();
1875
+ m = Object.assign(m, proto);
1876
+ return m;
1877
+ }
1878
+ toApiJson() {
1879
+ const toReturn = {};
1880
+ if (typeof this.token !== 'undefined') {
1881
+ toReturn['token'] = this.token;
1882
+ }
1883
+ return toReturn;
1884
+ }
1885
+ }
1886
+ class GetShortLivedTokenRequest {
1887
+ constructor(kwargs) {
1888
+ if (!kwargs) {
1889
+ return;
1890
+ }
1891
+ Object.assign(this, kwargs);
1892
+ }
1893
+ static fromProto(proto) {
1894
+ let m = new GetShortLivedTokenRequest();
1895
+ m = Object.assign(m, proto);
1896
+ if (proto.context) {
1897
+ m.context = Context.fromProto(proto.context);
1898
+ }
1899
+ return m;
1900
+ }
1901
+ toApiJson() {
1902
+ const toReturn = {};
1903
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1904
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1905
+ }
1906
+ if (typeof this.email !== 'undefined') {
1907
+ toReturn['email'] = this.email;
1908
+ }
1909
+ return toReturn;
1910
+ }
1911
+ }
1912
+ class GetSubjectBySessionRequest {
1913
+ constructor(kwargs) {
1914
+ if (!kwargs) {
1915
+ return;
1916
+ }
1917
+ Object.assign(this, kwargs);
1918
+ }
1919
+ static fromProto(proto) {
1920
+ let m = new GetSubjectBySessionRequest();
1921
+ m = Object.assign(m, proto);
1922
+ if (proto.context) {
1923
+ m.context = Context.fromProto(proto.context);
1924
+ }
1925
+ return m;
1926
+ }
1927
+ toApiJson() {
1928
+ const toReturn = {};
1929
+ if (typeof this.session !== 'undefined') {
1930
+ toReturn['session'] = this.session;
1931
+ }
1932
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1933
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1934
+ }
1935
+ return toReturn;
1936
+ }
1937
+ }
1938
+ class GetSubjectContextRequest {
1939
+ constructor(kwargs) {
1940
+ if (!kwargs) {
1941
+ return;
1942
+ }
1943
+ Object.assign(this, kwargs);
1944
+ }
1945
+ static fromProto(proto) {
1946
+ let m = new GetSubjectContextRequest();
1947
+ m = Object.assign(m, proto);
1948
+ return m;
1949
+ }
1950
+ toApiJson() {
1951
+ const toReturn = {};
1952
+ if (typeof this.subjectId !== 'undefined') {
1953
+ toReturn['subjectId'] = this.subjectId;
1954
+ }
1955
+ return toReturn;
1956
+ }
1957
+ }
1958
+ class GetSubjectContextResponse {
1959
+ constructor(kwargs) {
1960
+ if (!kwargs) {
1961
+ return;
1962
+ }
1963
+ Object.assign(this, kwargs);
1964
+ }
1965
+ static fromProto(proto) {
1966
+ let m = new GetSubjectContextResponse();
1967
+ m = Object.assign(m, proto);
1968
+ if (proto.context) {
1969
+ m.context = Context.fromProto(proto.context);
1970
+ }
1971
+ return m;
1972
+ }
1973
+ toApiJson() {
1974
+ const toReturn = {};
1975
+ if (typeof this.context !== 'undefined' && this.context !== null) {
1976
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
1977
+ }
1978
+ return toReturn;
1979
+ }
1980
+ }
1981
+ class GetSubjectResponse {
1982
+ constructor(kwargs) {
1983
+ if (!kwargs) {
1984
+ return;
1985
+ }
1986
+ Object.assign(this, kwargs);
1987
+ }
1988
+ static fromProto(proto) {
1989
+ let m = new GetSubjectResponse();
1990
+ m = Object.assign(m, proto);
1991
+ if (proto.subject) {
1992
+ m.subject = SubjectResult.fromProto(proto.subject);
1993
+ }
1994
+ return m;
1995
+ }
1996
+ toApiJson() {
1997
+ const toReturn = {};
1998
+ if (typeof this.subject !== 'undefined' && this.subject !== null) {
1999
+ toReturn['subject'] = 'toApiJson' in this.subject ? this.subject.toApiJson() : this.subject;
2000
+ }
2001
+ return toReturn;
2002
+ }
2003
+ }
2004
+ class GetSubjectsByEmailRequest {
2005
+ constructor(kwargs) {
2006
+ if (!kwargs) {
2007
+ return;
2008
+ }
2009
+ Object.assign(this, kwargs);
2010
+ }
2011
+ static fromProto(proto) {
2012
+ let m = new GetSubjectsByEmailRequest();
2013
+ m = Object.assign(m, proto);
2014
+ if (proto.context) {
2015
+ m.context = Context.fromProto(proto.context);
2016
+ }
2017
+ if (proto.fieldMask) {
2018
+ m.fieldMask = FieldMask.fromProto(proto.fieldMask);
2019
+ }
2020
+ return m;
2021
+ }
2022
+ toApiJson() {
2023
+ const toReturn = {};
2024
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2025
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2026
+ }
2027
+ if (typeof this.emails !== 'undefined') {
2028
+ toReturn['emails'] = this.emails;
2029
+ }
2030
+ if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {
2031
+ toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;
2032
+ }
2033
+ return toReturn;
2034
+ }
2035
+ }
2036
+ class GetSubjectsRequest {
2037
+ constructor(kwargs) {
2038
+ if (!kwargs) {
2039
+ return;
2040
+ }
2041
+ Object.assign(this, kwargs);
2042
+ }
2043
+ static fromProto(proto) {
2044
+ let m = new GetSubjectsRequest();
2045
+ m = Object.assign(m, proto);
2046
+ if (proto.context) {
2047
+ m.context = Context.fromProto(proto.context);
2048
+ }
2049
+ if (proto.fieldMask) {
2050
+ m.fieldMask = FieldMask.fromProto(proto.fieldMask);
2051
+ }
2052
+ if (proto.identifiers) {
2053
+ m.identifiers = proto.identifiers.map(Identifier.fromProto);
2054
+ }
2055
+ return m;
2056
+ }
2057
+ toApiJson() {
2058
+ const toReturn = {};
2059
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2060
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2061
+ }
2062
+ if (typeof this.subjectIds !== 'undefined') {
2063
+ toReturn['subjectIds'] = this.subjectIds;
2064
+ }
2065
+ if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {
2066
+ toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;
2067
+ }
2068
+ if (typeof this.identifiers !== 'undefined' && this.identifiers !== null) {
2069
+ toReturn['identifiers'] = 'toApiJson' in this.identifiers ? this.identifiers.toApiJson() : this.identifiers;
2070
+ }
2071
+ return toReturn;
2072
+ }
2073
+ }
2074
+ class GetSubjectsResponse {
2075
+ constructor(kwargs) {
2076
+ if (!kwargs) {
2077
+ return;
2078
+ }
2079
+ Object.assign(this, kwargs);
2080
+ }
2081
+ static fromProto(proto) {
2082
+ let m = new GetSubjectsResponse();
2083
+ m = Object.assign(m, proto);
2084
+ if (proto.subjects) {
2085
+ m.subjects = proto.subjects.map(SubjectResult.fromProto);
2086
+ }
2087
+ return m;
2088
+ }
2089
+ toApiJson() {
2090
+ const toReturn = {};
2091
+ if (typeof this.subjects !== 'undefined' && this.subjects !== null) {
2092
+ toReturn['subjects'] = 'toApiJson' in this.subjects ? this.subjects.toApiJson() : this.subjects;
2093
+ }
2094
+ return toReturn;
2095
+ }
2096
+ }
2097
+ class GetTokenRequest {
2098
+ static fromProto(proto) {
2099
+ let m = new GetTokenRequest();
2100
+ m = Object.assign(m, proto);
2101
+ return m;
2102
+ }
2103
+ constructor(kwargs) {
2104
+ if (!kwargs) {
2105
+ return;
2106
+ }
2107
+ Object.assign(this, kwargs);
2108
+ }
2109
+ toApiJson() {
2110
+ const toReturn = {};
2111
+ return toReturn;
2112
+ }
2113
+ }
2114
+ class GetTokenResponse {
2115
+ constructor(kwargs) {
2116
+ if (!kwargs) {
2117
+ return;
2118
+ }
2119
+ Object.assign(this, kwargs);
2120
+ }
2121
+ static fromProto(proto) {
2122
+ let m = new GetTokenResponse();
2123
+ m = Object.assign(m, proto);
2124
+ return m;
2125
+ }
2126
+ toApiJson() {
2127
+ const toReturn = {};
2128
+ if (typeof this.token !== 'undefined') {
2129
+ toReturn['token'] = this.token;
2130
+ }
2131
+ return toReturn;
2132
+ }
2133
+ }
2134
+ class IAMListPersonasRequest {
2135
+ constructor(kwargs) {
2136
+ if (!kwargs) {
2137
+ return;
2138
+ }
2139
+ Object.assign(this, kwargs);
2140
+ }
2141
+ static fromProto(proto) {
2142
+ let m = new IAMListPersonasRequest();
2143
+ m = Object.assign(m, proto);
2144
+ if (proto.userIdentifier) {
2145
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
2146
+ }
2147
+ if (proto.pageSize) {
2148
+ m.pageSize = parseInt(proto.pageSize, 10);
2149
+ }
2150
+ return m;
2151
+ }
2152
+ toApiJson() {
2153
+ const toReturn = {};
2154
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
2155
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
2156
+ }
2157
+ if (typeof this.cursor !== 'undefined') {
2158
+ toReturn['cursor'] = this.cursor;
2159
+ }
2160
+ if (typeof this.pageSize !== 'undefined') {
2161
+ toReturn['pageSize'] = this.pageSize;
2162
+ }
2163
+ if (typeof this.type !== 'undefined') {
2164
+ toReturn['type'] = this.type;
2165
+ }
2166
+ if (typeof this.namespace !== 'undefined') {
2167
+ toReturn['namespace'] = this.namespace;
2168
+ }
2169
+ if (typeof this.alwaysIncludeSuperadmin !== 'undefined') {
2170
+ toReturn['alwaysIncludeSuperadmin'] = this.alwaysIncludeSuperadmin;
2171
+ }
2172
+ return toReturn;
2173
+ }
2174
+ }
2175
+ class ListPersonasByEmailRequest {
2176
+ constructor(kwargs) {
2177
+ if (!kwargs) {
2178
+ return;
2179
+ }
2180
+ Object.assign(this, kwargs);
2181
+ }
2182
+ static fromProto(proto) {
2183
+ let m = new ListPersonasByEmailRequest();
2184
+ m = Object.assign(m, proto);
2185
+ if (proto.pageSize) {
2186
+ m.pageSize = parseInt(proto.pageSize, 10);
2187
+ }
2188
+ return m;
2189
+ }
2190
+ toApiJson() {
2191
+ const toReturn = {};
2192
+ if (typeof this.email !== 'undefined') {
2193
+ toReturn['email'] = this.email;
2194
+ }
2195
+ if (typeof this.cursor !== 'undefined') {
2196
+ toReturn['cursor'] = this.cursor;
2197
+ }
2198
+ if (typeof this.pageSize !== 'undefined') {
2199
+ toReturn['pageSize'] = this.pageSize;
2200
+ }
2201
+ if (typeof this.type !== 'undefined') {
2202
+ toReturn['type'] = this.type;
2203
+ }
2204
+ if (typeof this.namespace !== 'undefined') {
2205
+ toReturn['namespace'] = this.namespace;
2206
+ }
2207
+ return toReturn;
2208
+ }
2209
+ }
2210
+ class ListPersonasRequest {
2211
+ constructor(kwargs) {
2212
+ if (!kwargs) {
2213
+ return;
2214
+ }
2215
+ Object.assign(this, kwargs);
2216
+ }
2217
+ static fromProto(proto) {
2218
+ let m = new ListPersonasRequest();
2219
+ m = Object.assign(m, proto);
2220
+ if (proto.pageSize) {
2221
+ m.pageSize = parseInt(proto.pageSize, 10);
2222
+ }
2223
+ return m;
2224
+ }
2225
+ toApiJson() {
2226
+ const toReturn = {};
2227
+ if (typeof this.session !== 'undefined') {
2228
+ toReturn['session'] = this.session;
2229
+ }
2230
+ if (typeof this.cursor !== 'undefined') {
2231
+ toReturn['cursor'] = this.cursor;
2232
+ }
2233
+ if (typeof this.pageSize !== 'undefined') {
2234
+ toReturn['pageSize'] = this.pageSize;
2235
+ }
2236
+ if (typeof this.type !== 'undefined') {
2237
+ toReturn['type'] = this.type;
2238
+ }
2239
+ if (typeof this.namespace !== 'undefined') {
2240
+ toReturn['namespace'] = this.namespace;
2241
+ }
2242
+ return toReturn;
2243
+ }
2244
+ }
2245
+ class ListPersonasResponse {
2246
+ constructor(kwargs) {
2247
+ if (!kwargs) {
2248
+ return;
2249
+ }
2250
+ Object.assign(this, kwargs);
2251
+ }
2252
+ static fromProto(proto) {
2253
+ let m = new ListPersonasResponse();
2254
+ m = Object.assign(m, proto);
2255
+ if (proto.personas) {
2256
+ m.personas = proto.personas.map(Persona.fromProto);
2257
+ }
2258
+ return m;
2259
+ }
2260
+ toApiJson() {
2261
+ const toReturn = {};
2262
+ if (typeof this.personas !== 'undefined' && this.personas !== null) {
2263
+ toReturn['personas'] = 'toApiJson' in this.personas ? this.personas.toApiJson() : this.personas;
2264
+ }
2265
+ if (typeof this.nextCursor !== 'undefined') {
2266
+ toReturn['nextCursor'] = this.nextCursor;
2267
+ }
2268
+ if (typeof this.hasMore !== 'undefined') {
2269
+ toReturn['hasMore'] = this.hasMore;
2270
+ }
2271
+ return toReturn;
2272
+ }
2273
+ }
2274
+ class ListSecurityLogsRequest {
2275
+ constructor(kwargs) {
2276
+ if (!kwargs) {
2277
+ return;
2278
+ }
2279
+ Object.assign(this, kwargs);
2280
+ }
2281
+ static fromProto(proto) {
2282
+ let m = new ListSecurityLogsRequest();
2283
+ m = Object.assign(m, proto);
2284
+ if (proto.filters) {
2285
+ m.filters = ListSecurityLogsRequestFilters.fromProto(proto.filters);
2286
+ }
2287
+ if (proto.pageSize) {
2288
+ m.pageSize = parseInt(proto.pageSize, 10);
2289
+ }
2290
+ return m;
2291
+ }
2292
+ toApiJson() {
2293
+ const toReturn = {};
2294
+ if (typeof this.userId !== 'undefined') {
2295
+ toReturn['userId'] = this.userId;
2296
+ }
2297
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
2298
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
2299
+ }
2300
+ if (typeof this.pageSize !== 'undefined') {
2301
+ toReturn['pageSize'] = this.pageSize;
2302
+ }
2303
+ if (typeof this.cursor !== 'undefined') {
2304
+ toReturn['cursor'] = this.cursor;
2305
+ }
2306
+ return toReturn;
2307
+ }
2308
+ }
2309
+ class ListSecurityLogsResponse {
2310
+ constructor(kwargs) {
2311
+ if (!kwargs) {
2312
+ return;
2313
+ }
2314
+ Object.assign(this, kwargs);
2315
+ }
2316
+ static fromProto(proto) {
2317
+ let m = new ListSecurityLogsResponse();
2318
+ m = Object.assign(m, proto);
2319
+ if (proto.logs) {
2320
+ m.logs = proto.logs.map(SecurityLog.fromProto);
2321
+ }
2322
+ return m;
2323
+ }
2324
+ toApiJson() {
2325
+ const toReturn = {};
2326
+ if (typeof this.logs !== 'undefined' && this.logs !== null) {
2327
+ toReturn['logs'] = 'toApiJson' in this.logs ? this.logs.toApiJson() : this.logs;
2328
+ }
2329
+ if (typeof this.nextCursor !== 'undefined') {
2330
+ toReturn['nextCursor'] = this.nextCursor;
2331
+ }
2332
+ if (typeof this.hasMore !== 'undefined') {
2333
+ toReturn['hasMore'] = this.hasMore;
2334
+ }
2335
+ return toReturn;
2336
+ }
2337
+ }
2338
+ class ListUsersRequest {
2339
+ constructor(kwargs) {
2340
+ if (!kwargs) {
2341
+ return;
2342
+ }
2343
+ Object.assign(this, kwargs);
2344
+ }
2345
+ static fromProto(proto) {
2346
+ let m = new ListUsersRequest();
2347
+ m = Object.assign(m, proto);
2348
+ if (proto.pageSize) {
2349
+ m.pageSize = parseInt(proto.pageSize, 10);
2350
+ }
2351
+ if (proto.userFilter) {
2352
+ m.userFilter = UserFilter.fromProto(proto.userFilter);
2353
+ }
2354
+ if (proto.sortOptions) {
2355
+ m.sortOptions = proto.sortOptions.map(UserSortOptions.fromProto);
2356
+ }
2357
+ return m;
2358
+ }
2359
+ toApiJson() {
2360
+ const toReturn = {};
2361
+ if (typeof this.namespace !== 'undefined') {
2362
+ toReturn['namespace'] = this.namespace;
2363
+ }
2364
+ if (typeof this.email !== 'undefined') {
2365
+ toReturn['email'] = this.email;
2366
+ }
2367
+ if (typeof this.cursor !== 'undefined') {
2368
+ toReturn['cursor'] = this.cursor;
2369
+ }
2370
+ if (typeof this.pageSize !== 'undefined') {
2371
+ toReturn['pageSize'] = this.pageSize;
2372
+ }
2373
+ if (typeof this.userFilter !== 'undefined' && this.userFilter !== null) {
2374
+ toReturn['userFilter'] = 'toApiJson' in this.userFilter ? this.userFilter.toApiJson() : this.userFilter;
2375
+ }
2376
+ if (typeof this.sortOptions !== 'undefined' && this.sortOptions !== null) {
2377
+ toReturn['sortOptions'] = 'toApiJson' in this.sortOptions ? this.sortOptions.toApiJson() : this.sortOptions;
2378
+ }
2379
+ return toReturn;
2380
+ }
2381
+ }
2382
+ class ListUsersResponse {
2383
+ constructor(kwargs) {
2384
+ if (!kwargs) {
2385
+ return;
2386
+ }
2387
+ Object.assign(this, kwargs);
2388
+ }
2389
+ static fromProto(proto) {
2390
+ let m = new ListUsersResponse();
2391
+ m = Object.assign(m, proto);
2392
+ if (proto.users) {
2393
+ m.users = proto.users.map(User.fromProto);
2394
+ }
2395
+ return m;
2396
+ }
2397
+ toApiJson() {
2398
+ const toReturn = {};
2399
+ if (typeof this.users !== 'undefined' && this.users !== null) {
2400
+ toReturn['users'] = 'toApiJson' in this.users ? this.users.toApiJson() : this.users;
2401
+ }
2402
+ if (typeof this.nextCursor !== 'undefined') {
2403
+ toReturn['nextCursor'] = this.nextCursor;
2404
+ }
2405
+ if (typeof this.hasMore !== 'undefined') {
2406
+ toReturn['hasMore'] = this.hasMore;
2407
+ }
2408
+ return toReturn;
2409
+ }
2410
+ }
2411
+ class MutateAttributesRequest {
2412
+ constructor(kwargs) {
2413
+ if (!kwargs) {
2414
+ return;
2415
+ }
2416
+ Object.assign(this, kwargs);
2417
+ }
2418
+ static fromProto(proto) {
2419
+ let m = new MutateAttributesRequest();
2420
+ m = Object.assign(m, proto);
2421
+ if (proto.context) {
2422
+ m.context = Context.fromProto(proto.context);
2423
+ }
2424
+ if (proto.mutations) {
2425
+ m.mutations = proto.mutations.map(Mutation.fromProto);
2426
+ }
2427
+ return m;
2428
+ }
2429
+ toApiJson() {
2430
+ const toReturn = {};
2431
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2432
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2433
+ }
2434
+ if (typeof this.subjectId !== 'undefined') {
2435
+ toReturn['subjectId'] = this.subjectId;
2436
+ }
2437
+ if (typeof this.mutations !== 'undefined' && this.mutations !== null) {
2438
+ toReturn['mutations'] = 'toApiJson' in this.mutations ? this.mutations.toApiJson() : this.mutations;
2439
+ }
2440
+ return toReturn;
2441
+ }
2442
+ }
2443
+ class OAuthCredentials {
2444
+ constructor(kwargs) {
2445
+ if (!kwargs) {
2446
+ return;
2447
+ }
2448
+ Object.assign(this, kwargs);
2449
+ }
2450
+ static fromProto(proto) {
2451
+ let m = new OAuthCredentials();
2452
+ m = Object.assign(m, proto);
2453
+ return m;
2454
+ }
2455
+ toApiJson() {
2456
+ const toReturn = {};
2457
+ if (typeof this.provider !== 'undefined') {
2458
+ toReturn['provider'] = this.provider;
2459
+ }
2460
+ if (typeof this.idToken !== 'undefined') {
2461
+ toReturn['idToken'] = this.idToken;
2462
+ }
2463
+ if (typeof this.accessToken !== 'undefined') {
2464
+ toReturn['accessToken'] = this.accessToken;
2465
+ }
2466
+ return toReturn;
2467
+ }
2468
+ }
2469
+ class UpdateUserRequestOperation {
2470
+ constructor(kwargs) {
2471
+ if (!kwargs) {
2472
+ return;
2473
+ }
2474
+ Object.assign(this, kwargs);
2475
+ }
2476
+ static fromProto(proto) {
2477
+ let m = new UpdateUserRequestOperation();
2478
+ m = Object.assign(m, proto);
2479
+ return m;
2480
+ }
2481
+ toApiJson() {
2482
+ const toReturn = {};
2483
+ if (typeof this.firstName !== 'undefined') {
2484
+ toReturn['firstName'] = this.firstName;
2485
+ }
2486
+ if (typeof this.greetingName !== 'undefined') {
2487
+ toReturn['greetingName'] = this.greetingName;
2488
+ }
2489
+ if (typeof this.lastName !== 'undefined') {
2490
+ toReturn['lastName'] = this.lastName;
2491
+ }
2492
+ if (typeof this.languageCode !== 'undefined') {
2493
+ toReturn['languageCode'] = this.languageCode;
2494
+ }
2495
+ return toReturn;
2496
+ }
2497
+ }
2498
+ class RegisterPolicyRequest {
2499
+ constructor(kwargs) {
2500
+ if (!kwargs) {
2501
+ return;
2502
+ }
2503
+ Object.assign(this, kwargs);
2504
+ }
2505
+ static fromProto(proto) {
2506
+ let m = new RegisterPolicyRequest();
2507
+ m = Object.assign(m, proto);
2508
+ if (proto.policy) {
2509
+ m.policy = Policy.fromProto(proto.policy);
2510
+ }
2511
+ return m;
2512
+ }
2513
+ toApiJson() {
2514
+ const toReturn = {};
2515
+ if (typeof this.policy !== 'undefined' && this.policy !== null) {
2516
+ toReturn['policy'] = 'toApiJson' in this.policy ? this.policy.toApiJson() : this.policy;
2517
+ }
2518
+ return toReturn;
2519
+ }
2520
+ }
2521
+ class RegisterResourceOwnerRequest {
2522
+ constructor(kwargs) {
2523
+ if (!kwargs) {
2524
+ return;
2525
+ }
2526
+ Object.assign(this, kwargs);
2527
+ }
2528
+ static fromProto(proto) {
2529
+ let m = new RegisterResourceOwnerRequest();
2530
+ m = Object.assign(m, proto);
2531
+ if (proto.owner) {
2532
+ m.owner = ResourceOwner.fromProto(proto.owner);
2533
+ }
2534
+ return m;
2535
+ }
2536
+ toApiJson() {
2537
+ const toReturn = {};
2538
+ if (typeof this.owner !== 'undefined' && this.owner !== null) {
2539
+ toReturn['owner'] = 'toApiJson' in this.owner ? this.owner.toApiJson() : this.owner;
2540
+ }
2541
+ return toReturn;
2542
+ }
2543
+ }
2544
+ class RegisterResourceRequest {
2545
+ constructor(kwargs) {
2546
+ if (!kwargs) {
2547
+ return;
2548
+ }
2549
+ Object.assign(this, kwargs);
2550
+ }
2551
+ static fromProto(proto) {
2552
+ let m = new RegisterResourceRequest();
2553
+ m = Object.assign(m, proto);
2554
+ return m;
2555
+ }
2556
+ toApiJson() {
2557
+ const toReturn = {};
2558
+ if (typeof this.appId !== 'undefined') {
2559
+ toReturn['appId'] = this.appId;
2560
+ }
2561
+ if (typeof this.resourceId !== 'undefined') {
2562
+ toReturn['resourceId'] = this.resourceId;
2563
+ }
2564
+ if (typeof this.resourceName !== 'undefined') {
2565
+ toReturn['resourceName'] = this.resourceName;
2566
+ }
2567
+ if (typeof this.resourceOwnerServiceUrl !== 'undefined') {
2568
+ toReturn['resourceOwnerServiceUrl'] = this.resourceOwnerServiceUrl;
2569
+ }
2570
+ if (typeof this.requiredResourceParams !== 'undefined') {
2571
+ toReturn['requiredResourceParams'] = this.requiredResourceParams;
2572
+ }
2573
+ if (typeof this.resourceOwnerAudience !== 'undefined') {
2574
+ toReturn['resourceOwnerAudience'] = this.resourceOwnerAudience;
2575
+ }
2576
+ return toReturn;
2577
+ }
2578
+ }
2579
+ class RegisterSubjectRequest {
2580
+ constructor(kwargs) {
2581
+ if (!kwargs) {
2582
+ return;
2583
+ }
2584
+ Object.assign(this, kwargs);
2585
+ }
2586
+ static fromProto(proto) {
2587
+ let m = new RegisterSubjectRequest();
2588
+ m = Object.assign(m, proto);
2589
+ if (proto.context) {
2590
+ m.context = Context.fromProto(proto.context);
2591
+ }
2592
+ if (proto.attributes) {
2593
+ m.attributes = proto.attributes.map(MultiValueAttribute.fromProto);
2594
+ }
2595
+ if (proto.structAttributes) {
2596
+ m.structAttributes = StructAttribute.fromProto(proto.structAttributes);
2597
+ }
2598
+ return m;
2599
+ }
2600
+ toApiJson() {
2601
+ const toReturn = {};
2602
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2603
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2604
+ }
2605
+ if (typeof this.email !== 'undefined') {
2606
+ toReturn['email'] = this.email;
2607
+ }
2608
+ if (typeof this.password !== 'undefined') {
2609
+ toReturn['password'] = this.password;
2610
+ }
2611
+ if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
2612
+ toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
2613
+ }
2614
+ if (typeof this.structAttributes !== 'undefined' && this.structAttributes !== null) {
2615
+ toReturn['structAttributes'] = 'toApiJson' in this.structAttributes ? this.structAttributes.toApiJson() : this.structAttributes;
2616
+ }
2617
+ return toReturn;
2618
+ }
2619
+ }
2620
+ class RegisterSubjectResponse {
2621
+ constructor(kwargs) {
2622
+ if (!kwargs) {
2623
+ return;
2624
+ }
2625
+ Object.assign(this, kwargs);
2626
+ }
2627
+ static fromProto(proto) {
2628
+ let m = new RegisterSubjectResponse();
2629
+ m = Object.assign(m, proto);
2630
+ return m;
2631
+ }
2632
+ toApiJson() {
2633
+ const toReturn = {};
2634
+ if (typeof this.subjectId !== 'undefined') {
2635
+ toReturn['subjectId'] = this.subjectId;
2636
+ }
2637
+ return toReturn;
2638
+ }
2639
+ }
2640
+ class RemoveKeyRequest {
2641
+ constructor(kwargs) {
2642
+ if (!kwargs) {
2643
+ return;
2644
+ }
2645
+ Object.assign(this, kwargs);
2646
+ }
2647
+ static fromProto(proto) {
2648
+ let m = new RemoveKeyRequest();
2649
+ m = Object.assign(m, proto);
2650
+ if (proto.context) {
2651
+ m.context = Context.fromProto(proto.context);
2652
+ }
2653
+ if (proto.userIdentifier) {
2654
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
2655
+ }
2656
+ return m;
2657
+ }
2658
+ toApiJson() {
2659
+ const toReturn = {};
2660
+ if (typeof this.email !== 'undefined') {
2661
+ toReturn['email'] = this.email;
2662
+ }
2663
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2664
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2665
+ }
2666
+ if (typeof this.keyId !== 'undefined') {
2667
+ toReturn['keyId'] = this.keyId;
2668
+ }
2669
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
2670
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
2671
+ }
2672
+ return toReturn;
2673
+ }
2674
+ }
2675
+ class RemoveMultiUserRestrictionRequest {
2676
+ constructor(kwargs) {
2677
+ if (!kwargs) {
2678
+ return;
2679
+ }
2680
+ Object.assign(this, kwargs);
2681
+ }
2682
+ static fromProto(proto) {
2683
+ let m = new RemoveMultiUserRestrictionRequest();
2684
+ m = Object.assign(m, proto);
2685
+ if (proto.userIdentifiers) {
2686
+ m.userIdentifiers = proto.userIdentifiers.map(UserIdentifier.fromProto);
2687
+ }
2688
+ if (proto.restrictionType) {
2689
+ m.restrictionType = enumStringToValue$1(RestrictionType, proto.restrictionType);
2690
+ }
2691
+ return m;
2692
+ }
2693
+ toApiJson() {
2694
+ const toReturn = {};
2695
+ if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
2696
+ toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
2697
+ }
2698
+ if (typeof this.restrictionType !== 'undefined') {
2699
+ toReturn['restrictionType'] = this.restrictionType;
2700
+ }
2701
+ return toReturn;
2702
+ }
2703
+ }
2704
+ class ResetPasswordTokenResponse {
2705
+ constructor(kwargs) {
2706
+ if (!kwargs) {
2707
+ return;
2708
+ }
2709
+ Object.assign(this, kwargs);
2710
+ }
2711
+ static fromProto(proto) {
2712
+ let m = new ResetPasswordTokenResponse();
2713
+ m = Object.assign(m, proto);
2714
+ return m;
2715
+ }
2716
+ toApiJson() {
2717
+ const toReturn = {};
2718
+ if (typeof this.token !== 'undefined') {
2719
+ toReturn['token'] = this.token;
2720
+ }
2721
+ return toReturn;
2722
+ }
2723
+ }
2724
+ class ResetPasswordWithTokenRequest {
2725
+ constructor(kwargs) {
2726
+ if (!kwargs) {
2727
+ return;
2728
+ }
2729
+ Object.assign(this, kwargs);
2730
+ }
2731
+ static fromProto(proto) {
2732
+ let m = new ResetPasswordWithTokenRequest();
2733
+ m = Object.assign(m, proto);
2734
+ return m;
2735
+ }
2736
+ toApiJson() {
2737
+ const toReturn = {};
2738
+ if (typeof this.token !== 'undefined') {
2739
+ toReturn['token'] = this.token;
2740
+ }
2741
+ if (typeof this.password !== 'undefined') {
2742
+ toReturn['password'] = this.password;
2743
+ }
2744
+ return toReturn;
2745
+ }
2746
+ }
2747
+ class ResetSubjectPasswordRequest {
2748
+ constructor(kwargs) {
2749
+ if (!kwargs) {
2750
+ return;
2751
+ }
2752
+ Object.assign(this, kwargs);
2753
+ }
2754
+ static fromProto(proto) {
2755
+ let m = new ResetSubjectPasswordRequest();
2756
+ m = Object.assign(m, proto);
2757
+ if (proto.context) {
2758
+ m.context = Context.fromProto(proto.context);
2759
+ }
2760
+ return m;
2761
+ }
2762
+ toApiJson() {
2763
+ const toReturn = {};
2764
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2765
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2766
+ }
2767
+ if (typeof this.subjectId !== 'undefined') {
2768
+ toReturn['subjectId'] = this.subjectId;
2769
+ }
2770
+ if (typeof this.newPassword !== 'undefined') {
2771
+ toReturn['newPassword'] = this.newPassword;
2772
+ }
2773
+ return toReturn;
2774
+ }
2775
+ }
2776
+ class AccessResourceRequestResourceEntityIdentifierEntry {
2777
+ constructor(kwargs) {
2778
+ if (!kwargs) {
2779
+ return;
2780
+ }
2781
+ Object.assign(this, kwargs);
2782
+ }
2783
+ static fromProto(proto) {
2784
+ let m = new AccessResourceRequestResourceEntityIdentifierEntry();
2785
+ m = Object.assign(m, proto);
2786
+ if (proto.value) {
2787
+ m.value = ValueList.fromProto(proto.value);
2788
+ }
2789
+ return m;
2790
+ }
2791
+ toApiJson() {
2792
+ const toReturn = {};
2793
+ if (typeof this.key !== 'undefined') {
2794
+ toReturn['key'] = this.key;
2795
+ }
2796
+ if (typeof this.value !== 'undefined' && this.value !== null) {
2797
+ toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;
2798
+ }
2799
+ return toReturn;
2800
+ }
2801
+ }
2802
+ class SearchSubjectRequest {
2803
+ constructor(kwargs) {
2804
+ if (!kwargs) {
2805
+ return;
2806
+ }
2807
+ Object.assign(this, kwargs);
2808
+ }
2809
+ static fromProto(proto) {
2810
+ let m = new SearchSubjectRequest();
2811
+ m = Object.assign(m, proto);
2812
+ if (proto.context) {
2813
+ m.context = Context.fromProto(proto.context);
2814
+ }
2815
+ if (proto.query) {
2816
+ m.query = Query.fromProto(proto.query);
2817
+ }
2818
+ if (proto.filters) {
2819
+ m.filters = proto.filters.map(SingleValueAttribute.fromProto);
2820
+ }
2821
+ if (proto.orderByDirection) {
2822
+ m.orderByDirection = enumStringToValue$1(OrderByDirection, proto.orderByDirection);
2823
+ }
2824
+ if (proto.pageSize) {
2825
+ m.pageSize = parseInt(proto.pageSize, 10);
2826
+ }
2827
+ if (proto.fieldMask) {
2828
+ m.fieldMask = FieldMask.fromProto(proto.fieldMask);
2829
+ }
2830
+ return m;
2831
+ }
2832
+ toApiJson() {
2833
+ const toReturn = {};
2834
+ if (typeof this.context !== 'undefined' && this.context !== null) {
2835
+ toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
2836
+ }
2837
+ if (typeof this.query !== 'undefined' && this.query !== null) {
2838
+ toReturn['query'] = 'toApiJson' in this.query ? this.query.toApiJson() : this.query;
2839
+ }
2840
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
2841
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
2842
+ }
2843
+ if (typeof this.orderBy !== 'undefined') {
2844
+ toReturn['orderBy'] = this.orderBy;
2845
+ }
2846
+ if (typeof this.orderByDirection !== 'undefined') {
2847
+ toReturn['orderByDirection'] = this.orderByDirection;
2848
+ }
2849
+ if (typeof this.cursor !== 'undefined') {
2850
+ toReturn['cursor'] = this.cursor;
2851
+ }
2852
+ if (typeof this.pageSize !== 'undefined') {
2853
+ toReturn['pageSize'] = this.pageSize;
2854
+ }
2855
+ if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {
2856
+ toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;
2857
+ }
2858
+ return toReturn;
2859
+ }
2860
+ }
2861
+ class SearchSubjectResponse {
2862
+ constructor(kwargs) {
2863
+ if (!kwargs) {
2864
+ return;
2865
+ }
2866
+ Object.assign(this, kwargs);
2867
+ }
2868
+ static fromProto(proto) {
2869
+ let m = new SearchSubjectResponse();
2870
+ m = Object.assign(m, proto);
2871
+ if (proto.result) {
2872
+ m.result = proto.result.map(SubjectResult.fromProto);
2873
+ }
2874
+ if (proto.totalResults) {
2875
+ m.totalResults = parseInt(proto.totalResults, 10);
2876
+ }
2877
+ return m;
2878
+ }
2879
+ toApiJson() {
2880
+ const toReturn = {};
2881
+ if (typeof this.result !== 'undefined' && this.result !== null) {
2882
+ toReturn['result'] = 'toApiJson' in this.result ? this.result.toApiJson() : this.result;
2883
+ }
2884
+ if (typeof this.nextCursor !== 'undefined') {
2885
+ toReturn['nextCursor'] = this.nextCursor;
2886
+ }
2887
+ if (typeof this.hasMore !== 'undefined') {
2888
+ toReturn['hasMore'] = this.hasMore;
2889
+ }
2890
+ if (typeof this.totalResults !== 'undefined') {
2891
+ toReturn['totalResults'] = this.totalResults;
2892
+ }
2893
+ return toReturn;
2894
+ }
2895
+ }
2896
+ class SendEmailVerificationRequest {
2897
+ constructor(kwargs) {
2898
+ if (!kwargs) {
2899
+ return;
2900
+ }
2901
+ Object.assign(this, kwargs);
2902
+ }
2903
+ static fromProto(proto) {
2904
+ let m = new SendEmailVerificationRequest();
2905
+ m = Object.assign(m, proto);
2906
+ return m;
2907
+ }
2908
+ toApiJson() {
2909
+ const toReturn = {};
2910
+ if (typeof this.userId !== 'undefined') {
2911
+ toReturn['userId'] = this.userId;
2912
+ }
2913
+ return toReturn;
2914
+ }
2915
+ }
2916
+ class SubjectCredentials {
2917
+ constructor(kwargs) {
2918
+ if (!kwargs) {
2919
+ return;
2920
+ }
2921
+ Object.assign(this, kwargs);
2922
+ }
2923
+ static fromProto(proto) {
2924
+ let m = new SubjectCredentials();
2925
+ m = Object.assign(m, proto);
2926
+ return m;
2927
+ }
2928
+ toApiJson() {
2929
+ const toReturn = {};
2930
+ if (typeof this.email !== 'undefined') {
2931
+ toReturn['email'] = this.email;
2932
+ }
2933
+ if (typeof this.password !== 'undefined') {
2934
+ toReturn['password'] = this.password;
2935
+ }
2936
+ return toReturn;
2937
+ }
2938
+ }
2939
+ class UpdateUserRequest {
2940
+ constructor(kwargs) {
2941
+ if (!kwargs) {
2942
+ return;
2943
+ }
2944
+ Object.assign(this, kwargs);
2945
+ }
2946
+ static fromProto(proto) {
2947
+ let m = new UpdateUserRequest();
2948
+ m = Object.assign(m, proto);
2949
+ if (proto.operations) {
2950
+ m.operations = proto.operations.map(UpdateUserRequestOperation.fromProto);
2951
+ }
2952
+ return m;
2953
+ }
2954
+ toApiJson() {
2955
+ const toReturn = {};
2956
+ if (typeof this.userId !== 'undefined') {
2957
+ toReturn['userId'] = this.userId;
2958
+ }
2959
+ if (typeof this.operations !== 'undefined' && this.operations !== null) {
2960
+ toReturn['operations'] = 'toApiJson' in this.operations ? this.operations.toApiJson() : this.operations;
2961
+ }
2962
+ return toReturn;
2963
+ }
2964
+ }
2965
+ class GetMultiUsersResponseUserContainer {
2966
+ constructor(kwargs) {
2967
+ if (!kwargs) {
2968
+ return;
2969
+ }
2970
+ Object.assign(this, kwargs);
2971
+ }
2972
+ static fromProto(proto) {
2973
+ let m = new GetMultiUsersResponseUserContainer();
2974
+ m = Object.assign(m, proto);
2975
+ if (proto.user) {
2976
+ m.user = User.fromProto(proto.user);
2977
+ }
2978
+ return m;
2979
+ }
2980
+ toApiJson() {
2981
+ const toReturn = {};
2982
+ if (typeof this.user !== 'undefined' && this.user !== null) {
2983
+ toReturn['user'] = 'toApiJson' in this.user ? this.user.toApiJson() : this.user;
2984
+ }
2985
+ return toReturn;
2986
+ }
2987
+ }
2988
+ class UserFilter {
2989
+ constructor(kwargs) {
2990
+ if (!kwargs) {
2991
+ return;
2992
+ }
2993
+ Object.assign(this, kwargs);
2994
+ }
2995
+ static fromProto(proto) {
2996
+ let m = new UserFilter();
2997
+ m = Object.assign(m, proto);
2998
+ return m;
2999
+ }
3000
+ toApiJson() {
3001
+ const toReturn = {};
3002
+ if (typeof this.subjectTypes !== 'undefined') {
3003
+ toReturn['subjectTypes'] = this.subjectTypes;
3004
+ }
3005
+ if (typeof this.searchTerms !== 'undefined') {
3006
+ toReturn['searchTerms'] = this.searchTerms;
3007
+ }
3008
+ return toReturn;
3009
+ }
3010
+ }
3011
+ class UserIdentifier {
3012
+ constructor(kwargs) {
3013
+ if (!kwargs) {
3014
+ return;
3015
+ }
3016
+ Object.assign(this, kwargs);
3017
+ }
3018
+ static fromProto(proto) {
3019
+ let m = new UserIdentifier();
3020
+ m = Object.assign(m, proto);
3021
+ if (proto.namespacedEmail) {
3022
+ m.namespacedEmail = NamespacedEmail.fromProto(proto.namespacedEmail);
3023
+ }
3024
+ if (proto.namespacedSession) {
3025
+ m.namespacedSession = NamespacedSession.fromProto(proto.namespacedSession);
3026
+ }
3027
+ if (proto.typedExternalIdentifier) {
3028
+ m.typedExternalIdentifier = TypedExternalIdentifier.fromProto(proto.typedExternalIdentifier);
3029
+ }
3030
+ return m;
3031
+ }
3032
+ toApiJson() {
3033
+ const toReturn = {};
3034
+ if (typeof this.userId !== 'undefined') {
3035
+ toReturn['userId'] = this.userId;
3036
+ }
3037
+ if (typeof this.namespacedEmail !== 'undefined' && this.namespacedEmail !== null) {
3038
+ toReturn['namespacedEmail'] = 'toApiJson' in this.namespacedEmail ? this.namespacedEmail.toApiJson() : this.namespacedEmail;
3039
+ }
3040
+ if (typeof this.namespacedSession !== 'undefined' && this.namespacedSession !== null) {
3041
+ toReturn['namespacedSession'] = 'toApiJson' in this.namespacedSession ? this.namespacedSession.toApiJson() : this.namespacedSession;
3042
+ }
3043
+ if (typeof this.token !== 'undefined') {
3044
+ toReturn['token'] = this.token;
3045
+ }
3046
+ if (typeof this.typedExternalIdentifier !== 'undefined' && this.typedExternalIdentifier !== null) {
3047
+ toReturn['typedExternalIdentifier'] = 'toApiJson' in this.typedExternalIdentifier ? this.typedExternalIdentifier.toApiJson() : this.typedExternalIdentifier;
3048
+ }
3049
+ if (typeof this.subjectId !== 'undefined') {
3050
+ toReturn['subjectId'] = this.subjectId;
3051
+ }
3052
+ return toReturn;
3053
+ }
3054
+ }
3055
+ class UserSortOptions {
3056
+ constructor(kwargs) {
3057
+ if (!kwargs) {
3058
+ return;
3059
+ }
3060
+ Object.assign(this, kwargs);
3061
+ }
3062
+ static fromProto(proto) {
3063
+ let m = new UserSortOptions();
3064
+ m = Object.assign(m, proto);
3065
+ if (proto.direction) {
3066
+ m.direction = enumStringToValue$1(SortDirection, proto.direction);
3067
+ }
3068
+ if (proto.field) {
3069
+ m.field = enumStringToValue$1(UserSortField, proto.field);
3070
+ }
3071
+ return m;
3072
+ }
3073
+ toApiJson() {
3074
+ const toReturn = {};
3075
+ if (typeof this.direction !== 'undefined') {
3076
+ toReturn['direction'] = this.direction;
3077
+ }
3078
+ if (typeof this.field !== 'undefined') {
3079
+ toReturn['field'] = this.field;
3080
+ }
3081
+ return toReturn;
3082
+ }
3083
+ }
3084
+ class VerifyEmailRequest {
3085
+ constructor(kwargs) {
3086
+ if (!kwargs) {
3087
+ return;
3088
+ }
3089
+ Object.assign(this, kwargs);
3090
+ }
3091
+ static fromProto(proto) {
3092
+ let m = new VerifyEmailRequest();
3093
+ m = Object.assign(m, proto);
3094
+ return m;
3095
+ }
3096
+ toApiJson() {
3097
+ const toReturn = {};
3098
+ if (typeof this.token !== 'undefined') {
3099
+ toReturn['token'] = this.token;
3100
+ }
3101
+ return toReturn;
3102
+ }
3103
+ }
3104
+
3105
+ function enumStringToValue(enumRef, value) {
3106
+ if (typeof value === 'number') {
3107
+ return value;
3108
+ }
3109
+ return enumRef[value];
3110
+ }
3111
+ class Access {
3112
+ constructor(kwargs) {
3113
+ if (!kwargs) {
3114
+ return;
3115
+ }
3116
+ Object.assign(this, kwargs);
3117
+ }
3118
+ static fromProto(proto) {
3119
+ let m = new Access();
3120
+ m = Object.assign(m, proto);
3121
+ return m;
3122
+ }
3123
+ toApiJson() {
3124
+ const toReturn = {};
3125
+ if (typeof this.scope !== 'undefined') {
3126
+ toReturn['scope'] = this.scope;
3127
+ }
3128
+ if (typeof this.public !== 'undefined') {
3129
+ toReturn['public'] = this.public;
3130
+ }
3131
+ return toReturn;
3132
+ }
3133
+ }
3134
+
3135
+ // *********************************
3136
+
3137
+ const environment = (window ? window['environment'] : 'prod') ?? 'prod';
3138
+ const hostMap = {
3139
+ 'local': 'iam.vendasta-local.com',
3140
+ 'test': '',
3141
+ 'demo': 'iam-api-demo.apigateway.co',
3142
+ 'prod': 'iam-api-prod.apigateway.co',
3143
+ 'production': 'iam-api-prod.apigateway.co',
3144
+ };
3145
+ class HostService {
3146
+ get host() {
3147
+ return hostMap[environment.toLowerCase()];
3148
+ }
3149
+ get hostWithScheme() {
3150
+ return 'https://' + this.host;
3151
+ }
3152
+ }
3153
+ HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3154
+ HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: HostService, providedIn: 'root' });
3155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: HostService, decorators: [{
3156
+ type: Injectable,
3157
+ args: [{ providedIn: 'root' }]
3158
+ }] });
3159
+
3160
+ // *********************************
3161
+ class UserIAMApiService {
3162
+ constructor(http, hostService) {
3163
+ this.http = http;
3164
+ this.hostService = hostService;
3165
+ this._host = this.hostService.hostWithScheme;
3166
+ }
3167
+ apiOptions() {
3168
+ return {
3169
+ headers: new HttpHeaders({
3170
+ 'Content-Type': 'application/json'
3171
+ }),
3172
+ withCredentials: true
3173
+ };
3174
+ }
3175
+ getSubjectBySession(r) {
3176
+ const request = (r.toApiJson) ? r : new GetSubjectBySessionRequest(r);
3177
+ return this.http.post(this._host + "/iam.v1.UserIAM/GetSubjectBySession", request.toApiJson(), this.apiOptions())
3178
+ .pipe(map(resp => GetSubjectResponse.fromProto(resp)));
3179
+ }
3180
+ listPersonas(r) {
3181
+ const request = (r.toApiJson) ? r : new ListPersonasRequest(r);
3182
+ return this.http.post(this._host + "/iam.v1.UserIAM/ListPersonas", request.toApiJson(), this.apiOptions())
3183
+ .pipe(map(resp => ListPersonasResponse.fromProto(resp)));
3184
+ }
3185
+ getToken(r) {
3186
+ const request = (r.toApiJson) ? r : new GetTokenRequest(r);
3187
+ return this.http.post(this._host + "/iam.v1.UserIAM/GetToken", request.toApiJson(), this.apiOptions())
3188
+ .pipe(map(resp => GetTokenResponse.fromProto(resp)));
3189
+ }
3190
+ getSessionToken(r) {
3191
+ const request = (r.toApiJson) ? r : new GetSessionTokenRequest(r);
3192
+ return this.http.post(this._host + "/iam.v1.UserIAM/GetSessionToken", request.toApiJson(), this.apiOptions())
3193
+ .pipe(map(resp => GetTokenResponse.fromProto(resp)));
3194
+ }
3195
+ resetPasswordWithToken(r) {
3196
+ const request = (r.toApiJson) ? r : new ResetPasswordWithTokenRequest(r);
3197
+ return this.http.post(this._host + "/iam.v1.UserIAM/ResetPasswordWithToken", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3198
+ }
3199
+ getImpersonationToken(r) {
3200
+ const request = (r.toApiJson) ? r : new GetImpersonationTokenRequest(r);
3201
+ return this.http.post(this._host + "/iam.v1.UserIAM/GetImpersonationToken", request.toApiJson(), this.apiOptions())
3202
+ .pipe(map(resp => GetImpersonationTokenResponse.fromProto(resp)));
3203
+ }
3204
+ }
3205
+ UserIAMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: UserIAMApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
3206
+ UserIAMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: UserIAMApiService, providedIn: 'root' });
3207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: UserIAMApiService, decorators: [{
3208
+ type: Injectable,
3209
+ args: [{ providedIn: 'root' }]
3210
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
3211
+
3212
+ class LoginRequest {
3213
+ constructor(kwargs) {
3214
+ if (!kwargs) {
3215
+ return;
3216
+ }
3217
+ Object.assign(this, kwargs);
3218
+ }
3219
+ static fromProto(proto) {
3220
+ if (!proto) {
3221
+ return new LoginRequest();
3222
+ }
3223
+ let m = new LoginRequest();
3224
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3225
+ m = Object.assign(m, proto);
3226
+ return m;
3227
+ }
3228
+ toApiJson() {
3229
+ if (typeof this.namespace === 'undefined' &&
3230
+ typeof this.type === 'undefined' &&
3231
+ typeof this.email === 'undefined' &&
3232
+ typeof this.password === 'undefined' &&
3233
+ typeof this.providerIdToken === 'undefined' &&
3234
+ typeof this.provider === 'undefined') {
3235
+ return {};
3236
+ }
3237
+ return {
3238
+ 'namespace': (typeof this.namespace !== 'undefined') ? this.namespace : null,
3239
+ 'type': (typeof this.type !== 'undefined') ? this.type : null,
3240
+ 'email': (typeof this.email !== 'undefined') ? this.email : null,
3241
+ 'password': (typeof this.password !== 'undefined') ? this.password : null,
3242
+ 'provider_id_token': (typeof this.providerIdToken !== 'undefined') ? this.providerIdToken : null,
3243
+ 'provider': (typeof this.provider !== 'undefined') ? this.provider : null
3244
+ };
3245
+ }
3246
+ }
3247
+ class LoginResponse {
3248
+ constructor(kwargs) {
3249
+ if (!kwargs) {
3250
+ return;
3251
+ }
3252
+ Object.assign(this, kwargs);
3253
+ }
3254
+ static fromProto(proto) {
3255
+ /* eslint-disable */
3256
+ const m = new LoginResponse();
3257
+ m.sessionId = proto['session_id'];
3258
+ return m;
3259
+ }
3260
+ toApiJson() {
3261
+ if (typeof this.sessionId === 'undefined') {
3262
+ return {};
3263
+ }
3264
+ return {
3265
+ 'sessionId': (typeof this.sessionId !== 'undefined') ? this.sessionId : null
3266
+ };
3267
+ }
3268
+ }
3269
+ class LogoutResponse {
3270
+ constructor(kwargs) {
3271
+ if (!kwargs) {
3272
+ return;
3273
+ }
3274
+ Object.assign(this, kwargs);
3275
+ }
3276
+ static fromProto(proto) {
3277
+ let m = new LogoutResponse();
3278
+ m = Object.assign(m, proto);
3279
+ return m;
3280
+ }
3281
+ toApiJson() {
3282
+ if (typeof this.success === 'undefined') {
3283
+ return {};
3284
+ }
3285
+ return {
3286
+ 'success': (typeof this.success !== 'undefined') ? this.success : null
3287
+ };
3288
+ }
3289
+ }
3290
+ class SSOLoginRequest {
3291
+ constructor(kwargs) {
3292
+ if (!kwargs) {
3293
+ return;
3294
+ }
3295
+ Object.assign(this, kwargs);
3296
+ }
3297
+ static fromProto(proto) {
3298
+ let m = new SSOLoginRequest();
3299
+ m = Object.assign(m, proto);
3300
+ return m;
3301
+ }
3302
+ toApiJson() {
3303
+ if (typeof this.nextUrl === 'undefined' &&
3304
+ typeof this.namespace === 'undefined' &&
3305
+ typeof this.type === 'undefined') {
3306
+ return null;
3307
+ }
3308
+ return {
3309
+ 'next_url': (typeof this.nextUrl !== 'undefined') ? this.nextUrl : null,
3310
+ 'namespace': (typeof this.namespace !== 'undefined') ? this.namespace : null,
3311
+ 'type': (typeof this.type !== 'undefined') ? this.type : null
3312
+ };
3313
+ }
3314
+ }
3315
+
3316
+ /* eslint-disable */
3317
+ class IamHttpApiService {
3318
+ constructor(http, hostService) {
3319
+ this.http = http;
3320
+ this.hostService = hostService;
3321
+ this._host = this.hostService.hostWithScheme;
3322
+ }
3323
+ apiOptions(includeCredentials) {
3324
+ if (includeCredentials) {
3325
+ return {
3326
+ headers: new HttpHeaders({
3327
+ 'Content-Type': 'application/x-www-form-urlencoded',
3328
+ }),
3329
+ withCredentials: true,
3330
+ };
3331
+ }
3332
+ return {
3333
+ headers: new HttpHeaders({
3334
+ 'Content-Type': 'application/x-www-form-urlencoded',
3335
+ }),
3336
+ };
3337
+ }
3338
+ login(r) {
3339
+ const toApiJson = r.toApiJson;
3340
+ const request = typeof toApiJson !== 'undefined' ? r : new LoginRequest(r);
3341
+ return this.http
3342
+ .post(this._host + '/_ajax/v1/login', request.toApiJson(), this.apiOptions())
3343
+ .pipe(map((resp) => LoginResponse.fromProto(resp)), share());
3344
+ }
3345
+ logout() {
3346
+ return this.http
3347
+ .post(this._host + '/_ajax/v1/logout', {}, this.apiOptions(true))
3348
+ .pipe(map((resp) => LogoutResponse.fromProto(resp)), share());
3349
+ }
3350
+ ssoLogin(r) {
3351
+ const toApiJson = r.toApiJson;
3352
+ const request = typeof toApiJson !== 'undefined' ? r : new SSOLoginRequest(r);
3353
+ const params = new URLSearchParams();
3354
+ const apiJson = request.toApiJson();
3355
+ for (const key in apiJson) {
3356
+ if (!apiJson.hasOwnProperty(key)) {
3357
+ continue;
3358
+ }
3359
+ const value = apiJson[key];
3360
+ if (value === null) {
3361
+ continue;
3362
+ }
3363
+ params.append(key, value);
3364
+ }
3365
+ window.location.href = `${this._host}/sso-login?${params.toString()}`;
3366
+ }
3367
+ }
3368
+ IamHttpApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IamHttpApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
3369
+ IamHttpApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IamHttpApiService, providedIn: 'root' });
3370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IamHttpApiService, decorators: [{
3371
+ type: Injectable,
3372
+ args: [{ providedIn: 'root' }]
3373
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
3374
+
3375
+ var PersonaType;
3376
+ (function (PersonaType) {
3377
+ PersonaType["partner"] = "partner";
3378
+ PersonaType["partner_app"] = "partner_app";
3379
+ PersonaType["sales_person"] = "sales_person";
3380
+ PersonaType["smb"] = "smb";
3381
+ PersonaType["vendor"] = "vendor";
3382
+ PersonaType["digital_agent"] = "digital_agent";
3383
+ PersonaType["developer"] = "developer";
3384
+ PersonaType["success"] = "success";
3385
+ PersonaType["account_group"] = "account_group";
3386
+ })(PersonaType || (PersonaType = {}));
3387
+
3388
+ class BasePersona {
3389
+ fromPersona(p) {
3390
+ const s = p.subject;
3391
+ this.subjectId = s.subjectId;
3392
+ this.email = s.email;
3393
+ this.created = s.created;
3394
+ this.updated = s.updated;
3395
+ this.lastLogin = s.lastLogin;
3396
+ this.userId = s.userId;
3397
+ return this.readAttributes(s.structAttributes);
3398
+ }
3399
+ readAttributes(attributes) {
3400
+ if (!attributes) {
3401
+ return this;
3402
+ }
3403
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3404
+ const attrs = getValueFromAttribute({ structAttribute: { attributes: attributes.attributes } });
3405
+ Object.assign(this, attrs);
3406
+ return this;
3407
+ }
3408
+ }
3409
+ class TypedPersona extends BasePersona {
3410
+ }
3411
+ class NamespacedPersona extends BasePersona {
3412
+ constructor() {
3413
+ super(...arguments);
3414
+ this.partnerId = '';
3415
+ }
3416
+ fromPersona(p) {
3417
+ this.partnerId = p.context.namespaced.namespace;
3418
+ return super.fromPersona(p);
3419
+ }
3420
+ }
3421
+ function getValueFromAttribute(attr) {
3422
+ if (typeof attr === 'undefined') {
3423
+ return null;
3424
+ }
3425
+ else if (typeof attr.stringAttribute !== 'undefined') {
3426
+ return attr.stringAttribute;
3427
+ }
3428
+ else if (typeof attr.intAttribute !== 'undefined') {
3429
+ return attr.intAttribute;
3430
+ }
3431
+ else if (typeof attr.doubleAttribute !== 'undefined') {
3432
+ return attr.doubleAttribute;
3433
+ }
3434
+ else if (typeof attr.boolAttribute !== 'undefined') {
3435
+ return attr.boolAttribute;
3436
+ }
3437
+ else if (typeof attr.listAttribute !== 'undefined') {
3438
+ const vals = [];
3439
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
3440
+ if (typeof attr.listAttribute.attributes === 'undefined') {
3441
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
3442
+ return vals;
3443
+ }
3444
+ for (const val of attr.listAttribute.attributes) {
3445
+ vals.push(getValueFromAttribute(val));
3446
+ }
3447
+ return vals;
3448
+ }
3449
+ else if (typeof attr.timestampAttribute !== 'undefined') {
3450
+ return attr.timestampAttribute;
3451
+ }
3452
+ else if (typeof attr.geopointAttribute !== 'undefined') {
3453
+ return attr.geopointAttribute;
3454
+ }
3455
+ else if (typeof attr.structAttribute !== 'undefined') {
3456
+ const result = {};
3457
+ for (const a in attr.structAttribute.attributes) {
3458
+ if (!attr.structAttribute.attributes.hasOwnProperty(a)) {
3459
+ continue;
3460
+ }
3461
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3462
+ result[CamelCase(a)] = getValueFromAttribute(attr.structAttribute.attributes[a]);
3463
+ }
3464
+ return result;
3465
+ }
3466
+ }
3467
+ function CamelCase(str) {
3468
+ let result = '';
3469
+ for (let i = 0; i < str.length; i++) {
3470
+ if (str[i] === '_') {
3471
+ result += str[i + 1].toUpperCase();
3472
+ i++;
3473
+ }
3474
+ else {
3475
+ result += str[i];
3476
+ }
3477
+ }
3478
+ return result;
3479
+ }
3480
+
3481
+ class DeveloperPersona extends TypedPersona {
3482
+ constructor() {
3483
+ super(...arguments);
3484
+ this.type = PersonaType.developer;
3485
+ }
3486
+ }
3487
+
3488
+ class PartnerPersona extends TypedPersona {
3489
+ constructor() {
3490
+ super(...arguments);
3491
+ this.type = PersonaType.partner;
3492
+ this.isSuperAdmin = false;
3493
+ this.isAdmin = false;
3494
+ this.canCustomizeWhitelabel = false;
3495
+ this.canAccessBilling = false;
3496
+ this.canAccessAccounts = false;
3497
+ this.canAccessMarketing = false;
3498
+ this.canAccessSales = false;
3499
+ this.canAccessConcierge = false;
3500
+ this.canAccessBrands = false;
3501
+ this.canAccessDashboard = false;
3502
+ this.canAccessOrders = false;
3503
+ this.canAccessCompanyProfile = false;
3504
+ this.canAccessAutomations = false;
3505
+ this.canAccessMarketplace = false;
3506
+ this.canEnableApps = false;
3507
+ this.canAccessRetailBilling = false;
3508
+ }
3509
+ }
3510
+
3511
+ class PartnerAppPersona extends NamespacedPersona {
3512
+ constructor() {
3513
+ super(...arguments);
3514
+ this.type = PersonaType.partner_app;
3515
+ }
3516
+ }
3517
+
3518
+ const TitleChoice = {
3519
+ PARTNER_FOR_SMB: 'partnerForSmb',
3520
+ REP_MAN_FOR_SMB: 'repManForSmb',
3521
+ MARKET_FOR_SMB: 'marketForSmb'
3522
+ };
3523
+ class SalespersonPersona extends NamespacedPersona {
3524
+ constructor() {
3525
+ super(...arguments);
3526
+ this.type = PersonaType.sales_person;
3527
+ this.titleChoice = TitleChoice.PARTNER_FOR_SMB;
3528
+ }
3529
+ }
3530
+
3531
+ class SMBPersona extends NamespacedPersona {
3532
+ constructor() {
3533
+ super(...arguments);
3534
+ this.type = PersonaType.smb;
3535
+ this.notificationsEnabled = true;
3536
+ }
3537
+ }
3538
+
3539
+ class VendorPersona extends TypedPersona {
3540
+ constructor() {
3541
+ super(...arguments);
3542
+ this.type = PersonaType.vendor;
3543
+ }
3544
+ }
3545
+
3546
+ class DigitalAgentPersona extends TypedPersona {
3547
+ constructor() {
3548
+ super(...arguments);
3549
+ this.type = PersonaType.digital_agent;
3550
+ }
3551
+ }
3552
+
3553
+ class SuccessPersona extends TypedPersona {
3554
+ constructor() {
3555
+ super(...arguments);
3556
+ this.type = PersonaType.success;
3557
+ }
3558
+ }
3559
+
3560
+ class AccountGroupPersona extends TypedPersona {
3561
+ constructor() {
3562
+ super(...arguments);
3563
+ this.type = PersonaType.account_group;
3564
+ }
3565
+ }
3566
+
3567
+ function fromPersona(persona) {
3568
+ const type = getTypeFromContext(persona.context);
3569
+ if (type === null) {
3570
+ return null;
3571
+ }
3572
+ const personaCls = getPersonaFromType(type);
3573
+ personaCls.fromPersona(persona);
3574
+ return personaCls;
3575
+ }
3576
+ function getTypeFromContext(ctx) {
3577
+ const type = (!!ctx.namespaced) ? ctx.namespaced.type : ctx.typed.type;
3578
+ switch (type) {
3579
+ case 'partner':
3580
+ return PersonaType.partner;
3581
+ case 'partner_app':
3582
+ return PersonaType.partner_app;
3583
+ case 'sales_person':
3584
+ return PersonaType.sales_person;
3585
+ case 'smb':
3586
+ return PersonaType.smb;
3587
+ case 'vendor':
3588
+ return PersonaType.vendor;
3589
+ case 'digital_agent':
3590
+ return PersonaType.digital_agent;
3591
+ case 'developer':
3592
+ return PersonaType.developer;
3593
+ case 'success':
3594
+ return PersonaType.success;
3595
+ case 'account_group':
3596
+ return PersonaType.account_group;
3597
+ }
3598
+ return null;
3599
+ }
3600
+ function getPersonaFromType(personaType) {
3601
+ return new {
3602
+ 'partner': PartnerPersona,
3603
+ 'partner_app': PartnerAppPersona,
3604
+ 'sales_person': SalespersonPersona,
3605
+ 'smb': SMBPersona,
3606
+ 'vendor': VendorPersona,
3607
+ 'digital_agent': DigitalAgentPersona,
3608
+ 'developer': DeveloperPersona,
3609
+ 'success': SuccessPersona,
3610
+ 'account_group': AccountGroupPersona
3611
+ }[personaType]();
3612
+ }
3613
+
3614
+ // *********************************
3615
+ class IAMApiService {
3616
+ constructor(http, hostService) {
3617
+ this.http = http;
3618
+ this.hostService = hostService;
3619
+ this._host = this.hostService.hostWithScheme;
3620
+ }
3621
+ apiOptions() {
3622
+ return {
3623
+ headers: new HttpHeaders({
3624
+ 'Content-Type': 'application/json'
3625
+ }),
3626
+ withCredentials: true
3627
+ };
3628
+ }
3629
+ registerSubject(r) {
3630
+ const request = (r.toApiJson) ? r : new RegisterSubjectRequest(r);
3631
+ return this.http.post(this._host + "/iam.v1.IAM/RegisterSubject", request.toApiJson(), this.apiOptions())
3632
+ .pipe(map(resp => RegisterSubjectResponse.fromProto(resp)));
3633
+ }
3634
+ authenticateSubject(r) {
3635
+ const request = (r.toApiJson) ? r : new AuthenticateSubjectRequest(r);
3636
+ return this.http.post(this._host + "/iam.v1.IAM/AuthenticateSubject", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3637
+ }
3638
+ getSubjects(r) {
3639
+ const request = (r.toApiJson) ? r : new GetSubjectsRequest(r);
3640
+ return this.http.post(this._host + "/iam.v1.IAM/GetSubjects", request.toApiJson(), this.apiOptions())
3641
+ .pipe(map(resp => GetSubjectsResponse.fromProto(resp)));
3642
+ }
3643
+ getSubjectsByEmail(r) {
3644
+ const request = (r.toApiJson) ? r : new GetSubjectsByEmailRequest(r);
3645
+ return this.http.post(this._host + "/iam.v1.IAM/GetSubjectsByEmail", request.toApiJson(), this.apiOptions())
3646
+ .pipe(map(resp => GetSubjectsResponse.fromProto(resp)));
3647
+ }
3648
+ mutateAttributes(r) {
3649
+ const request = (r.toApiJson) ? r : new MutateAttributesRequest(r);
3650
+ return this.http.post(this._host + "/iam.v1.IAM/MutateAttributes", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3651
+ }
3652
+ resetSubjectPassword(r) {
3653
+ const request = (r.toApiJson) ? r : new ResetSubjectPasswordRequest(r);
3654
+ return this.http.post(this._host + "/iam.v1.IAM/ResetSubjectPassword", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3655
+ }
3656
+ changeSubjectEmail(r) {
3657
+ const request = (r.toApiJson) ? r : new ChangeSubjectEmailRequest(r);
3658
+ return this.http.post(this._host + "/iam.v1.IAM/ChangeSubjectEmail", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3659
+ }
3660
+ deleteSubject(r) {
3661
+ const request = (r.toApiJson) ? r : new DeleteSubjectRequest(r);
3662
+ return this.http.post(this._host + "/iam.v1.IAM/DeleteSubject", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3663
+ }
3664
+ searchSubject(r) {
3665
+ const request = (r.toApiJson) ? r : new SearchSubjectRequest(r);
3666
+ return this.http.post(this._host + "/iam.v1.IAM/SearchSubject", request.toApiJson(), this.apiOptions())
3667
+ .pipe(map(resp => SearchSubjectResponse.fromProto(resp)));
3668
+ }
3669
+ getSubjectContext(r) {
3670
+ const request = (r.toApiJson) ? r : new GetSubjectContextRequest(r);
3671
+ return this.http.post(this._host + "/iam.v1.IAM/GetSubjectContext", request.toApiJson(), this.apiOptions())
3672
+ .pipe(map(resp => GetSubjectContextResponse.fromProto(resp)));
3673
+ }
3674
+ registerResourceOwner(r) {
3675
+ const request = (r.toApiJson) ? r : new RegisterResourceOwnerRequest(r);
3676
+ return this.http.post(this._host + "/iam.v1.IAM/RegisterResourceOwner", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3677
+ }
3678
+ registerResource(r) {
3679
+ const request = (r.toApiJson) ? r : new RegisterResourceRequest(r);
3680
+ return this.http.post(this._host + "/iam.v1.IAM/RegisterResource", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3681
+ }
3682
+ registerPolicy(r) {
3683
+ const request = (r.toApiJson) ? r : new RegisterPolicyRequest(r);
3684
+ return this.http.post(this._host + "/iam.v1.IAM/RegisterPolicy", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3685
+ }
3686
+ accessResource(r) {
3687
+ const request = (r.toApiJson) ? r : new AccessResourceRequest(r);
3688
+ return this.http.post(this._host + "/iam.v1.IAM/AccessResource", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3689
+ }
3690
+ getShortLivedToken(r) {
3691
+ const request = (r.toApiJson) ? r : new GetShortLivedTokenRequest(r);
3692
+ return this.http.post(this._host + "/iam.v1.IAM/GetShortLivedToken", request.toApiJson(), this.apiOptions())
3693
+ .pipe(map(resp => GetTokenResponse.fromProto(resp)));
3694
+ }
3695
+ getSessionToken(r) {
3696
+ const request = (r.toApiJson) ? r : new GetSessionTokenRequest(r);
3697
+ return this.http.post(this._host + "/iam.v1.IAM/GetSessionToken", request.toApiJson(), this.apiOptions())
3698
+ .pipe(map(resp => GetTokenResponse.fromProto(resp)));
3699
+ }
3700
+ addKey(r) {
3701
+ const request = (r.toApiJson) ? r : new AddKeyRequest(r);
3702
+ return this.http.post(this._host + "/iam.v1.IAM/AddKey", request.toApiJson(), this.apiOptions())
3703
+ .pipe(map(resp => AddKeyResponse.fromProto(resp)));
3704
+ }
3705
+ removeKey(r) {
3706
+ const request = (r.toApiJson) ? r : new RemoveKeyRequest(r);
3707
+ return this.http.post(this._host + "/iam.v1.IAM/RemoveKey", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3708
+ }
3709
+ createSession(r) {
3710
+ const request = (r.toApiJson) ? r : new CreateSessionRequest(r);
3711
+ return this.http.post(this._host + "/iam.v1.IAM/CreateSession", request.toApiJson(), this.apiOptions())
3712
+ .pipe(map(resp => CreateSessionResponse.fromProto(resp)));
3713
+ }
3714
+ getResetPasswordToken(r) {
3715
+ const request = (r.toApiJson) ? r : new GetResetPasswordTokenRequest(r);
3716
+ return this.http.post(this._host + "/iam.v1.IAM/GetResetPasswordToken", request.toApiJson(), this.apiOptions())
3717
+ .pipe(map(resp => ResetPasswordTokenResponse.fromProto(resp)));
3718
+ }
3719
+ listPersonasByEmail(r) {
3720
+ const request = (r.toApiJson) ? r : new ListPersonasByEmailRequest(r);
3721
+ return this.http.post(this._host + "/iam.v1.IAM/ListPersonasByEmail", request.toApiJson(), this.apiOptions())
3722
+ .pipe(map(resp => ListPersonasResponse.fromProto(resp)));
3723
+ }
3724
+ listPersonas(r) {
3725
+ const request = (r.toApiJson) ? r : new IAMListPersonasRequest(r);
3726
+ return this.http.post(this._host + "/iam.v1.IAM/ListPersonas", request.toApiJson(), this.apiOptions())
3727
+ .pipe(map(resp => ListPersonasResponse.fromProto(resp)));
3728
+ }
3729
+ createTemporarySubject(r) {
3730
+ const request = (r.toApiJson) ? r : new CreateTemporarySubjectRequest(r);
3731
+ return this.http.post(this._host + "/iam.v1.IAM/CreateTemporarySubject", request.toApiJson(), this.apiOptions())
3732
+ .pipe(map(resp => CreateTemporarySubjectResponse.fromProto(resp)));
3733
+ }
3734
+ getMultiUsers(r) {
3735
+ const request = (r.toApiJson) ? r : new GetMultiUsersRequest(r);
3736
+ return this.http.post(this._host + "/iam.v1.IAM/GetMultiUsers", request.toApiJson(), this.apiOptions())
3737
+ .pipe(map(resp => GetMultiUsersResponse.fromProto(resp)));
3738
+ }
3739
+ listUsers(r) {
3740
+ const request = (r.toApiJson) ? r : new ListUsersRequest(r);
3741
+ return this.http.post(this._host + "/iam.v1.IAM/ListUsers", request.toApiJson(), this.apiOptions())
3742
+ .pipe(map(resp => ListUsersResponse.fromProto(resp)));
3743
+ }
3744
+ updateUser(r) {
3745
+ const request = (r.toApiJson) ? r : new UpdateUserRequest(r);
3746
+ return this.http.post(this._host + "/iam.v1.IAM/UpdateUser", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3747
+ }
3748
+ deleteUser(r) {
3749
+ const request = (r.toApiJson) ? r : new DeleteUserRequest(r);
3750
+ return this.http.post(this._host + "/iam.v1.IAM/DeleteUser", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3751
+ }
3752
+ listSecurityLogs(r) {
3753
+ const request = (r.toApiJson) ? r : new ListSecurityLogsRequest(r);
3754
+ return this.http.post(this._host + "/iam.v1.IAM/ListSecurityLogs", request.toApiJson(), this.apiOptions())
3755
+ .pipe(map(resp => ListSecurityLogsResponse.fromProto(resp)));
3756
+ }
3757
+ verifyEmail(r) {
3758
+ const request = (r.toApiJson) ? r : new VerifyEmailRequest(r);
3759
+ return this.http.post(this._host + "/iam.v1.IAM/VerifyEmail", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3760
+ }
3761
+ sendEmailVerification(r) {
3762
+ const request = (r.toApiJson) ? r : new SendEmailVerificationRequest(r);
3763
+ return this.http.post(this._host + "/iam.v1.IAM/SendEmailVerification", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3764
+ }
3765
+ getMultiExternalId(r) {
3766
+ const request = (r.toApiJson) ? r : new GetMultiExternalIDRequest(r);
3767
+ return this.http.post(this._host + "/iam.v1.IAM/GetMultiExternalID", request.toApiJson(), this.apiOptions())
3768
+ .pipe(map(resp => GetMultiExternalIDResponse.fromProto(resp)));
3769
+ }
3770
+ createExternalId(r) {
3771
+ const request = (r.toApiJson) ? r : new CreateExternalIDRequest(r);
3772
+ return this.http.post(this._host + "/iam.v1.IAM/CreateExternalID", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3773
+ }
3774
+ addMultiUserRestriction(r) {
3775
+ const request = (r.toApiJson) ? r : new AddMultiUserRestrictionRequest(r);
3776
+ return this.http.post(this._host + "/iam.v1.IAM/AddMultiUserRestriction", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3777
+ }
3778
+ removeMultiUserRestriction(r) {
3779
+ const request = (r.toApiJson) ? r : new RemoveMultiUserRestrictionRequest(r);
3780
+ return this.http.post(this._host + "/iam.v1.IAM/RemoveMultiUserRestriction", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3781
+ }
3782
+ }
3783
+ IAMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IAMApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
3784
+ IAMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IAMApiService, providedIn: 'root' });
3785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IAMApiService, decorators: [{
3786
+ type: Injectable,
3787
+ args: [{ providedIn: 'root' }]
3788
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
3789
+
3790
+ class IAMService {
3791
+ constructor(api, httpApi, sessionService, iamApi) {
3792
+ this.api = api;
3793
+ this.httpApi = httpApi;
3794
+ this.sessionService = sessionService;
3795
+ this.iamApi = iamApi;
3796
+ }
3797
+ // Get a subject from the session ID
3798
+ getSubjectBySession(sessionId, personaType, partnerId) {
3799
+ let context;
3800
+ if (!!partnerId) {
3801
+ context = new Context({
3802
+ namespaced: new NamespacedContext({
3803
+ namespace: partnerId,
3804
+ type: PersonaType[personaType]
3805
+ })
3806
+ });
3807
+ }
3808
+ else {
3809
+ context = new Context({ typed: new TypedContext({ type: PersonaType[personaType] }) });
3810
+ }
3811
+ return this.api
3812
+ .getSubjectBySession({
3813
+ session: sessionId,
3814
+ context: context
3815
+ })
3816
+ .pipe(map((r) => fromPersona(new Persona({ subject: r.subject.subject, context: context }))));
3817
+ }
3818
+ // Get persona type from the current session
3819
+ getLoggedInSubject(personaType, partnerId) {
3820
+ return this.sessionService
3821
+ .getSessionId()
3822
+ .pipe(switchMap((sessionId) => this.getSubjectBySession(sessionId, personaType, partnerId)));
3823
+ }
3824
+ // List all available personas for the session. Optionally pass a persona type to filter by that persona.
3825
+ listPersonas(sessionId, personaType) {
3826
+ return this.api
3827
+ .listPersonas({
3828
+ session: sessionId,
3829
+ pageSize: 100,
3830
+ type: personaType
3831
+ })
3832
+ .pipe(map((r) => {
3833
+ const personas = [];
3834
+ if (!r || !r.personas) {
3835
+ return [];
3836
+ }
3837
+ for (const p of r.personas) {
3838
+ const persona = fromPersona(p);
3839
+ if (!!persona) {
3840
+ personas.push(persona);
3841
+ }
3842
+ }
3843
+ return personas;
3844
+ }));
3845
+ }
3846
+ // List all available personas for the current session. Optionally pass a persona type to filter by that persona.
3847
+ listLoggedInPersonas(personaType) {
3848
+ return this.sessionService.getSessionId().pipe(switchMap((sessionId) => this.listPersonas(sessionId, personaType)));
3849
+ }
3850
+ // Get a short lived session token
3851
+ getToken() {
3852
+ return this.api.getToken({}).pipe(map((r) => r.token));
3853
+ }
3854
+ // Login into a user. Optionally specify the partner and persona type you want to log into
3855
+ login(email, password, personaType, partnerId) {
3856
+ return this.httpApi
3857
+ .login({
3858
+ email: email,
3859
+ password: password,
3860
+ namespace: partnerId,
3861
+ type: personaType
3862
+ })
3863
+ .pipe(map((r) => r.sessionId || ''));
3864
+ }
3865
+ // Logout of the current session, returns true if successful
3866
+ logout() {
3867
+ return this.httpApi.logout().pipe(map((r) => r.success));
3868
+ }
3869
+ // This will redirect the browser to IAM's sso login handler.
3870
+ ssoLogin(nextUrl, personaType, partnerId) {
3871
+ this.httpApi.ssoLogin({
3872
+ nextUrl: nextUrl,
3873
+ namespace: partnerId,
3874
+ type: personaType
3875
+ });
3876
+ }
3877
+ // getMultiUsers takes an array of user identifiers and calls IAM to convert them into Users
3878
+ getMultiUsers(userIdentifiers) {
3879
+ return this.iamApi.getMultiUsers({
3880
+ userIdentifiers
3881
+ }).pipe(map(resp => {
3882
+ if (!!resp.users) {
3883
+ return resp.users;
3884
+ }
3885
+ return [];
3886
+ }), map(userContainers => userContainers.map(u => u.user)));
3887
+ }
3888
+ // listSecurityLogs returns security logs for a userId passed in. This is a paged function, but the
3889
+ // handling of paged information is left to the implementor (for now).
3890
+ listSecurityLogs(userId, cursor, pageSize, actionId = '') {
3891
+ const optionalArgs = {};
3892
+ if (actionId !== '') {
3893
+ optionalArgs.filters = new ListSecurityLogsRequestFilters({ actionId });
3894
+ }
3895
+ return this.iamApi.listSecurityLogs({
3896
+ userId,
3897
+ cursor,
3898
+ pageSize,
3899
+ ...optionalArgs
3900
+ });
3901
+ }
3902
+ // listUsers returns users for a namespace passed in. This is a paged function, but the
3903
+ // handling of paged information is left to the implementor (for now).
3904
+ // An empty namespace will return users that exist outside of a namespace.
3905
+ listUsers(namespace, email, cursor, pageSize, subjectTypes, searchTerms, sortOptions) {
3906
+ const userFilter = {};
3907
+ if (!!subjectTypes && subjectTypes.length > 0) {
3908
+ userFilter.subjectTypes = subjectTypes;
3909
+ }
3910
+ if (!!searchTerms && searchTerms.length > 0) {
3911
+ userFilter.searchTerms = searchTerms;
3912
+ }
3913
+ return this.iamApi.listUsers({
3914
+ namespace: namespace,
3915
+ email: email,
3916
+ cursor: cursor,
3917
+ pageSize: pageSize,
3918
+ userFilter: userFilter,
3919
+ sortOptions: (sortOptions || [])
3920
+ });
3921
+ }
3922
+ }
3923
+ IAMService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IAMService, deps: [{ token: UserIAMApiService }, { token: IamHttpApiService }, { token: i3.SessionService }, { token: IAMApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3924
+ IAMService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IAMService, providedIn: 'root' });
3925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IAMService, decorators: [{
3926
+ type: Injectable,
3927
+ args: [{ providedIn: 'root' }]
3928
+ }], ctorParameters: function () { return [{ type: UserIAMApiService }, { type: IamHttpApiService }, { type: i3.SessionService }, { type: IAMApiService }]; } });
3929
+
3930
+ // *********************************
3931
+
3932
+ /**
3933
+ * Generated bundle index. Do not edit.
3934
+ */
3935
+
3936
+ export { Access, AccessCheckFailures, AccessResourceRequest, AccessResourceRequestResourceEntityIdentifierEntry, AccessScope, AddKeyRequest, AddKeyResponse, AddMultiUserRestrictionRequest, AlgorithmType, Attribute, AuthenticateSubjectRequest, BasePersona, BooleanOperator, ChangeSubjectEmailRequest, Context, CreateExternalIDRequest, CreateSessionRequest, CreateSessionResponse, CreateTemporarySubjectRequest, CreateTemporarySubjectResponse, DeleteSubjectRequest, DeleteUserRequest, DeveloperPersona, DigitalAgentPersona, FieldMask, ForOperator, GeoPointAttribute, GetImpersonationTokenRequest, GetImpersonationTokenResponse, GetMultiExternalIDRequest, GetMultiExternalIDResponse, GetMultiUsersRequest, GetMultiUsersResponse, GetMultiUsersResponseUserContainer, GetResetPasswordTokenRequest, GetSessionTokenRequest, GetShortLivedTokenRequest, GetSubjectBySessionRequest, GetSubjectContextRequest, GetSubjectContextResponse, GetSubjectResponse, GetSubjectsByEmailRequest, GetSubjectsRequest, GetSubjectsResponse, GetTokenRequest, GetTokenResponse, HostService, IAMApiService, IAMListPersonasRequest, IAMService, Identifier, IfClause, ListAttribute, ListPersonasByEmailRequest, ListPersonasRequest, ListPersonasResponse, ListSecurityLogsRequest, ListSecurityLogsRequestFilters, ListSecurityLogsResponse, ListUsersRequest, ListUsersResponse, MultiValueAttribute, MutateAttributesRequest, Mutation, NamespacedContext, NamespacedEmail, NamespacedPersona, NamespacedSession, OAuthCredentials, Operator, OrderByDirection, PartnerAppPersona, PartnerPersona, Persona, PersonaType, Policy, PolicyNode, PublicKey, Query, RegisterPolicyRequest, RegisterResourceOwnerRequest, RegisterResourceRequest, RegisterSubjectRequest, RegisterSubjectResponse, RemoveKeyRequest, RemoveMultiUserRestrictionRequest, ResetPasswordTokenResponse, ResetPasswordWithTokenRequest, ResetSubjectPasswordRequest, ResourceIdentifier, ResourceIdentifierIdentifiersEntry, ResourceOwner, RestrictionType, SMBPersona, SalespersonPersona, SearchSubjectRequest, SearchSubjectResponse, SecurityLog, SendEmailVerificationRequest, SingleValueAttribute, SortDirection, StructAttribute, StructAttributeAttributesEntry, Subject, SubjectCredentials, SubjectMissingValueClause, SubjectResourceForClause, SubjectResourceIntersectionClause, SubjectResourceSubsetClause, SubjectResult, SubjectValueIntersectionClause, TypedContext, TypedExternalIdentifier, TypedPersona, UpdateUserRequest, UpdateUserRequestOperation, User, UserFilter, UserIAMApiService, UserIdentifier, UserSortField, UserSortOptions, ValueList, VendorPersona, VerifyEmailRequest, fromPersona };
3937
+ //# sourceMappingURL=vendasta-iam.mjs.map