@vendasta/iam 1.17.2 → 2.2.2

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 (99) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +113 -0
  3. package/bundles/vendasta-iam.umd.js +828 -1400
  4. package/bundles/vendasta-iam.umd.js.map +1 -1
  5. package/bundles/vendasta-iam.umd.min.js +2 -2
  6. package/bundles/vendasta-iam.umd.min.js.map +1 -1
  7. package/esm2015/lib/_generated/host.service.js +9 -7
  8. package/esm2015/lib/_generated/index.js +2 -0
  9. package/esm2015/lib/_internal/enums/api.enum.js +1 -1
  10. package/esm2015/lib/_internal/enums/index.js +3 -2
  11. package/esm2015/lib/_internal/enums/policies.enum.js +18 -0
  12. package/esm2015/lib/_internal/enums/resources.enum.js +1 -12
  13. package/esm2015/lib/_internal/enums/subjects.enum.js +1 -1
  14. package/esm2015/lib/_internal/enums/users.enum.js +1 -1
  15. package/esm2015/lib/_internal/iam.api.service.js +10 -8
  16. package/esm2015/lib/_internal/index.js +4 -5
  17. package/esm2015/lib/_internal/interfaces/annotations.interface.js +8 -0
  18. package/esm2015/lib/_internal/interfaces/api.interface.js +1 -1
  19. package/esm2015/lib/_internal/interfaces/attributes.interface.js +8 -0
  20. package/esm2015/lib/_internal/interfaces/field-mask.interface.js +1 -1
  21. package/esm2015/lib/_internal/interfaces/index.js +1 -1
  22. package/esm2015/lib/_internal/interfaces/policies.interface.js +3 -0
  23. package/esm2015/lib/_internal/interfaces/resources.interface.js +1 -1
  24. package/esm2015/lib/_internal/interfaces/security-logs.interface.js +1 -1
  25. package/esm2015/lib/_internal/interfaces/subjects.interface.js +1 -7
  26. package/esm2015/lib/_internal/interfaces/users.interface.js +1 -1
  27. package/esm2015/lib/_internal/objects/annotations.js +30 -0
  28. package/esm2015/lib/_internal/objects/api.js +15 -381
  29. package/esm2015/lib/_internal/objects/attributes.js +158 -0
  30. package/esm2015/lib/_internal/objects/field-mask.js +1 -4
  31. package/esm2015/lib/_internal/objects/index.js +7 -4
  32. package/esm2015/lib/_internal/objects/policies.js +264 -0
  33. package/esm2015/lib/_internal/objects/resources.js +6 -321
  34. package/esm2015/lib/_internal/objects/security-logs.js +1 -8
  35. package/esm2015/lib/_internal/objects/subjects.js +3 -233
  36. package/esm2015/lib/_internal/objects/users.js +1 -32
  37. package/esm2015/lib/_internal/user-iam.api.service.js +10 -8
  38. package/esm2015/lib/http/http.interface.js +1 -1
  39. package/esm2015/lib/http/http.js +1 -1
  40. package/esm2015/lib/http/iam.http.api.service.js +22 -21
  41. package/esm2015/lib/iam.service.js +12 -10
  42. package/esm2015/lib/index.js +3 -4
  43. package/esm2015/lib/personas/account-group.js +1 -1
  44. package/esm2015/lib/personas/base-personas.js +1 -1
  45. package/esm2015/lib/personas/developer.js +1 -1
  46. package/esm2015/lib/personas/digital-agent.js +1 -1
  47. package/esm2015/lib/personas/index.js +1 -1
  48. package/esm2015/lib/personas/partner-app.js +1 -1
  49. package/esm2015/lib/personas/partner.js +14 -13
  50. package/esm2015/lib/personas/persona-type.enum.js +1 -1
  51. package/esm2015/lib/personas/personas.js +1 -1
  52. package/esm2015/lib/personas/salesperson.js +1 -1
  53. package/esm2015/lib/personas/smb.js +1 -1
  54. package/esm2015/lib/personas/success.js +1 -1
  55. package/esm2015/lib/personas/vendor.js +1 -1
  56. package/esm2015/public_api.js +2 -2
  57. package/esm2015/vendasta-iam.js +1 -6
  58. package/fesm2015/vendasta-iam.js +415 -976
  59. package/fesm2015/vendasta-iam.js.map +1 -1
  60. package/lib/_generated/host.service.d.ts +3 -0
  61. package/lib/_generated/index.d.ts +1 -0
  62. package/lib/_internal/enums/index.d.ts +2 -1
  63. package/lib/_internal/enums/policies.enum.d.ts +9 -0
  64. package/lib/_internal/enums/resources.enum.d.ts +0 -9
  65. package/lib/_internal/iam.api.service.d.ts +3 -0
  66. package/lib/_internal/index.d.ts +3 -4
  67. package/lib/_internal/interfaces/annotations.interface.d.ts +4 -0
  68. package/lib/_internal/interfaces/api.interface.d.ts +6 -18
  69. package/lib/_internal/interfaces/attributes.interface.d.ts +26 -0
  70. package/lib/_internal/interfaces/index.d.ts +6 -3
  71. package/lib/_internal/interfaces/policies.interface.d.ts +42 -0
  72. package/lib/_internal/interfaces/resources.interface.d.ts +3 -42
  73. package/lib/_internal/interfaces/subjects.interface.d.ts +2 -27
  74. package/lib/_internal/objects/annotations.d.ts +9 -0
  75. package/lib/_internal/objects/api.d.ts +7 -25
  76. package/lib/_internal/objects/attributes.d.ts +43 -0
  77. package/lib/_internal/objects/field-mask.d.ts +1 -1
  78. package/lib/_internal/objects/index.d.ts +6 -3
  79. package/lib/_internal/objects/policies.d.ts +68 -0
  80. package/lib/_internal/objects/resources.d.ts +4 -67
  81. package/lib/_internal/objects/security-logs.d.ts +1 -1
  82. package/lib/_internal/objects/subjects.d.ts +3 -43
  83. package/lib/_internal/objects/users.d.ts +1 -1
  84. package/lib/_internal/user-iam.api.service.d.ts +3 -0
  85. package/lib/http/iam.http.api.service.d.ts +3 -0
  86. package/lib/iam.service.d.ts +3 -0
  87. package/lib/index.d.ts +2 -3
  88. package/lib/personas/base-personas.d.ts +1 -1
  89. package/lib/personas/partner.d.ts +1 -0
  90. package/package.json +5 -3
  91. package/public_api.d.ts +1 -1
  92. package/vendasta-iam.d.ts +1 -5
  93. package/esm2015/lib/_internal/iam-sso.api.service.js +0 -38
  94. package/esm2015/lib/_internal/iam.module.js +0 -29
  95. package/esm2015/lib/iam.module.js +0 -16
  96. package/lib/_internal/iam-sso.api.service.d.ts +0 -12
  97. package/lib/_internal/iam.module.d.ts +0 -2
  98. package/lib/iam.module.d.ts +0 -2
  99. package/vendasta-iam.metadata.json +0 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@vendasta/core'), require('rxjs/operators'), require('@angular/common/http')) :
3
- typeof define === 'function' && define.amd ? define('@vendasta/iam', ['exports', '@angular/core', '@vendasta/core', 'rxjs/operators', '@angular/common/http'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.vendasta = global.vendasta || {}, global.vendasta.iam = {}), global.ng.core, global.core, global.rxjs.operators, global.ng.common.http));
5
- }(this, (function (exports, core$1, core, operators, http) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/operators'), require('@angular/common/http'), require('@vendasta/core')) :
3
+ typeof define === 'function' && define.amd ? define('@vendasta/iam', ['exports', '@angular/core', 'rxjs/operators', '@angular/common/http', '@vendasta/core'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.vendasta = global.vendasta || {}, global.vendasta.iam = {}), global.ng.core, global.rxjs.operators, global.ng.common.http, global.i1));
5
+ }(this, (function (exports, i0, operators, i1$1, i1) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -305,57 +305,6 @@
305
305
  return value;
306
306
  }
307
307
 
308
- // *********************************
309
- (function (AlgorithmType) {
310
- AlgorithmType[AlgorithmType["ALGORITHM_TYPE_ES256"] = 0] = "ALGORITHM_TYPE_ES256";
311
- AlgorithmType[AlgorithmType["ALGORITHM_TYPE_RS256"] = 1] = "ALGORITHM_TYPE_RS256";
312
- })(exports.AlgorithmType || (exports.AlgorithmType = {}));
313
- (function (OrderByDirection) {
314
- OrderByDirection[OrderByDirection["ASCENDING"] = 0] = "ASCENDING";
315
- OrderByDirection[OrderByDirection["DESCENDING"] = 1] = "DESCENDING";
316
- })(exports.OrderByDirection || (exports.OrderByDirection = {}));
317
-
318
- // *********************************
319
- (function (AccessScope) {
320
- AccessScope[AccessScope["READ"] = 0] = "READ";
321
- AccessScope[AccessScope["WRITE"] = 1] = "WRITE";
322
- AccessScope[AccessScope["DELETE"] = 2] = "DELETE";
323
- AccessScope[AccessScope["LIST"] = 3] = "LIST";
324
- })(exports.AccessScope || (exports.AccessScope = {}));
325
- (function (BooleanOperator) {
326
- BooleanOperator[BooleanOperator["AND"] = 0] = "AND";
327
- BooleanOperator[BooleanOperator["OR"] = 1] = "OR";
328
- BooleanOperator[BooleanOperator["NOT"] = 2] = "NOT";
329
- })(exports.BooleanOperator || (exports.BooleanOperator = {}));
330
- (function (ForOperator) {
331
- ForOperator[ForOperator["ANY"] = 0] = "ANY";
332
- ForOperator[ForOperator["ALL"] = 1] = "ALL";
333
- })(exports.ForOperator || (exports.ForOperator = {}));
334
-
335
- // *********************************
336
- (function (RestrictionType) {
337
- RestrictionType[RestrictionType["RESTRICTION_TYPE_UNSET"] = 0] = "RESTRICTION_TYPE_UNSET";
338
- RestrictionType[RestrictionType["RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN"] = 1] = "RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN";
339
- RestrictionType[RestrictionType["RESTRICTION_TYPE_FROZEN"] = 2] = "RESTRICTION_TYPE_FROZEN";
340
- })(exports.RestrictionType || (exports.RestrictionType = {}));
341
-
342
- // *********************************
343
- (function (SortDirection) {
344
- SortDirection[SortDirection["SORT_DIRECTION_INVALID"] = 0] = "SORT_DIRECTION_INVALID";
345
- SortDirection[SortDirection["SORT_DIRECTION_ASCENDING"] = 1] = "SORT_DIRECTION_ASCENDING";
346
- SortDirection[SortDirection["SORT_DIRECTION_DESCENDING"] = 2] = "SORT_DIRECTION_DESCENDING";
347
- })(exports.SortDirection || (exports.SortDirection = {}));
348
- (function (UserSortField) {
349
- UserSortField[UserSortField["USER_SORT_FIELD_INVALID"] = 0] = "USER_SORT_FIELD_INVALID";
350
- UserSortField[UserSortField["USER_SORT_FIELD_CREATED"] = 1] = "USER_SORT_FIELD_CREATED";
351
- UserSortField[UserSortField["USER_SORT_FIELD_FIRST_NAME"] = 2] = "USER_SORT_FIELD_FIRST_NAME";
352
- UserSortField[UserSortField["USER_SORT_FIELD_LAST_NAME"] = 3] = "USER_SORT_FIELD_LAST_NAME";
353
- UserSortField[UserSortField["USER_SORT_FIELD_EMAIL"] = 4] = "USER_SORT_FIELD_EMAIL";
354
- UserSortField[UserSortField["USER_SORT_FIELD_LAST_LOGIN"] = 5] = "USER_SORT_FIELD_LAST_LOGIN";
355
- })(exports.UserSortField || (exports.UserSortField = {}));
356
-
357
- // *********************************
358
-
359
308
  function enumStringToValue(enumRef, value) {
360
309
  if (typeof value === 'number') {
361
310
  return value;
@@ -390,16 +339,6 @@
390
339
  return m;
391
340
  };
392
341
  Attribute.prototype.toApiJson = function () {
393
- if (typeof this.intAttribute === 'undefined' &&
394
- typeof this.doubleAttribute === 'undefined' &&
395
- typeof this.stringAttribute === 'undefined' &&
396
- typeof this.boolAttribute === 'undefined' &&
397
- typeof this.structAttribute === 'undefined' &&
398
- typeof this.listAttribute === 'undefined' &&
399
- typeof this.timestampAttribute === 'undefined' &&
400
- typeof this.geopointAttribute === 'undefined') {
401
- return {};
402
- }
403
342
  var toReturn = {};
404
343
  if (typeof this.intAttribute !== 'undefined') {
405
344
  toReturn['intAttribute'] = this.intAttribute;
@@ -445,10 +384,6 @@
445
384
  return m;
446
385
  };
447
386
  StructAttributeAttributesEntry.prototype.toApiJson = function () {
448
- if (typeof this.key === 'undefined' &&
449
- typeof this.value === 'undefined') {
450
- return {};
451
- }
452
387
  var toReturn = {};
453
388
  if (typeof this.key !== 'undefined') {
454
389
  toReturn['key'] = this.key;
@@ -460,40 +395,6 @@
460
395
  };
461
396
  return StructAttributeAttributesEntry;
462
397
  }());
463
- var Context = /** @class */ (function () {
464
- function Context(kwargs) {
465
- if (!kwargs) {
466
- return;
467
- }
468
- Object.assign(this, kwargs);
469
- }
470
- Context.fromProto = function (proto) {
471
- var m = new Context();
472
- m = Object.assign(m, proto);
473
- if (proto.namespaced) {
474
- m.namespaced = NamespacedContext.fromProto(proto.namespaced);
475
- }
476
- if (proto.typed) {
477
- m.typed = TypedContext.fromProto(proto.typed);
478
- }
479
- return m;
480
- };
481
- Context.prototype.toApiJson = function () {
482
- if (typeof this.namespaced === 'undefined' &&
483
- typeof this.typed === 'undefined') {
484
- return {};
485
- }
486
- var toReturn = {};
487
- if (typeof this.namespaced !== 'undefined' && this.namespaced !== null) {
488
- toReturn['namespaced'] = 'toApiJson' in this.namespaced ? this.namespaced.toApiJson() : this.namespaced;
489
- }
490
- if (typeof this.typed !== 'undefined' && this.typed !== null) {
491
- toReturn['typed'] = 'toApiJson' in this.typed ? this.typed.toApiJson() : this.typed;
492
- }
493
- return toReturn;
494
- };
495
- return Context;
496
- }());
497
398
  var GeoPointAttribute = /** @class */ (function () {
498
399
  function GeoPointAttribute(kwargs) {
499
400
  if (!kwargs) {
@@ -507,10 +408,6 @@
507
408
  return m;
508
409
  };
509
410
  GeoPointAttribute.prototype.toApiJson = function () {
510
- if (typeof this.latitude === 'undefined' &&
511
- typeof this.longitude === 'undefined') {
512
- return {};
513
- }
514
411
  var toReturn = {};
515
412
  if (typeof this.latitude !== 'undefined') {
516
413
  toReturn['latitude'] = this.latitude;
@@ -538,9 +435,6 @@
538
435
  return m;
539
436
  };
540
437
  ListAttribute.prototype.toApiJson = function () {
541
- if (typeof this.attributes === 'undefined') {
542
- return {};
543
- }
544
438
  var toReturn = {};
545
439
  if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
546
440
  toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
@@ -549,6 +443,120 @@
549
443
  };
550
444
  return ListAttribute;
551
445
  }());
446
+ var StructAttribute = /** @class */ (function () {
447
+ function StructAttribute(kwargs) {
448
+ if (!kwargs) {
449
+ return;
450
+ }
451
+ Object.assign(this, kwargs);
452
+ }
453
+ StructAttribute.fromProto = function (proto) {
454
+ var m = new StructAttribute();
455
+ m = Object.assign(m, proto);
456
+ if (proto.attributes) {
457
+ m.attributes = Object.keys(proto.attributes).reduce(function (obj, k) { obj[k] = Attribute.fromProto(proto.attributes[k]); return obj; }, {});
458
+ }
459
+ return m;
460
+ };
461
+ StructAttribute.prototype.toApiJson = function () {
462
+ var toReturn = {};
463
+ if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
464
+ toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
465
+ }
466
+ return toReturn;
467
+ };
468
+ return StructAttribute;
469
+ }());
470
+
471
+ // *********************************
472
+ (function (BooleanOperator) {
473
+ BooleanOperator[BooleanOperator["AND"] = 0] = "AND";
474
+ BooleanOperator[BooleanOperator["OR"] = 1] = "OR";
475
+ BooleanOperator[BooleanOperator["NOT"] = 2] = "NOT";
476
+ })(exports.BooleanOperator || (exports.BooleanOperator = {}));
477
+ (function (ForOperator) {
478
+ ForOperator[ForOperator["ANY"] = 0] = "ANY";
479
+ ForOperator[ForOperator["ALL"] = 1] = "ALL";
480
+ })(exports.ForOperator || (exports.ForOperator = {}));
481
+
482
+ // *********************************
483
+ (function (AccessScope) {
484
+ AccessScope[AccessScope["READ"] = 0] = "READ";
485
+ AccessScope[AccessScope["WRITE"] = 1] = "WRITE";
486
+ AccessScope[AccessScope["DELETE"] = 2] = "DELETE";
487
+ AccessScope[AccessScope["LIST"] = 3] = "LIST";
488
+ })(exports.AccessScope || (exports.AccessScope = {}));
489
+
490
+ // *********************************
491
+ (function (AlgorithmType) {
492
+ AlgorithmType[AlgorithmType["ALGORITHM_TYPE_ES256"] = 0] = "ALGORITHM_TYPE_ES256";
493
+ AlgorithmType[AlgorithmType["ALGORITHM_TYPE_RS256"] = 1] = "ALGORITHM_TYPE_RS256";
494
+ })(exports.AlgorithmType || (exports.AlgorithmType = {}));
495
+ (function (OrderByDirection) {
496
+ OrderByDirection[OrderByDirection["ASCENDING"] = 0] = "ASCENDING";
497
+ OrderByDirection[OrderByDirection["DESCENDING"] = 1] = "DESCENDING";
498
+ })(exports.OrderByDirection || (exports.OrderByDirection = {}));
499
+
500
+ // *********************************
501
+ (function (RestrictionType) {
502
+ RestrictionType[RestrictionType["RESTRICTION_TYPE_UNSET"] = 0] = "RESTRICTION_TYPE_UNSET";
503
+ RestrictionType[RestrictionType["RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN"] = 1] = "RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN";
504
+ RestrictionType[RestrictionType["RESTRICTION_TYPE_FROZEN"] = 2] = "RESTRICTION_TYPE_FROZEN";
505
+ })(exports.RestrictionType || (exports.RestrictionType = {}));
506
+
507
+ // *********************************
508
+ (function (SortDirection) {
509
+ SortDirection[SortDirection["SORT_DIRECTION_INVALID"] = 0] = "SORT_DIRECTION_INVALID";
510
+ SortDirection[SortDirection["SORT_DIRECTION_ASCENDING"] = 1] = "SORT_DIRECTION_ASCENDING";
511
+ SortDirection[SortDirection["SORT_DIRECTION_DESCENDING"] = 2] = "SORT_DIRECTION_DESCENDING";
512
+ })(exports.SortDirection || (exports.SortDirection = {}));
513
+ (function (UserSortField) {
514
+ UserSortField[UserSortField["USER_SORT_FIELD_INVALID"] = 0] = "USER_SORT_FIELD_INVALID";
515
+ UserSortField[UserSortField["USER_SORT_FIELD_CREATED"] = 1] = "USER_SORT_FIELD_CREATED";
516
+ UserSortField[UserSortField["USER_SORT_FIELD_FIRST_NAME"] = 2] = "USER_SORT_FIELD_FIRST_NAME";
517
+ UserSortField[UserSortField["USER_SORT_FIELD_LAST_NAME"] = 3] = "USER_SORT_FIELD_LAST_NAME";
518
+ UserSortField[UserSortField["USER_SORT_FIELD_EMAIL"] = 4] = "USER_SORT_FIELD_EMAIL";
519
+ UserSortField[UserSortField["USER_SORT_FIELD_LAST_LOGIN"] = 5] = "USER_SORT_FIELD_LAST_LOGIN";
520
+ })(exports.UserSortField || (exports.UserSortField = {}));
521
+
522
+ // *********************************
523
+
524
+ function enumStringToValue$1(enumRef, value) {
525
+ if (typeof value === 'number') {
526
+ return value;
527
+ }
528
+ return enumRef[value];
529
+ }
530
+ var Context = /** @class */ (function () {
531
+ function Context(kwargs) {
532
+ if (!kwargs) {
533
+ return;
534
+ }
535
+ Object.assign(this, kwargs);
536
+ }
537
+ Context.fromProto = function (proto) {
538
+ var m = new Context();
539
+ m = Object.assign(m, proto);
540
+ if (proto.namespaced) {
541
+ m.namespaced = NamespacedContext.fromProto(proto.namespaced);
542
+ }
543
+ if (proto.typed) {
544
+ m.typed = TypedContext.fromProto(proto.typed);
545
+ }
546
+ return m;
547
+ };
548
+ Context.prototype.toApiJson = function () {
549
+ var toReturn = {};
550
+ if (typeof this.namespaced !== 'undefined' && this.namespaced !== null) {
551
+ toReturn['namespaced'] = 'toApiJson' in this.namespaced ? this.namespaced.toApiJson() : this.namespaced;
552
+ }
553
+ if (typeof this.typed !== 'undefined' && this.typed !== null) {
554
+ toReturn['typed'] = 'toApiJson' in this.typed ? this.typed.toApiJson() : this.typed;
555
+ }
556
+ return toReturn;
557
+ };
558
+ return Context;
559
+ }());
552
560
  var MultiValueAttribute = /** @class */ (function () {
553
561
  function MultiValueAttribute(kwargs) {
554
562
  if (!kwargs) {
@@ -562,10 +570,6 @@
562
570
  return m;
563
571
  };
564
572
  MultiValueAttribute.prototype.toApiJson = function () {
565
- if (typeof this.key === 'undefined' &&
566
- typeof this.values === 'undefined') {
567
- return {};
568
- }
569
573
  var toReturn = {};
570
574
  if (typeof this.key !== 'undefined') {
571
575
  toReturn['key'] = this.key;
@@ -608,15 +612,6 @@
608
612
  return m;
609
613
  };
610
614
  Mutation.prototype.toApiJson = function () {
611
- if (typeof this.add === 'undefined' &&
612
- typeof this.replace === 'undefined' &&
613
- typeof this.remove === 'undefined' &&
614
- typeof this.dropKey === 'undefined' &&
615
- typeof this.replaceAttributes === 'undefined' &&
616
- typeof this.addAttributes === 'undefined' &&
617
- typeof this.removeAttributes === 'undefined') {
618
- return {};
619
- }
620
615
  var toReturn = {};
621
616
  if (typeof this.add !== 'undefined' && this.add !== null) {
622
617
  toReturn['add'] = 'toApiJson' in this.add ? this.add.toApiJson() : this.add;
@@ -656,10 +651,6 @@
656
651
  return m;
657
652
  };
658
653
  NamespacedContext.prototype.toApiJson = function () {
659
- if (typeof this.namespace === 'undefined' &&
660
- typeof this.type === 'undefined') {
661
- return {};
662
- }
663
654
  var toReturn = {};
664
655
  if (typeof this.namespace !== 'undefined') {
665
656
  toReturn['namespace'] = this.namespace;
@@ -690,10 +681,6 @@
690
681
  return m;
691
682
  };
692
683
  Persona.prototype.toApiJson = function () {
693
- if (typeof this.subject === 'undefined' &&
694
- typeof this.context === 'undefined') {
695
- return {};
696
- }
697
684
  var toReturn = {};
698
685
  if (typeof this.subject !== 'undefined' && this.subject !== null) {
699
686
  toReturn['subject'] = 'toApiJson' in this.subject ? this.subject.toApiJson() : this.subject;
@@ -716,16 +703,11 @@
716
703
  var m = new PublicKey();
717
704
  m = Object.assign(m, proto);
718
705
  if (proto.algorithmType) {
719
- m.algorithmType = enumStringToValue(exports.AlgorithmType, proto.algorithmType);
706
+ m.algorithmType = enumStringToValue$1(exports.AlgorithmType, proto.algorithmType);
720
707
  }
721
708
  return m;
722
709
  };
723
710
  PublicKey.prototype.toApiJson = function () {
724
- if (typeof this.key === 'undefined' &&
725
- typeof this.id === 'undefined' &&
726
- typeof this.algorithmType === 'undefined') {
727
- return {};
728
- }
729
711
  var toReturn = {};
730
712
  if (typeof this.key !== 'undefined') {
731
713
  toReturn['key'] = this.key;
@@ -753,10 +735,6 @@
753
735
  return m;
754
736
  };
755
737
  Query.prototype.toApiJson = function () {
756
- if (typeof this.searchTerm === 'undefined' &&
757
- typeof this.attributeKeys === 'undefined') {
758
- return {};
759
- }
760
738
  var toReturn = {};
761
739
  if (typeof this.searchTerm !== 'undefined') {
762
740
  toReturn['searchTerm'] = this.searchTerm;
@@ -781,10 +759,6 @@
781
759
  return m;
782
760
  };
783
761
  SingleValueAttribute.prototype.toApiJson = function () {
784
- if (typeof this.key === 'undefined' &&
785
- typeof this.value === 'undefined') {
786
- return {};
787
- }
788
762
  var toReturn = {};
789
763
  if (typeof this.key !== 'undefined') {
790
764
  toReturn['key'] = this.key;
@@ -796,33 +770,6 @@
796
770
  };
797
771
  return SingleValueAttribute;
798
772
  }());
799
- var StructAttribute = /** @class */ (function () {
800
- function StructAttribute(kwargs) {
801
- if (!kwargs) {
802
- return;
803
- }
804
- Object.assign(this, kwargs);
805
- }
806
- StructAttribute.fromProto = function (proto) {
807
- var m = new StructAttribute();
808
- m = Object.assign(m, proto);
809
- if (proto.attributes) {
810
- m.attributes = Object.keys(proto.attributes).reduce(function (obj, k) { obj[k] = Attribute.fromProto(proto.attributes[k]); return obj; }, {});
811
- }
812
- return m;
813
- };
814
- StructAttribute.prototype.toApiJson = function () {
815
- if (typeof this.attributes === 'undefined') {
816
- return {};
817
- }
818
- var toReturn = {};
819
- if (typeof this.attributes !== 'undefined' && this.attributes !== null) {
820
- toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;
821
- }
822
- return toReturn;
823
- };
824
- return StructAttribute;
825
- }());
826
773
  var Subject = /** @class */ (function () {
827
774
  function Subject(kwargs) {
828
775
  if (!kwargs) {
@@ -854,18 +801,6 @@
854
801
  return m;
855
802
  };
856
803
  Subject.prototype.toApiJson = function () {
857
- if (typeof this.subjectId === 'undefined' &&
858
- typeof this.email === 'undefined' &&
859
- typeof this.userId === 'undefined' &&
860
- typeof this.partnerId === 'undefined' &&
861
- typeof this.attributes === 'undefined' &&
862
- typeof this.created === 'undefined' &&
863
- typeof this.updated === 'undefined' &&
864
- typeof this.lastLogin === 'undefined' &&
865
- typeof this.publicKeys === 'undefined' &&
866
- typeof this.structAttributes === 'undefined') {
867
- return {};
868
- }
869
804
  var toReturn = {};
870
805
  if (typeof this.subjectId !== 'undefined') {
871
806
  toReturn['subjectId'] = this.subjectId;
@@ -917,9 +852,6 @@
917
852
  return m;
918
853
  };
919
854
  SubjectResult.prototype.toApiJson = function () {
920
- if (typeof this.subject === 'undefined') {
921
- return {};
922
- }
923
855
  var toReturn = {};
924
856
  if (typeof this.subject !== 'undefined' && this.subject !== null) {
925
857
  toReturn['subject'] = 'toApiJson' in this.subject ? this.subject.toApiJson() : this.subject;
@@ -941,9 +873,6 @@
941
873
  return m;
942
874
  };
943
875
  TypedContext.prototype.toApiJson = function () {
944
- if (typeof this.type === 'undefined') {
945
- return {};
946
- }
947
876
  var toReturn = {};
948
877
  if (typeof this.type !== 'undefined') {
949
878
  toReturn['type'] = this.type;
@@ -953,7 +882,7 @@
953
882
  return TypedContext;
954
883
  }());
955
884
 
956
- function enumStringToValue$1(enumRef, value) {
885
+ function enumStringToValue$2(enumRef, value) {
957
886
  if (typeof value === 'number') {
958
887
  return value;
959
888
  }
@@ -972,9 +901,6 @@
972
901
  return m;
973
902
  };
974
903
  FieldMask.prototype.toApiJson = function () {
975
- if (typeof this.paths === 'undefined') {
976
- return {};
977
- }
978
904
  var toReturn = {};
979
905
  if (typeof this.paths !== 'undefined') {
980
906
  toReturn['paths'] = this.paths;
@@ -984,70 +910,13 @@
984
910
  return FieldMask;
985
911
  }());
986
912
 
987
- function enumStringToValue$2(enumRef, value) {
913
+ // NOTE: THIS HAS BEEN MANUALLY EDITED. PLEASE SEE THE BELOW COMMENTS TO SEE WHERE IT HAS BEEN EDITED
914
+ function enumStringToValue$3(enumRef, value) {
988
915
  if (typeof value === 'number') {
989
916
  return value;
990
917
  }
991
918
  return enumRef[value];
992
919
  }
993
- var AccessCheckFailures = /** @class */ (function () {
994
- function AccessCheckFailures(kwargs) {
995
- if (!kwargs) {
996
- return;
997
- }
998
- Object.assign(this, kwargs);
999
- }
1000
- AccessCheckFailures.fromProto = function (proto) {
1001
- var m = new AccessCheckFailures();
1002
- m = Object.assign(m, proto);
1003
- if (proto.failures) {
1004
- m.failures = proto.failures.map(ResourceIdentifier.fromProto);
1005
- }
1006
- return m;
1007
- };
1008
- AccessCheckFailures.prototype.toApiJson = function () {
1009
- if (typeof this.failures === 'undefined') {
1010
- return {};
1011
- }
1012
- var toReturn = {};
1013
- if (typeof this.failures !== 'undefined' && this.failures !== null) {
1014
- toReturn['failures'] = 'toApiJson' in this.failures ? this.failures.toApiJson() : this.failures;
1015
- }
1016
- return toReturn;
1017
- };
1018
- return AccessCheckFailures;
1019
- }());
1020
- var ResourceIdentifierIdentifiersEntry = /** @class */ (function () {
1021
- function ResourceIdentifierIdentifiersEntry(kwargs) {
1022
- if (!kwargs) {
1023
- return;
1024
- }
1025
- Object.assign(this, kwargs);
1026
- }
1027
- ResourceIdentifierIdentifiersEntry.fromProto = function (proto) {
1028
- var m = new ResourceIdentifierIdentifiersEntry();
1029
- m = Object.assign(m, proto);
1030
- if (proto.value) {
1031
- m.value = ValueList.fromProto(proto.value);
1032
- }
1033
- return m;
1034
- };
1035
- ResourceIdentifierIdentifiersEntry.prototype.toApiJson = function () {
1036
- if (typeof this.key === 'undefined' &&
1037
- typeof this.value === 'undefined') {
1038
- return {};
1039
- }
1040
- var toReturn = {};
1041
- if (typeof this.key !== 'undefined') {
1042
- toReturn['key'] = this.key;
1043
- }
1044
- if (typeof this.value !== 'undefined' && this.value !== null) {
1045
- toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;
1046
- }
1047
- return toReturn;
1048
- };
1049
- return ResourceIdentifierIdentifiersEntry;
1050
- }());
1051
920
  var IfClause = /** @class */ (function () {
1052
921
  function IfClause(kwargs) {
1053
922
  if (!kwargs) {
@@ -1070,12 +939,6 @@
1070
939
  return m;
1071
940
  };
1072
941
  IfClause.prototype.toApiJson = function () {
1073
- if (typeof this.resourceAttributeName === 'undefined' &&
1074
- typeof this.resourceAttributeValue === 'undefined' &&
1075
- typeof this.thenPolicy === 'undefined' &&
1076
- typeof this.elsePolicy === 'undefined') {
1077
- return {};
1078
- }
1079
942
  var toReturn = {};
1080
943
  if (typeof this.resourceAttributeName !== 'undefined') {
1081
944
  toReturn['resourceAttributeName'] = this.resourceAttributeName;
@@ -1103,8 +966,9 @@
1103
966
  Operator.fromProto = function (proto) {
1104
967
  var m = new Operator();
1105
968
  m = Object.assign(m, proto);
969
+ // Edited from e.policiesBooleanOperator to e.BooleanOperator
1106
970
  if (proto.operator) {
1107
- m.operator = enumStringToValue$2(exports.BooleanOperator, proto.operator);
971
+ m.operator = enumStringToValue$3(exports.BooleanOperator, proto.operator);
1108
972
  }
1109
973
  if (proto.children) {
1110
974
  m.children = proto.children.map(PolicyNode.fromProto);
@@ -1112,10 +976,6 @@
1112
976
  return m;
1113
977
  };
1114
978
  Operator.prototype.toApiJson = function () {
1115
- if (typeof this.operator === 'undefined' &&
1116
- typeof this.children === 'undefined') {
1117
- return {};
1118
- }
1119
979
  var toReturn = {};
1120
980
  if (typeof this.operator !== 'undefined') {
1121
981
  toReturn['operator'] = this.operator;
@@ -1127,56 +987,6 @@
1127
987
  };
1128
988
  return Operator;
1129
989
  }());
1130
- var Policy = /** @class */ (function () {
1131
- function Policy(kwargs) {
1132
- if (!kwargs) {
1133
- return;
1134
- }
1135
- Object.assign(this, kwargs);
1136
- }
1137
- Policy.fromProto = function (proto) {
1138
- var m = new Policy();
1139
- m = Object.assign(m, proto);
1140
- if (proto.operations) {
1141
- m.operations = proto.operations.map(function (v) { return enumStringToValue$2(exports.AccessScope, v); });
1142
- }
1143
- if (proto.policy) {
1144
- m.policy = PolicyNode.fromProto(proto.policy);
1145
- }
1146
- return m;
1147
- };
1148
- Policy.prototype.toApiJson = function () {
1149
- if (typeof this.appId === 'undefined' &&
1150
- typeof this.resourceId === 'undefined' &&
1151
- typeof this.policyId === 'undefined' &&
1152
- typeof this.policyName === 'undefined' &&
1153
- typeof this.operations === 'undefined' &&
1154
- typeof this.policy === 'undefined') {
1155
- return {};
1156
- }
1157
- var toReturn = {};
1158
- if (typeof this.appId !== 'undefined') {
1159
- toReturn['appId'] = this.appId;
1160
- }
1161
- if (typeof this.resourceId !== 'undefined') {
1162
- toReturn['resourceId'] = this.resourceId;
1163
- }
1164
- if (typeof this.policyId !== 'undefined') {
1165
- toReturn['policyId'] = this.policyId;
1166
- }
1167
- if (typeof this.policyName !== 'undefined') {
1168
- toReturn['policyName'] = this.policyName;
1169
- }
1170
- if (typeof this.operations !== 'undefined') {
1171
- toReturn['operations'] = this.operations;
1172
- }
1173
- if (typeof this.policy !== 'undefined' && this.policy !== null) {
1174
- toReturn['policy'] = 'toApiJson' in this.policy ? this.policy.toApiJson() : this.policy;
1175
- }
1176
- return toReturn;
1177
- };
1178
- return Policy;
1179
- }());
1180
990
  var PolicyNode = /** @class */ (function () {
1181
991
  function PolicyNode(kwargs) {
1182
992
  if (!kwargs) {
@@ -1211,15 +1021,6 @@
1211
1021
  return m;
1212
1022
  };
1213
1023
  PolicyNode.prototype.toApiJson = function () {
1214
- if (typeof this.subjectResourceIntersection === 'undefined' &&
1215
- typeof this.operator === 'undefined' &&
1216
- typeof this.subjectValueIntersection === 'undefined' &&
1217
- typeof this.subjectMissingValue === 'undefined' &&
1218
- typeof this.subjectResourceSubset === 'undefined' &&
1219
- typeof this.subjectResourceFor === 'undefined' &&
1220
- typeof this.ifClause === 'undefined') {
1221
- return {};
1222
- }
1223
1024
  var toReturn = {};
1224
1025
  if (typeof this.subjectResourceIntersection !== 'undefined' && this.subjectResourceIntersection !== null) {
1225
1026
  toReturn['subjectResourceIntersection'] = 'toApiJson' in this.subjectResourceIntersection ? this.subjectResourceIntersection.toApiJson() : this.subjectResourceIntersection;
@@ -1246,61 +1047,6 @@
1246
1047
  };
1247
1048
  return PolicyNode;
1248
1049
  }());
1249
- var ResourceIdentifier = /** @class */ (function () {
1250
- function ResourceIdentifier(kwargs) {
1251
- if (!kwargs) {
1252
- return;
1253
- }
1254
- Object.assign(this, kwargs);
1255
- }
1256
- ResourceIdentifier.fromProto = function (proto) {
1257
- var m = new ResourceIdentifier();
1258
- m = Object.assign(m, proto);
1259
- if (proto.identifiers) {
1260
- m.identifiers = Object.keys(proto.identifiers).reduce(function (obj, k) { obj[k] = ValueList.fromProto(proto.identifiers[k]); return obj; }, {});
1261
- }
1262
- return m;
1263
- };
1264
- ResourceIdentifier.prototype.toApiJson = function () {
1265
- if (typeof this.identifiers === 'undefined') {
1266
- return {};
1267
- }
1268
- var toReturn = {};
1269
- if (typeof this.identifiers !== 'undefined' && this.identifiers !== null) {
1270
- toReturn['identifiers'] = 'toApiJson' in this.identifiers ? this.identifiers.toApiJson() : this.identifiers;
1271
- }
1272
- return toReturn;
1273
- };
1274
- return ResourceIdentifier;
1275
- }());
1276
- var ResourceOwner = /** @class */ (function () {
1277
- function ResourceOwner(kwargs) {
1278
- if (!kwargs) {
1279
- return;
1280
- }
1281
- Object.assign(this, kwargs);
1282
- }
1283
- ResourceOwner.fromProto = function (proto) {
1284
- var m = new ResourceOwner();
1285
- m = Object.assign(m, proto);
1286
- return m;
1287
- };
1288
- ResourceOwner.prototype.toApiJson = function () {
1289
- if (typeof this.appId === 'undefined' &&
1290
- typeof this.appName === 'undefined') {
1291
- return {};
1292
- }
1293
- var toReturn = {};
1294
- if (typeof this.appId !== 'undefined') {
1295
- toReturn['appId'] = this.appId;
1296
- }
1297
- if (typeof this.appName !== 'undefined') {
1298
- toReturn['appName'] = this.appName;
1299
- }
1300
- return toReturn;
1301
- };
1302
- return ResourceOwner;
1303
- }());
1304
1050
  var SubjectMissingValueClause = /** @class */ (function () {
1305
1051
  function SubjectMissingValueClause(kwargs) {
1306
1052
  if (!kwargs) {
@@ -1314,9 +1060,6 @@
1314
1060
  return m;
1315
1061
  };
1316
1062
  SubjectMissingValueClause.prototype.toApiJson = function () {
1317
- if (typeof this.attributeName === 'undefined') {
1318
- return {};
1319
- }
1320
1063
  var toReturn = {};
1321
1064
  if (typeof this.attributeName !== 'undefined') {
1322
1065
  toReturn['attributeName'] = this.attributeName;
@@ -1336,7 +1079,7 @@
1336
1079
  var m = new SubjectResourceForClause();
1337
1080
  m = Object.assign(m, proto);
1338
1081
  if (proto.operator) {
1339
- m.operator = enumStringToValue$2(exports.ForOperator, proto.operator);
1082
+ m.operator = enumStringToValue$3(exports.ForOperator, proto.operator);
1340
1083
  }
1341
1084
  if (proto.rules) {
1342
1085
  m.rules = PolicyNode.fromProto(proto.rules);
@@ -1344,11 +1087,6 @@
1344
1087
  return m;
1345
1088
  };
1346
1089
  SubjectResourceForClause.prototype.toApiJson = function () {
1347
- if (typeof this.attributeName === 'undefined' &&
1348
- typeof this.operator === 'undefined' &&
1349
- typeof this.rules === 'undefined') {
1350
- return {};
1351
- }
1352
1090
  var toReturn = {};
1353
1091
  if (typeof this.attributeName !== 'undefined') {
1354
1092
  toReturn['attributeName'] = this.attributeName;
@@ -1376,10 +1114,6 @@
1376
1114
  return m;
1377
1115
  };
1378
1116
  SubjectResourceIntersectionClause.prototype.toApiJson = function () {
1379
- if (typeof this.attributeName === 'undefined' &&
1380
- typeof this.resourceAttributeName === 'undefined') {
1381
- return {};
1382
- }
1383
1117
  var toReturn = {};
1384
1118
  if (typeof this.attributeName !== 'undefined') {
1385
1119
  toReturn['attributeName'] = this.attributeName;
@@ -1404,10 +1138,6 @@
1404
1138
  return m;
1405
1139
  };
1406
1140
  SubjectResourceSubsetClause.prototype.toApiJson = function () {
1407
- if (typeof this.attributeName === 'undefined' &&
1408
- typeof this.resourceAttributeName === 'undefined') {
1409
- return {};
1410
- }
1411
1141
  var toReturn = {};
1412
1142
  if (typeof this.attributeName !== 'undefined') {
1413
1143
  toReturn['attributeName'] = this.attributeName;
@@ -1435,11 +1165,6 @@
1435
1165
  return m;
1436
1166
  };
1437
1167
  SubjectValueIntersectionClause.prototype.toApiJson = function () {
1438
- if (typeof this.attributeName === 'undefined' &&
1439
- typeof this.attributeValue === 'undefined' &&
1440
- typeof this.structuredAttributeValue === 'undefined') {
1441
- return {};
1442
- }
1443
1168
  var toReturn = {};
1444
1169
  if (typeof this.attributeName !== 'undefined') {
1445
1170
  toReturn['attributeName'] = this.attributeName;
@@ -1454,104 +1179,241 @@
1454
1179
  };
1455
1180
  return SubjectValueIntersectionClause;
1456
1181
  }());
1457
- var ValueList = /** @class */ (function () {
1458
- function ValueList(kwargs) {
1182
+
1183
+ function enumStringToValue$4(enumRef, value) {
1184
+ if (typeof value === 'number') {
1185
+ return value;
1186
+ }
1187
+ return enumRef[value];
1188
+ }
1189
+ var AccessCheckFailures = /** @class */ (function () {
1190
+ function AccessCheckFailures(kwargs) {
1459
1191
  if (!kwargs) {
1460
1192
  return;
1461
1193
  }
1462
1194
  Object.assign(this, kwargs);
1463
1195
  }
1464
- ValueList.fromProto = function (proto) {
1465
- var m = new ValueList();
1196
+ AccessCheckFailures.fromProto = function (proto) {
1197
+ var m = new AccessCheckFailures();
1466
1198
  m = Object.assign(m, proto);
1199
+ if (proto.failures) {
1200
+ m.failures = proto.failures.map(ResourceIdentifier.fromProto);
1201
+ }
1467
1202
  return m;
1468
1203
  };
1469
- ValueList.prototype.toApiJson = function () {
1470
- if (typeof this.values === 'undefined') {
1471
- return {};
1472
- }
1204
+ AccessCheckFailures.prototype.toApiJson = function () {
1473
1205
  var toReturn = {};
1474
- if (typeof this.values !== 'undefined') {
1475
- toReturn['values'] = this.values;
1206
+ if (typeof this.failures !== 'undefined' && this.failures !== null) {
1207
+ toReturn['failures'] = 'toApiJson' in this.failures ? this.failures.toApiJson() : this.failures;
1476
1208
  }
1477
1209
  return toReturn;
1478
1210
  };
1479
- return ValueList;
1211
+ return AccessCheckFailures;
1480
1212
  }());
1481
-
1482
- function enumStringToValue$3(enumRef, value) {
1483
- if (typeof value === 'number') {
1484
- return value;
1485
- }
1486
- return enumRef[value];
1487
- }
1488
- var SecurityLog = /** @class */ (function () {
1489
- function SecurityLog(kwargs) {
1213
+ var ResourceIdentifierIdentifiersEntry = /** @class */ (function () {
1214
+ function ResourceIdentifierIdentifiersEntry(kwargs) {
1490
1215
  if (!kwargs) {
1491
1216
  return;
1492
1217
  }
1493
1218
  Object.assign(this, kwargs);
1494
1219
  }
1495
- SecurityLog.fromProto = function (proto) {
1496
- var m = new SecurityLog();
1220
+ ResourceIdentifierIdentifiersEntry.fromProto = function (proto) {
1221
+ var m = new ResourceIdentifierIdentifiersEntry();
1497
1222
  m = Object.assign(m, proto);
1498
- if (proto.created) {
1499
- m.created = new Date(proto.created);
1223
+ if (proto.value) {
1224
+ m.value = ValueList.fromProto(proto.value);
1500
1225
  }
1501
1226
  return m;
1502
1227
  };
1503
- SecurityLog.prototype.toApiJson = function () {
1504
- if (typeof this.userId === 'undefined' &&
1505
- typeof this.actionId === 'undefined' &&
1506
- typeof this.logId === 'undefined' &&
1507
- typeof this.description === 'undefined' &&
1508
- typeof this.created === 'undefined') {
1509
- return {};
1510
- }
1228
+ ResourceIdentifierIdentifiersEntry.prototype.toApiJson = function () {
1511
1229
  var toReturn = {};
1512
- if (typeof this.userId !== 'undefined') {
1513
- toReturn['userId'] = this.userId;
1514
- }
1515
- if (typeof this.actionId !== 'undefined') {
1516
- toReturn['actionId'] = this.actionId;
1517
- }
1518
- if (typeof this.logId !== 'undefined') {
1519
- toReturn['logId'] = this.logId;
1520
- }
1521
- if (typeof this.description !== 'undefined') {
1522
- toReturn['description'] = this.description;
1230
+ if (typeof this.key !== 'undefined') {
1231
+ toReturn['key'] = this.key;
1523
1232
  }
1524
- if (typeof this.created !== 'undefined' && this.created !== null) {
1525
- toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
1233
+ if (typeof this.value !== 'undefined' && this.value !== null) {
1234
+ toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;
1526
1235
  }
1527
1236
  return toReturn;
1528
1237
  };
1529
- return SecurityLog;
1238
+ return ResourceIdentifierIdentifiersEntry;
1530
1239
  }());
1531
-
1532
- function enumStringToValue$4(enumRef, value) {
1533
- if (typeof value === 'number') {
1534
- return value;
1535
- }
1536
- return enumRef[value];
1537
- }
1538
- var Identifier = /** @class */ (function () {
1539
- function Identifier(kwargs) {
1240
+ var Policy = /** @class */ (function () {
1241
+ function Policy(kwargs) {
1540
1242
  if (!kwargs) {
1541
1243
  return;
1542
1244
  }
1543
1245
  Object.assign(this, kwargs);
1544
1246
  }
1545
- Identifier.fromProto = function (proto) {
1546
- var m = new Identifier();
1247
+ Policy.fromProto = function (proto) {
1248
+ var m = new Policy();
1547
1249
  m = Object.assign(m, proto);
1548
- return m;
1250
+ if (proto.operations) {
1251
+ m.operations = proto.operations.map(function (v) { return enumStringToValue$4(exports.AccessScope, v); });
1252
+ }
1253
+ if (proto.policy) {
1254
+ m.policy = PolicyNode.fromProto(proto.policy);
1255
+ }
1256
+ return m;
1549
1257
  };
1550
- Identifier.prototype.toApiJson = function () {
1551
- if (typeof this.subjectId === 'undefined' &&
1552
- typeof this.userId === 'undefined') {
1553
- return {};
1258
+ Policy.prototype.toApiJson = function () {
1259
+ var toReturn = {};
1260
+ if (typeof this.appId !== 'undefined') {
1261
+ toReturn['appId'] = this.appId;
1262
+ }
1263
+ if (typeof this.resourceId !== 'undefined') {
1264
+ toReturn['resourceId'] = this.resourceId;
1265
+ }
1266
+ if (typeof this.policyId !== 'undefined') {
1267
+ toReturn['policyId'] = this.policyId;
1268
+ }
1269
+ if (typeof this.policyName !== 'undefined') {
1270
+ toReturn['policyName'] = this.policyName;
1271
+ }
1272
+ if (typeof this.operations !== 'undefined') {
1273
+ toReturn['operations'] = this.operations;
1274
+ }
1275
+ if (typeof this.actions !== 'undefined') {
1276
+ toReturn['actions'] = this.actions;
1277
+ }
1278
+ if (typeof this.policy !== 'undefined' && this.policy !== null) {
1279
+ toReturn['policy'] = 'toApiJson' in this.policy ? this.policy.toApiJson() : this.policy;
1280
+ }
1281
+ return toReturn;
1282
+ };
1283
+ return Policy;
1284
+ }());
1285
+ var ResourceIdentifier = /** @class */ (function () {
1286
+ function ResourceIdentifier(kwargs) {
1287
+ if (!kwargs) {
1288
+ return;
1289
+ }
1290
+ Object.assign(this, kwargs);
1291
+ }
1292
+ ResourceIdentifier.fromProto = function (proto) {
1293
+ var m = new ResourceIdentifier();
1294
+ m = Object.assign(m, proto);
1295
+ if (proto.identifiers) {
1296
+ m.identifiers = Object.keys(proto.identifiers).reduce(function (obj, k) { obj[k] = ValueList.fromProto(proto.identifiers[k]); return obj; }, {});
1297
+ }
1298
+ return m;
1299
+ };
1300
+ ResourceIdentifier.prototype.toApiJson = function () {
1301
+ var toReturn = {};
1302
+ if (typeof this.identifiers !== 'undefined' && this.identifiers !== null) {
1303
+ toReturn['identifiers'] = 'toApiJson' in this.identifiers ? this.identifiers.toApiJson() : this.identifiers;
1304
+ }
1305
+ return toReturn;
1306
+ };
1307
+ return ResourceIdentifier;
1308
+ }());
1309
+ var ResourceOwner = /** @class */ (function () {
1310
+ function ResourceOwner(kwargs) {
1311
+ if (!kwargs) {
1312
+ return;
1313
+ }
1314
+ Object.assign(this, kwargs);
1315
+ }
1316
+ ResourceOwner.fromProto = function (proto) {
1317
+ var m = new ResourceOwner();
1318
+ m = Object.assign(m, proto);
1319
+ return m;
1320
+ };
1321
+ ResourceOwner.prototype.toApiJson = function () {
1322
+ var toReturn = {};
1323
+ if (typeof this.appId !== 'undefined') {
1324
+ toReturn['appId'] = this.appId;
1325
+ }
1326
+ if (typeof this.appName !== 'undefined') {
1327
+ toReturn['appName'] = this.appName;
1328
+ }
1329
+ return toReturn;
1330
+ };
1331
+ return ResourceOwner;
1332
+ }());
1333
+ var ValueList = /** @class */ (function () {
1334
+ function ValueList(kwargs) {
1335
+ if (!kwargs) {
1336
+ return;
1337
+ }
1338
+ Object.assign(this, kwargs);
1339
+ }
1340
+ ValueList.fromProto = function (proto) {
1341
+ var m = new ValueList();
1342
+ m = Object.assign(m, proto);
1343
+ return m;
1344
+ };
1345
+ ValueList.prototype.toApiJson = function () {
1346
+ var toReturn = {};
1347
+ if (typeof this.values !== 'undefined') {
1348
+ toReturn['values'] = this.values;
1349
+ }
1350
+ return toReturn;
1351
+ };
1352
+ return ValueList;
1353
+ }());
1354
+
1355
+ function enumStringToValue$5(enumRef, value) {
1356
+ if (typeof value === 'number') {
1357
+ return value;
1358
+ }
1359
+ return enumRef[value];
1360
+ }
1361
+ var SecurityLog = /** @class */ (function () {
1362
+ function SecurityLog(kwargs) {
1363
+ if (!kwargs) {
1364
+ return;
1365
+ }
1366
+ Object.assign(this, kwargs);
1367
+ }
1368
+ SecurityLog.fromProto = function (proto) {
1369
+ var m = new SecurityLog();
1370
+ m = Object.assign(m, proto);
1371
+ if (proto.created) {
1372
+ m.created = new Date(proto.created);
1373
+ }
1374
+ return m;
1375
+ };
1376
+ SecurityLog.prototype.toApiJson = function () {
1377
+ var toReturn = {};
1378
+ if (typeof this.userId !== 'undefined') {
1379
+ toReturn['userId'] = this.userId;
1554
1380
  }
1381
+ if (typeof this.actionId !== 'undefined') {
1382
+ toReturn['actionId'] = this.actionId;
1383
+ }
1384
+ if (typeof this.logId !== 'undefined') {
1385
+ toReturn['logId'] = this.logId;
1386
+ }
1387
+ if (typeof this.description !== 'undefined') {
1388
+ toReturn['description'] = this.description;
1389
+ }
1390
+ if (typeof this.created !== 'undefined' && this.created !== null) {
1391
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
1392
+ }
1393
+ return toReturn;
1394
+ };
1395
+ return SecurityLog;
1396
+ }());
1397
+
1398
+ function enumStringToValue$6(enumRef, value) {
1399
+ if (typeof value === 'number') {
1400
+ return value;
1401
+ }
1402
+ return enumRef[value];
1403
+ }
1404
+ var Identifier = /** @class */ (function () {
1405
+ function Identifier(kwargs) {
1406
+ if (!kwargs) {
1407
+ return;
1408
+ }
1409
+ Object.assign(this, kwargs);
1410
+ }
1411
+ Identifier.fromProto = function (proto) {
1412
+ var m = new Identifier();
1413
+ m = Object.assign(m, proto);
1414
+ return m;
1415
+ };
1416
+ Identifier.prototype.toApiJson = function () {
1555
1417
  var toReturn = {};
1556
1418
  if (typeof this.subjectId !== 'undefined') {
1557
1419
  toReturn['subjectId'] = this.subjectId;
@@ -1576,10 +1438,6 @@
1576
1438
  return m;
1577
1439
  };
1578
1440
  NamespacedEmail.prototype.toApiJson = function () {
1579
- if (typeof this.namespace === 'undefined' &&
1580
- typeof this.email === 'undefined') {
1581
- return {};
1582
- }
1583
1441
  var toReturn = {};
1584
1442
  if (typeof this.namespace !== 'undefined') {
1585
1443
  toReturn['namespace'] = this.namespace;
@@ -1604,10 +1462,6 @@
1604
1462
  return m;
1605
1463
  };
1606
1464
  NamespacedSession.prototype.toApiJson = function () {
1607
- if (typeof this.namespace === 'undefined' &&
1608
- typeof this.session === 'undefined') {
1609
- return {};
1610
- }
1611
1465
  var toReturn = {};
1612
1466
  if (typeof this.namespace !== 'undefined') {
1613
1467
  toReturn['namespace'] = this.namespace;
@@ -1632,10 +1486,6 @@
1632
1486
  return m;
1633
1487
  };
1634
1488
  TypedExternalIdentifier.prototype.toApiJson = function () {
1635
- if (typeof this.externalIdType === 'undefined' &&
1636
- typeof this.externalId === 'undefined') {
1637
- return {};
1638
- }
1639
1489
  var toReturn = {};
1640
1490
  if (typeof this.externalIdType !== 'undefined') {
1641
1491
  toReturn['externalIdType'] = this.externalIdType;
@@ -1672,21 +1522,6 @@
1672
1522
  return m;
1673
1523
  };
1674
1524
  User.prototype.toApiJson = function () {
1675
- if (typeof this.userId === 'undefined' &&
1676
- typeof this.namespace === 'undefined' &&
1677
- typeof this.email === 'undefined' &&
1678
- typeof this.created === 'undefined' &&
1679
- typeof this.updated === 'undefined' &&
1680
- typeof this.firstName === 'undefined' &&
1681
- typeof this.greetingName === 'undefined' &&
1682
- typeof this.lastName === 'undefined' &&
1683
- typeof this.languageCode === 'undefined' &&
1684
- typeof this.emailVerified === 'undefined' &&
1685
- typeof this.roles === 'undefined' &&
1686
- typeof this.lastLogin === 'undefined' &&
1687
- typeof this.publicKeys === 'undefined') {
1688
- return {};
1689
- }
1690
1525
  var toReturn = {};
1691
1526
  if (typeof this.userId !== 'undefined') {
1692
1527
  toReturn['userId'] = this.userId;
@@ -1732,7 +1567,7 @@
1732
1567
  return User;
1733
1568
  }());
1734
1569
 
1735
- function enumStringToValue$5(enumRef, value) {
1570
+ function enumStringToValue$7(enumRef, value) {
1736
1571
  if (typeof value === 'number') {
1737
1572
  return value;
1738
1573
  }
@@ -1755,7 +1590,7 @@
1755
1590
  m.resourceEntityIdentifier = Object.keys(proto.resourceEntityIdentifier).reduce(function (obj, k) { obj[k] = ValueList.fromProto(proto.resourceEntityIdentifier[k]); return obj; }, {});
1756
1591
  }
1757
1592
  if (proto.accessScope) {
1758
- m.accessScope = proto.accessScope.map(function (v) { return enumStringToValue$5(exports.AccessScope, v); });
1593
+ m.accessScope = proto.accessScope.map(function (v) { return enumStringToValue$7(exports.AccessScope, v); });
1759
1594
  }
1760
1595
  if (proto.resourceEntityIdentifiers) {
1761
1596
  m.resourceEntityIdentifiers = proto.resourceEntityIdentifiers.map(ResourceIdentifier.fromProto);
@@ -1766,19 +1601,6 @@
1766
1601
  return m;
1767
1602
  };
1768
1603
  AccessResourceRequest.prototype.toApiJson = function () {
1769
- if (typeof this.context === 'undefined' &&
1770
- typeof this.subjectId === 'undefined' &&
1771
- typeof this.email === 'undefined' &&
1772
- typeof this.userId === 'undefined' &&
1773
- typeof this.session === 'undefined' &&
1774
- typeof this.ownerId === 'undefined' &&
1775
- typeof this.resourceId === 'undefined' &&
1776
- typeof this.resourceEntityIdentifier === 'undefined' &&
1777
- typeof this.accessScope === 'undefined' &&
1778
- typeof this.resourceEntityIdentifiers === 'undefined' &&
1779
- typeof this.resourceAttributes === 'undefined') {
1780
- return {};
1781
- }
1782
1604
  var toReturn = {};
1783
1605
  if (typeof this.context !== 'undefined' && this.context !== null) {
1784
1606
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -1807,6 +1629,9 @@
1807
1629
  if (typeof this.accessScope !== 'undefined') {
1808
1630
  toReturn['accessScope'] = this.accessScope;
1809
1631
  }
1632
+ if (typeof this.actions !== 'undefined') {
1633
+ toReturn['actions'] = this.actions;
1634
+ }
1810
1635
  if (typeof this.resourceEntityIdentifiers !== 'undefined' && this.resourceEntityIdentifiers !== null) {
1811
1636
  toReturn['resourceEntityIdentifiers'] = 'toApiJson' in this.resourceEntityIdentifiers ? this.resourceEntityIdentifiers.toApiJson() : this.resourceEntityIdentifiers;
1812
1637
  }
@@ -1831,7 +1656,7 @@
1831
1656
  m.context = Context.fromProto(proto.context);
1832
1657
  }
1833
1658
  if (proto.algorithmType) {
1834
- m.algorithmType = enumStringToValue$5(exports.AlgorithmType, proto.algorithmType);
1659
+ m.algorithmType = enumStringToValue$7(exports.AlgorithmType, proto.algorithmType);
1835
1660
  }
1836
1661
  if (proto.userIdentifier) {
1837
1662
  m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
@@ -1839,12 +1664,6 @@
1839
1664
  return m;
1840
1665
  };
1841
1666
  AddKeyRequest.prototype.toApiJson = function () {
1842
- if (typeof this.email === 'undefined' &&
1843
- typeof this.context === 'undefined' &&
1844
- typeof this.algorithmType === 'undefined' &&
1845
- typeof this.userIdentifier === 'undefined') {
1846
- return {};
1847
- }
1848
1667
  var toReturn = {};
1849
1668
  if (typeof this.email !== 'undefined') {
1850
1669
  toReturn['email'] = this.email;
@@ -1875,10 +1694,6 @@
1875
1694
  return m;
1876
1695
  };
1877
1696
  AddKeyResponse.prototype.toApiJson = function () {
1878
- if (typeof this.privateKey === 'undefined' &&
1879
- typeof this.keyId === 'undefined') {
1880
- return {};
1881
- }
1882
1697
  var toReturn = {};
1883
1698
  if (typeof this.privateKey !== 'undefined') {
1884
1699
  toReturn['privateKey'] = this.privateKey;
@@ -1904,15 +1719,11 @@
1904
1719
  m.userIdentifiers = proto.userIdentifiers.map(UserIdentifier.fromProto);
1905
1720
  }
1906
1721
  if (proto.restrictionType) {
1907
- m.restrictionType = enumStringToValue$5(exports.RestrictionType, proto.restrictionType);
1722
+ m.restrictionType = enumStringToValue$7(exports.RestrictionType, proto.restrictionType);
1908
1723
  }
1909
1724
  return m;
1910
1725
  };
1911
1726
  AddMultiUserRestrictionRequest.prototype.toApiJson = function () {
1912
- if (typeof this.userIdentifiers === 'undefined' &&
1913
- typeof this.restrictionType === 'undefined') {
1914
- return {};
1915
- }
1916
1727
  var toReturn = {};
1917
1728
  if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
1918
1729
  toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
@@ -1940,11 +1751,6 @@
1940
1751
  return m;
1941
1752
  };
1942
1753
  AuthenticateSubjectRequest.prototype.toApiJson = function () {
1943
- if (typeof this.context === 'undefined' &&
1944
- typeof this.email === 'undefined' &&
1945
- typeof this.password === 'undefined') {
1946
- return {};
1947
- }
1948
1754
  var toReturn = {};
1949
1755
  if (typeof this.context !== 'undefined' && this.context !== null) {
1950
1756
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -1975,11 +1781,6 @@
1975
1781
  return m;
1976
1782
  };
1977
1783
  ChangeSubjectEmailRequest.prototype.toApiJson = function () {
1978
- if (typeof this.context === 'undefined' &&
1979
- typeof this.subjectId === 'undefined' &&
1980
- typeof this.newEmail === 'undefined') {
1981
- return {};
1982
- }
1983
1784
  var toReturn = {};
1984
1785
  if (typeof this.context !== 'undefined' && this.context !== null) {
1985
1786
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2013,10 +1814,6 @@
2013
1814
  return m;
2014
1815
  };
2015
1816
  CreateExternalIDRequest.prototype.toApiJson = function () {
2016
- if (typeof this.userIdentifier === 'undefined' &&
2017
- typeof this.typedExternalIdentifier === 'undefined') {
2018
- return {};
2019
- }
2020
1817
  var toReturn = {};
2021
1818
  if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
2022
1819
  toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
@@ -2050,11 +1847,6 @@
2050
1847
  return m;
2051
1848
  };
2052
1849
  CreateSessionRequest.prototype.toApiJson = function () {
2053
- if (typeof this.context === 'undefined' &&
2054
- typeof this.oauthCredentials === 'undefined' &&
2055
- typeof this.subjectCredentials === 'undefined') {
2056
- return {};
2057
- }
2058
1850
  var toReturn = {};
2059
1851
  if (typeof this.context !== 'undefined' && this.context !== null) {
2060
1852
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2082,9 +1874,6 @@
2082
1874
  return m;
2083
1875
  };
2084
1876
  CreateSessionResponse.prototype.toApiJson = function () {
2085
- if (typeof this.session === 'undefined') {
2086
- return {};
2087
- }
2088
1877
  var toReturn = {};
2089
1878
  if (typeof this.session !== 'undefined') {
2090
1879
  toReturn['session'] = this.session;
@@ -2112,11 +1901,6 @@
2112
1901
  return m;
2113
1902
  };
2114
1903
  CreateTemporarySubjectRequest.prototype.toApiJson = function () {
2115
- if (typeof this.context === 'undefined' &&
2116
- typeof this.subject === 'undefined' &&
2117
- typeof this.attributes === 'undefined') {
2118
- return {};
2119
- }
2120
1904
  var toReturn = {};
2121
1905
  if (typeof this.context !== 'undefined' && this.context !== null) {
2122
1906
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2144,9 +1928,6 @@
2144
1928
  return m;
2145
1929
  };
2146
1930
  CreateTemporarySubjectResponse.prototype.toApiJson = function () {
2147
- if (typeof this.session === 'undefined') {
2148
- return {};
2149
- }
2150
1931
  var toReturn = {};
2151
1932
  if (typeof this.session !== 'undefined') {
2152
1933
  toReturn['session'] = this.session;
@@ -2171,10 +1952,6 @@
2171
1952
  return m;
2172
1953
  };
2173
1954
  DeleteSubjectRequest.prototype.toApiJson = function () {
2174
- if (typeof this.context === 'undefined' &&
2175
- typeof this.subjectId === 'undefined') {
2176
- return {};
2177
- }
2178
1955
  var toReturn = {};
2179
1956
  if (typeof this.context !== 'undefined' && this.context !== null) {
2180
1957
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2202,9 +1979,6 @@
2202
1979
  return m;
2203
1980
  };
2204
1981
  DeleteUserRequest.prototype.toApiJson = function () {
2205
- if (typeof this.userIdentifier === 'undefined') {
2206
- return {};
2207
- }
2208
1982
  var toReturn = {};
2209
1983
  if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
2210
1984
  toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
@@ -2226,9 +2000,6 @@
2226
2000
  return m;
2227
2001
  };
2228
2002
  ListSecurityLogsRequestFilters.prototype.toApiJson = function () {
2229
- if (typeof this.actionId === 'undefined') {
2230
- return {};
2231
- }
2232
2003
  var toReturn = {};
2233
2004
  if (typeof this.actionId !== 'undefined') {
2234
2005
  toReturn['actionId'] = this.actionId;
@@ -2256,10 +2027,6 @@
2256
2027
  return m;
2257
2028
  };
2258
2029
  GetImpersonationTokenRequest.prototype.toApiJson = function () {
2259
- if (typeof this.impersonatee === 'undefined' &&
2260
- typeof this.impersonator === 'undefined') {
2261
- return {};
2262
- }
2263
2030
  var toReturn = {};
2264
2031
  if (typeof this.impersonatee !== 'undefined' && this.impersonatee !== null) {
2265
2032
  toReturn['impersonatee'] = 'toApiJson' in this.impersonatee ? this.impersonatee.toApiJson() : this.impersonatee;
@@ -2284,9 +2051,6 @@
2284
2051
  return m;
2285
2052
  };
2286
2053
  GetImpersonationTokenResponse.prototype.toApiJson = function () {
2287
- if (typeof this.token === 'undefined') {
2288
- return {};
2289
- }
2290
2054
  var toReturn = {};
2291
2055
  if (typeof this.token !== 'undefined') {
2292
2056
  toReturn['token'] = this.token;
@@ -2311,10 +2075,6 @@
2311
2075
  return m;
2312
2076
  };
2313
2077
  GetMultiExternalIDRequest.prototype.toApiJson = function () {
2314
- if (typeof this.userIdentifiers === 'undefined' &&
2315
- typeof this.externalIdType === 'undefined') {
2316
- return {};
2317
- }
2318
2078
  var toReturn = {};
2319
2079
  if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
2320
2080
  toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
@@ -2339,9 +2099,6 @@
2339
2099
  return m;
2340
2100
  };
2341
2101
  GetMultiExternalIDResponse.prototype.toApiJson = function () {
2342
- if (typeof this.externalIds === 'undefined') {
2343
- return {};
2344
- }
2345
2102
  var toReturn = {};
2346
2103
  if (typeof this.externalIds !== 'undefined') {
2347
2104
  toReturn['externalIds'] = this.externalIds;
@@ -2366,9 +2123,6 @@
2366
2123
  return m;
2367
2124
  };
2368
2125
  GetMultiUsersRequest.prototype.toApiJson = function () {
2369
- if (typeof this.userIdentifiers === 'undefined') {
2370
- return {};
2371
- }
2372
2126
  var toReturn = {};
2373
2127
  if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
2374
2128
  toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
@@ -2393,9 +2147,6 @@
2393
2147
  return m;
2394
2148
  };
2395
2149
  GetMultiUsersResponse.prototype.toApiJson = function () {
2396
- if (typeof this.users === 'undefined') {
2397
- return {};
2398
- }
2399
2150
  var toReturn = {};
2400
2151
  if (typeof this.users !== 'undefined' && this.users !== null) {
2401
2152
  toReturn['users'] = 'toApiJson' in this.users ? this.users.toApiJson() : this.users;
@@ -2417,13 +2168,12 @@
2417
2168
  if (proto.context) {
2418
2169
  m.context = Context.fromProto(proto.context);
2419
2170
  }
2171
+ if (proto.userIdentifier) {
2172
+ m.userIdentifier = UserIdentifier.fromProto(proto.userIdentifier);
2173
+ }
2420
2174
  return m;
2421
2175
  };
2422
2176
  GetResetPasswordTokenRequest.prototype.toApiJson = function () {
2423
- if (typeof this.context === 'undefined' &&
2424
- typeof this.email === 'undefined') {
2425
- return {};
2426
- }
2427
2177
  var toReturn = {};
2428
2178
  if (typeof this.context !== 'undefined' && this.context !== null) {
2429
2179
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2431,131 +2181,43 @@
2431
2181
  if (typeof this.email !== 'undefined') {
2432
2182
  toReturn['email'] = this.email;
2433
2183
  }
2184
+ if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
2185
+ toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
2186
+ }
2434
2187
  return toReturn;
2435
2188
  };
2436
2189
  return GetResetPasswordTokenRequest;
2437
2190
  }());
2438
- var GetSessionForUserRequest = /** @class */ (function () {
2439
- function GetSessionForUserRequest(kwargs) {
2191
+ var GetSessionTokenRequest = /** @class */ (function () {
2192
+ function GetSessionTokenRequest(kwargs) {
2440
2193
  if (!kwargs) {
2441
2194
  return;
2442
2195
  }
2443
2196
  Object.assign(this, kwargs);
2444
2197
  }
2445
- GetSessionForUserRequest.fromProto = function (proto) {
2446
- var m = new GetSessionForUserRequest();
2198
+ GetSessionTokenRequest.fromProto = function (proto) {
2199
+ var m = new GetSessionTokenRequest();
2447
2200
  m = Object.assign(m, proto);
2448
2201
  return m;
2449
2202
  };
2450
- GetSessionForUserRequest.prototype.toApiJson = function () {
2451
- if (typeof this.subjectId === 'undefined' &&
2452
- typeof this.email === 'undefined' &&
2453
- typeof this.userId === 'undefined' &&
2454
- typeof this.refreshToken === 'undefined' &&
2455
- typeof this.clientAssertion === 'undefined' &&
2456
- typeof this.federatedIdentityProvider === 'undefined' &&
2457
- typeof this.scopes === 'undefined' &&
2458
- typeof this.clientId === 'undefined' &&
2459
- typeof this.nonce === 'undefined') {
2460
- return {};
2461
- }
2203
+ GetSessionTokenRequest.prototype.toApiJson = function () {
2462
2204
  var toReturn = {};
2463
- if (typeof this.subjectId !== 'undefined') {
2464
- toReturn['subjectId'] = this.subjectId;
2465
- }
2466
- if (typeof this.email !== 'undefined') {
2467
- toReturn['email'] = this.email;
2468
- }
2469
- if (typeof this.userId !== 'undefined') {
2470
- toReturn['userId'] = this.userId;
2471
- }
2472
- if (typeof this.refreshToken !== 'undefined') {
2473
- toReturn['refreshToken'] = this.refreshToken;
2474
- }
2475
- if (typeof this.clientAssertion !== 'undefined') {
2476
- toReturn['clientAssertion'] = this.clientAssertion;
2477
- }
2478
- if (typeof this.federatedIdentityProvider !== 'undefined') {
2479
- toReturn['federatedIdentityProvider'] = this.federatedIdentityProvider;
2480
- }
2481
- if (typeof this.scopes !== 'undefined') {
2482
- toReturn['scopes'] = this.scopes;
2483
- }
2484
- if (typeof this.clientId !== 'undefined') {
2485
- toReturn['clientId'] = this.clientId;
2486
- }
2487
- if (typeof this.nonce !== 'undefined') {
2488
- toReturn['nonce'] = this.nonce;
2205
+ if (typeof this.token !== 'undefined') {
2206
+ toReturn['token'] = this.token;
2489
2207
  }
2490
2208
  return toReturn;
2491
2209
  };
2492
- return GetSessionForUserRequest;
2210
+ return GetSessionTokenRequest;
2493
2211
  }());
2494
- var GetSessionForUserResponse = /** @class */ (function () {
2495
- function GetSessionForUserResponse(kwargs) {
2212
+ var GetShortLivedTokenRequest = /** @class */ (function () {
2213
+ function GetShortLivedTokenRequest(kwargs) {
2496
2214
  if (!kwargs) {
2497
2215
  return;
2498
2216
  }
2499
2217
  Object.assign(this, kwargs);
2500
2218
  }
2501
- GetSessionForUserResponse.fromProto = function (proto) {
2502
- var m = new GetSessionForUserResponse();
2503
- m = Object.assign(m, proto);
2504
- return m;
2505
- };
2506
- GetSessionForUserResponse.prototype.toApiJson = function () {
2507
- if (typeof this.session === 'undefined' &&
2508
- typeof this.accessToken === 'undefined' &&
2509
- typeof this.refreshToken === 'undefined') {
2510
- return {};
2511
- }
2512
- var toReturn = {};
2513
- if (typeof this.session !== 'undefined') {
2514
- toReturn['session'] = this.session;
2515
- }
2516
- if (typeof this.accessToken !== 'undefined') {
2517
- toReturn['accessToken'] = this.accessToken;
2518
- }
2519
- if (typeof this.refreshToken !== 'undefined') {
2520
- toReturn['refreshToken'] = this.refreshToken;
2521
- }
2522
- return toReturn;
2523
- };
2524
- return GetSessionForUserResponse;
2525
- }());
2526
- var GetSessionTokenRequest = /** @class */ (function () {
2527
- function GetSessionTokenRequest(kwargs) {
2528
- if (!kwargs) {
2529
- return;
2530
- }
2531
- Object.assign(this, kwargs);
2532
- }
2533
- GetSessionTokenRequest.fromProto = function (proto) {
2534
- var m = new GetSessionTokenRequest();
2535
- m = Object.assign(m, proto);
2536
- return m;
2537
- };
2538
- GetSessionTokenRequest.prototype.toApiJson = function () {
2539
- if (typeof this.token === 'undefined') {
2540
- return {};
2541
- }
2542
- var toReturn = {};
2543
- if (typeof this.token !== 'undefined') {
2544
- toReturn['token'] = this.token;
2545
- }
2546
- return toReturn;
2547
- };
2548
- return GetSessionTokenRequest;
2549
- }());
2550
- var GetShortLivedTokenRequest = /** @class */ (function () {
2551
- function GetShortLivedTokenRequest(kwargs) {
2552
- if (!kwargs) {
2553
- return;
2554
- }
2555
- Object.assign(this, kwargs);
2556
- }
2557
- GetShortLivedTokenRequest.fromProto = function (proto) {
2558
- var m = new GetShortLivedTokenRequest();
2219
+ GetShortLivedTokenRequest.fromProto = function (proto) {
2220
+ var m = new GetShortLivedTokenRequest();
2559
2221
  m = Object.assign(m, proto);
2560
2222
  if (proto.context) {
2561
2223
  m.context = Context.fromProto(proto.context);
@@ -2563,10 +2225,6 @@
2563
2225
  return m;
2564
2226
  };
2565
2227
  GetShortLivedTokenRequest.prototype.toApiJson = function () {
2566
- if (typeof this.context === 'undefined' &&
2567
- typeof this.email === 'undefined') {
2568
- return {};
2569
- }
2570
2228
  var toReturn = {};
2571
2229
  if (typeof this.context !== 'undefined' && this.context !== null) {
2572
2230
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2594,10 +2252,6 @@
2594
2252
  return m;
2595
2253
  };
2596
2254
  GetSubjectBySessionRequest.prototype.toApiJson = function () {
2597
- if (typeof this.session === 'undefined' &&
2598
- typeof this.context === 'undefined') {
2599
- return {};
2600
- }
2601
2255
  var toReturn = {};
2602
2256
  if (typeof this.session !== 'undefined') {
2603
2257
  toReturn['session'] = this.session;
@@ -2622,9 +2276,6 @@
2622
2276
  return m;
2623
2277
  };
2624
2278
  GetSubjectContextRequest.prototype.toApiJson = function () {
2625
- if (typeof this.subjectId === 'undefined') {
2626
- return {};
2627
- }
2628
2279
  var toReturn = {};
2629
2280
  if (typeof this.subjectId !== 'undefined') {
2630
2281
  toReturn['subjectId'] = this.subjectId;
@@ -2649,9 +2300,6 @@
2649
2300
  return m;
2650
2301
  };
2651
2302
  GetSubjectContextResponse.prototype.toApiJson = function () {
2652
- if (typeof this.context === 'undefined') {
2653
- return {};
2654
- }
2655
2303
  var toReturn = {};
2656
2304
  if (typeof this.context !== 'undefined' && this.context !== null) {
2657
2305
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2676,9 +2324,6 @@
2676
2324
  return m;
2677
2325
  };
2678
2326
  GetSubjectResponse.prototype.toApiJson = function () {
2679
- if (typeof this.subject === 'undefined') {
2680
- return {};
2681
- }
2682
2327
  var toReturn = {};
2683
2328
  if (typeof this.subject !== 'undefined' && this.subject !== null) {
2684
2329
  toReturn['subject'] = 'toApiJson' in this.subject ? this.subject.toApiJson() : this.subject;
@@ -2706,11 +2351,6 @@
2706
2351
  return m;
2707
2352
  };
2708
2353
  GetSubjectsByEmailRequest.prototype.toApiJson = function () {
2709
- if (typeof this.context === 'undefined' &&
2710
- typeof this.emails === 'undefined' &&
2711
- typeof this.fieldMask === 'undefined') {
2712
- return {};
2713
- }
2714
2354
  var toReturn = {};
2715
2355
  if (typeof this.context !== 'undefined' && this.context !== null) {
2716
2356
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2747,12 +2387,6 @@
2747
2387
  return m;
2748
2388
  };
2749
2389
  GetSubjectsRequest.prototype.toApiJson = function () {
2750
- if (typeof this.context === 'undefined' &&
2751
- typeof this.subjectIds === 'undefined' &&
2752
- typeof this.fieldMask === 'undefined' &&
2753
- typeof this.identifiers === 'undefined') {
2754
- return {};
2755
- }
2756
2390
  var toReturn = {};
2757
2391
  if (typeof this.context !== 'undefined' && this.context !== null) {
2758
2392
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -2786,9 +2420,6 @@
2786
2420
  return m;
2787
2421
  };
2788
2422
  GetSubjectsResponse.prototype.toApiJson = function () {
2789
- if (typeof this.subjects === 'undefined') {
2790
- return {};
2791
- }
2792
2423
  var toReturn = {};
2793
2424
  if (typeof this.subjects !== 'undefined' && this.subjects !== null) {
2794
2425
  toReturn['subjects'] = 'toApiJson' in this.subjects ? this.subjects.toApiJson() : this.subjects;
@@ -2828,9 +2459,6 @@
2828
2459
  return m;
2829
2460
  };
2830
2461
  GetTokenResponse.prototype.toApiJson = function () {
2831
- if (typeof this.token === 'undefined') {
2832
- return {};
2833
- }
2834
2462
  var toReturn = {};
2835
2463
  if (typeof this.token !== 'undefined') {
2836
2464
  toReturn['token'] = this.token;
@@ -2858,13 +2486,6 @@
2858
2486
  return m;
2859
2487
  };
2860
2488
  IAMListPersonasRequest.prototype.toApiJson = function () {
2861
- if (typeof this.userIdentifier === 'undefined' &&
2862
- typeof this.cursor === 'undefined' &&
2863
- typeof this.pageSize === 'undefined' &&
2864
- typeof this.type === 'undefined' &&
2865
- typeof this.namespace === 'undefined') {
2866
- return {};
2867
- }
2868
2489
  var toReturn = {};
2869
2490
  if (typeof this.userIdentifier !== 'undefined' && this.userIdentifier !== null) {
2870
2491
  toReturn['userIdentifier'] = 'toApiJson' in this.userIdentifier ? this.userIdentifier.toApiJson() : this.userIdentifier;
@@ -2881,6 +2502,9 @@
2881
2502
  if (typeof this.namespace !== 'undefined') {
2882
2503
  toReturn['namespace'] = this.namespace;
2883
2504
  }
2505
+ if (typeof this.alwaysIncludeSuperadmin !== 'undefined') {
2506
+ toReturn['alwaysIncludeSuperadmin'] = this.alwaysIncludeSuperadmin;
2507
+ }
2884
2508
  return toReturn;
2885
2509
  };
2886
2510
  return IAMListPersonasRequest;
@@ -2901,13 +2525,6 @@
2901
2525
  return m;
2902
2526
  };
2903
2527
  ListPersonasByEmailRequest.prototype.toApiJson = function () {
2904
- if (typeof this.email === 'undefined' &&
2905
- typeof this.cursor === 'undefined' &&
2906
- typeof this.pageSize === 'undefined' &&
2907
- typeof this.type === 'undefined' &&
2908
- typeof this.namespace === 'undefined') {
2909
- return {};
2910
- }
2911
2528
  var toReturn = {};
2912
2529
  if (typeof this.email !== 'undefined') {
2913
2530
  toReturn['email'] = this.email;
@@ -2944,13 +2561,6 @@
2944
2561
  return m;
2945
2562
  };
2946
2563
  ListPersonasRequest.prototype.toApiJson = function () {
2947
- if (typeof this.session === 'undefined' &&
2948
- typeof this.cursor === 'undefined' &&
2949
- typeof this.pageSize === 'undefined' &&
2950
- typeof this.type === 'undefined' &&
2951
- typeof this.namespace === 'undefined') {
2952
- return {};
2953
- }
2954
2564
  var toReturn = {};
2955
2565
  if (typeof this.session !== 'undefined') {
2956
2566
  toReturn['session'] = this.session;
@@ -2987,11 +2597,6 @@
2987
2597
  return m;
2988
2598
  };
2989
2599
  ListPersonasResponse.prototype.toApiJson = function () {
2990
- if (typeof this.personas === 'undefined' &&
2991
- typeof this.nextCursor === 'undefined' &&
2992
- typeof this.hasMore === 'undefined') {
2993
- return {};
2994
- }
2995
2600
  var toReturn = {};
2996
2601
  if (typeof this.personas !== 'undefined' && this.personas !== null) {
2997
2602
  toReturn['personas'] = 'toApiJson' in this.personas ? this.personas.toApiJson() : this.personas;
@@ -3025,12 +2630,6 @@
3025
2630
  return m;
3026
2631
  };
3027
2632
  ListSecurityLogsRequest.prototype.toApiJson = function () {
3028
- if (typeof this.userId === 'undefined' &&
3029
- typeof this.filters === 'undefined' &&
3030
- typeof this.pageSize === 'undefined' &&
3031
- typeof this.cursor === 'undefined') {
3032
- return {};
3033
- }
3034
2633
  var toReturn = {};
3035
2634
  if (typeof this.userId !== 'undefined') {
3036
2635
  toReturn['userId'] = this.userId;
@@ -3064,11 +2663,6 @@
3064
2663
  return m;
3065
2664
  };
3066
2665
  ListSecurityLogsResponse.prototype.toApiJson = function () {
3067
- if (typeof this.logs === 'undefined' &&
3068
- typeof this.nextCursor === 'undefined' &&
3069
- typeof this.hasMore === 'undefined') {
3070
- return {};
3071
- }
3072
2666
  var toReturn = {};
3073
2667
  if (typeof this.logs !== 'undefined' && this.logs !== null) {
3074
2668
  toReturn['logs'] = 'toApiJson' in this.logs ? this.logs.toApiJson() : this.logs;
@@ -3105,14 +2699,6 @@
3105
2699
  return m;
3106
2700
  };
3107
2701
  ListUsersRequest.prototype.toApiJson = function () {
3108
- if (typeof this.namespace === 'undefined' &&
3109
- typeof this.email === 'undefined' &&
3110
- typeof this.cursor === 'undefined' &&
3111
- typeof this.pageSize === 'undefined' &&
3112
- typeof this.userFilter === 'undefined' &&
3113
- typeof this.sortOptions === 'undefined') {
3114
- return {};
3115
- }
3116
2702
  var toReturn = {};
3117
2703
  if (typeof this.namespace !== 'undefined') {
3118
2704
  toReturn['namespace'] = this.namespace;
@@ -3152,11 +2738,6 @@
3152
2738
  return m;
3153
2739
  };
3154
2740
  ListUsersResponse.prototype.toApiJson = function () {
3155
- if (typeof this.users === 'undefined' &&
3156
- typeof this.nextCursor === 'undefined' &&
3157
- typeof this.hasMore === 'undefined') {
3158
- return {};
3159
- }
3160
2741
  var toReturn = {};
3161
2742
  if (typeof this.users !== 'undefined' && this.users !== null) {
3162
2743
  toReturn['users'] = 'toApiJson' in this.users ? this.users.toApiJson() : this.users;
@@ -3190,11 +2771,6 @@
3190
2771
  return m;
3191
2772
  };
3192
2773
  MutateAttributesRequest.prototype.toApiJson = function () {
3193
- if (typeof this.context === 'undefined' &&
3194
- typeof this.subjectId === 'undefined' &&
3195
- typeof this.mutations === 'undefined') {
3196
- return {};
3197
- }
3198
2774
  var toReturn = {};
3199
2775
  if (typeof this.context !== 'undefined' && this.context !== null) {
3200
2776
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -3222,11 +2798,6 @@
3222
2798
  return m;
3223
2799
  };
3224
2800
  OAuthCredentials.prototype.toApiJson = function () {
3225
- if (typeof this.provider === 'undefined' &&
3226
- typeof this.idToken === 'undefined' &&
3227
- typeof this.accessToken === 'undefined') {
3228
- return {};
3229
- }
3230
2801
  var toReturn = {};
3231
2802
  if (typeof this.provider !== 'undefined') {
3232
2803
  toReturn['provider'] = this.provider;
@@ -3254,12 +2825,6 @@
3254
2825
  return m;
3255
2826
  };
3256
2827
  UpdateUserRequestOperation.prototype.toApiJson = function () {
3257
- if (typeof this.firstName === 'undefined' &&
3258
- typeof this.greetingName === 'undefined' &&
3259
- typeof this.lastName === 'undefined' &&
3260
- typeof this.languageCode === 'undefined') {
3261
- return {};
3262
- }
3263
2828
  var toReturn = {};
3264
2829
  if (typeof this.firstName !== 'undefined') {
3265
2830
  toReturn['firstName'] = this.firstName;
@@ -3293,9 +2858,6 @@
3293
2858
  return m;
3294
2859
  };
3295
2860
  RegisterPolicyRequest.prototype.toApiJson = function () {
3296
- if (typeof this.policy === 'undefined') {
3297
- return {};
3298
- }
3299
2861
  var toReturn = {};
3300
2862
  if (typeof this.policy !== 'undefined' && this.policy !== null) {
3301
2863
  toReturn['policy'] = 'toApiJson' in this.policy ? this.policy.toApiJson() : this.policy;
@@ -3320,9 +2882,6 @@
3320
2882
  return m;
3321
2883
  };
3322
2884
  RegisterResourceOwnerRequest.prototype.toApiJson = function () {
3323
- if (typeof this.owner === 'undefined') {
3324
- return {};
3325
- }
3326
2885
  var toReturn = {};
3327
2886
  if (typeof this.owner !== 'undefined' && this.owner !== null) {
3328
2887
  toReturn['owner'] = 'toApiJson' in this.owner ? this.owner.toApiJson() : this.owner;
@@ -3344,14 +2903,6 @@
3344
2903
  return m;
3345
2904
  };
3346
2905
  RegisterResourceRequest.prototype.toApiJson = function () {
3347
- if (typeof this.appId === 'undefined' &&
3348
- typeof this.resourceId === 'undefined' &&
3349
- typeof this.resourceName === 'undefined' &&
3350
- typeof this.resourceOwnerServiceUrl === 'undefined' &&
3351
- typeof this.requiredResourceParams === 'undefined' &&
3352
- typeof this.resourceOwnerAudience === 'undefined') {
3353
- return {};
3354
- }
3355
2906
  var toReturn = {};
3356
2907
  if (typeof this.appId !== 'undefined') {
3357
2908
  toReturn['appId'] = this.appId;
@@ -3397,13 +2948,6 @@
3397
2948
  return m;
3398
2949
  };
3399
2950
  RegisterSubjectRequest.prototype.toApiJson = function () {
3400
- if (typeof this.context === 'undefined' &&
3401
- typeof this.email === 'undefined' &&
3402
- typeof this.password === 'undefined' &&
3403
- typeof this.attributes === 'undefined' &&
3404
- typeof this.structAttributes === 'undefined') {
3405
- return {};
3406
- }
3407
2951
  var toReturn = {};
3408
2952
  if (typeof this.context !== 'undefined' && this.context !== null) {
3409
2953
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -3437,9 +2981,6 @@
3437
2981
  return m;
3438
2982
  };
3439
2983
  RegisterSubjectResponse.prototype.toApiJson = function () {
3440
- if (typeof this.subjectId === 'undefined') {
3441
- return {};
3442
- }
3443
2984
  var toReturn = {};
3444
2985
  if (typeof this.subjectId !== 'undefined') {
3445
2986
  toReturn['subjectId'] = this.subjectId;
@@ -3467,12 +3008,6 @@
3467
3008
  return m;
3468
3009
  };
3469
3010
  RemoveKeyRequest.prototype.toApiJson = function () {
3470
- if (typeof this.email === 'undefined' &&
3471
- typeof this.context === 'undefined' &&
3472
- typeof this.keyId === 'undefined' &&
3473
- typeof this.userIdentifier === 'undefined') {
3474
- return {};
3475
- }
3476
3011
  var toReturn = {};
3477
3012
  if (typeof this.email !== 'undefined') {
3478
3013
  toReturn['email'] = this.email;
@@ -3504,15 +3039,11 @@
3504
3039
  m.userIdentifiers = proto.userIdentifiers.map(UserIdentifier.fromProto);
3505
3040
  }
3506
3041
  if (proto.restrictionType) {
3507
- m.restrictionType = enumStringToValue$5(exports.RestrictionType, proto.restrictionType);
3042
+ m.restrictionType = enumStringToValue$7(exports.RestrictionType, proto.restrictionType);
3508
3043
  }
3509
3044
  return m;
3510
3045
  };
3511
3046
  RemoveMultiUserRestrictionRequest.prototype.toApiJson = function () {
3512
- if (typeof this.userIdentifiers === 'undefined' &&
3513
- typeof this.restrictionType === 'undefined') {
3514
- return {};
3515
- }
3516
3047
  var toReturn = {};
3517
3048
  if (typeof this.userIdentifiers !== 'undefined' && this.userIdentifiers !== null) {
3518
3049
  toReturn['userIdentifiers'] = 'toApiJson' in this.userIdentifiers ? this.userIdentifiers.toApiJson() : this.userIdentifiers;
@@ -3537,9 +3068,6 @@
3537
3068
  return m;
3538
3069
  };
3539
3070
  ResetPasswordTokenResponse.prototype.toApiJson = function () {
3540
- if (typeof this.token === 'undefined') {
3541
- return {};
3542
- }
3543
3071
  var toReturn = {};
3544
3072
  if (typeof this.token !== 'undefined') {
3545
3073
  toReturn['token'] = this.token;
@@ -3561,10 +3089,6 @@
3561
3089
  return m;
3562
3090
  };
3563
3091
  ResetPasswordWithTokenRequest.prototype.toApiJson = function () {
3564
- if (typeof this.token === 'undefined' &&
3565
- typeof this.password === 'undefined') {
3566
- return {};
3567
- }
3568
3092
  var toReturn = {};
3569
3093
  if (typeof this.token !== 'undefined') {
3570
3094
  toReturn['token'] = this.token;
@@ -3592,11 +3116,6 @@
3592
3116
  return m;
3593
3117
  };
3594
3118
  ResetSubjectPasswordRequest.prototype.toApiJson = function () {
3595
- if (typeof this.context === 'undefined' &&
3596
- typeof this.subjectId === 'undefined' &&
3597
- typeof this.newPassword === 'undefined') {
3598
- return {};
3599
- }
3600
3119
  var toReturn = {};
3601
3120
  if (typeof this.context !== 'undefined' && this.context !== null) {
3602
3121
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -3627,10 +3146,6 @@
3627
3146
  return m;
3628
3147
  };
3629
3148
  AccessResourceRequestResourceEntityIdentifierEntry.prototype.toApiJson = function () {
3630
- if (typeof this.key === 'undefined' &&
3631
- typeof this.value === 'undefined') {
3632
- return {};
3633
- }
3634
3149
  var toReturn = {};
3635
3150
  if (typeof this.key !== 'undefined') {
3636
3151
  toReturn['key'] = this.key;
@@ -3662,7 +3177,7 @@
3662
3177
  m.filters = proto.filters.map(SingleValueAttribute.fromProto);
3663
3178
  }
3664
3179
  if (proto.orderByDirection) {
3665
- m.orderByDirection = enumStringToValue$5(exports.OrderByDirection, proto.orderByDirection);
3180
+ m.orderByDirection = enumStringToValue$7(exports.OrderByDirection, proto.orderByDirection);
3666
3181
  }
3667
3182
  if (proto.pageSize) {
3668
3183
  m.pageSize = parseInt(proto.pageSize, 10);
@@ -3673,16 +3188,6 @@
3673
3188
  return m;
3674
3189
  };
3675
3190
  SearchSubjectRequest.prototype.toApiJson = function () {
3676
- if (typeof this.context === 'undefined' &&
3677
- typeof this.query === 'undefined' &&
3678
- typeof this.filters === 'undefined' &&
3679
- typeof this.orderBy === 'undefined' &&
3680
- typeof this.orderByDirection === 'undefined' &&
3681
- typeof this.cursor === 'undefined' &&
3682
- typeof this.pageSize === 'undefined' &&
3683
- typeof this.fieldMask === 'undefined') {
3684
- return {};
3685
- }
3686
3191
  var toReturn = {};
3687
3192
  if (typeof this.context !== 'undefined' && this.context !== null) {
3688
3193
  toReturn['context'] = 'toApiJson' in this.context ? this.context.toApiJson() : this.context;
@@ -3731,12 +3236,6 @@
3731
3236
  return m;
3732
3237
  };
3733
3238
  SearchSubjectResponse.prototype.toApiJson = function () {
3734
- if (typeof this.result === 'undefined' &&
3735
- typeof this.nextCursor === 'undefined' &&
3736
- typeof this.hasMore === 'undefined' &&
3737
- typeof this.totalResults === 'undefined') {
3738
- return {};
3739
- }
3740
3239
  var toReturn = {};
3741
3240
  if (typeof this.result !== 'undefined' && this.result !== null) {
3742
3241
  toReturn['result'] = 'toApiJson' in this.result ? this.result.toApiJson() : this.result;
@@ -3767,9 +3266,6 @@
3767
3266
  return m;
3768
3267
  };
3769
3268
  SendEmailVerificationRequest.prototype.toApiJson = function () {
3770
- if (typeof this.userId === 'undefined') {
3771
- return {};
3772
- }
3773
3269
  var toReturn = {};
3774
3270
  if (typeof this.userId !== 'undefined') {
3775
3271
  toReturn['userId'] = this.userId;
@@ -3791,10 +3287,6 @@
3791
3287
  return m;
3792
3288
  };
3793
3289
  SubjectCredentials.prototype.toApiJson = function () {
3794
- if (typeof this.email === 'undefined' &&
3795
- typeof this.password === 'undefined') {
3796
- return {};
3797
- }
3798
3290
  var toReturn = {};
3799
3291
  if (typeof this.email !== 'undefined') {
3800
3292
  toReturn['email'] = this.email;
@@ -3822,10 +3314,6 @@
3822
3314
  return m;
3823
3315
  };
3824
3316
  UpdateUserRequest.prototype.toApiJson = function () {
3825
- if (typeof this.userId === 'undefined' &&
3826
- typeof this.operations === 'undefined') {
3827
- return {};
3828
- }
3829
3317
  var toReturn = {};
3830
3318
  if (typeof this.userId !== 'undefined') {
3831
3319
  toReturn['userId'] = this.userId;
@@ -3853,9 +3341,6 @@
3853
3341
  return m;
3854
3342
  };
3855
3343
  GetMultiUsersResponseUserContainer.prototype.toApiJson = function () {
3856
- if (typeof this.user === 'undefined') {
3857
- return {};
3858
- }
3859
3344
  var toReturn = {};
3860
3345
  if (typeof this.user !== 'undefined' && this.user !== null) {
3861
3346
  toReturn['user'] = 'toApiJson' in this.user ? this.user.toApiJson() : this.user;
@@ -3877,10 +3362,6 @@
3877
3362
  return m;
3878
3363
  };
3879
3364
  UserFilter.prototype.toApiJson = function () {
3880
- if (typeof this.subjectTypes === 'undefined' &&
3881
- typeof this.searchTerms === 'undefined') {
3882
- return {};
3883
- }
3884
3365
  var toReturn = {};
3885
3366
  if (typeof this.subjectTypes !== 'undefined') {
3886
3367
  toReturn['subjectTypes'] = this.subjectTypes;
@@ -3914,14 +3395,6 @@
3914
3395
  return m;
3915
3396
  };
3916
3397
  UserIdentifier.prototype.toApiJson = function () {
3917
- if (typeof this.userId === 'undefined' &&
3918
- typeof this.namespacedEmail === 'undefined' &&
3919
- typeof this.namespacedSession === 'undefined' &&
3920
- typeof this.token === 'undefined' &&
3921
- typeof this.typedExternalIdentifier === 'undefined' &&
3922
- typeof this.subjectId === 'undefined') {
3923
- return {};
3924
- }
3925
3398
  var toReturn = {};
3926
3399
  if (typeof this.userId !== 'undefined') {
3927
3400
  toReturn['userId'] = this.userId;
@@ -3956,18 +3429,14 @@
3956
3429
  var m = new UserSortOptions();
3957
3430
  m = Object.assign(m, proto);
3958
3431
  if (proto.direction) {
3959
- m.direction = enumStringToValue$5(exports.SortDirection, proto.direction);
3432
+ m.direction = enumStringToValue$7(exports.SortDirection, proto.direction);
3960
3433
  }
3961
3434
  if (proto.field) {
3962
- m.field = enumStringToValue$5(exports.UserSortField, proto.field);
3435
+ m.field = enumStringToValue$7(exports.UserSortField, proto.field);
3963
3436
  }
3964
3437
  return m;
3965
3438
  };
3966
3439
  UserSortOptions.prototype.toApiJson = function () {
3967
- if (typeof this.direction === 'undefined' &&
3968
- typeof this.field === 'undefined') {
3969
- return {};
3970
- }
3971
3440
  var toReturn = {};
3972
3441
  if (typeof this.direction !== 'undefined') {
3973
3442
  toReturn['direction'] = this.direction;
@@ -3992,9 +3461,6 @@
3992
3461
  return m;
3993
3462
  };
3994
3463
  VerifyEmailRequest.prototype.toApiJson = function () {
3995
- if (typeof this.token === 'undefined') {
3996
- return {};
3997
- }
3998
3464
  var toReturn = {};
3999
3465
  if (typeof this.token !== 'undefined') {
4000
3466
  toReturn['token'] = this.token;
@@ -4004,340 +3470,58 @@
4004
3470
  return VerifyEmailRequest;
4005
3471
  }());
4006
3472
 
4007
- // *********************************
3473
+ (function (PersonaType) {
3474
+ PersonaType["partner"] = "partner";
3475
+ PersonaType["partner_app"] = "partner_app";
3476
+ PersonaType["sales_person"] = "sales_person";
3477
+ PersonaType["smb"] = "smb";
3478
+ PersonaType["vendor"] = "vendor";
3479
+ PersonaType["digital_agent"] = "digital_agent";
3480
+ PersonaType["developer"] = "developer";
3481
+ PersonaType["success"] = "success";
3482
+ PersonaType["account_group"] = "account_group";
3483
+ })(exports.PersonaType || (exports.PersonaType = {}));
4008
3484
 
4009
- var HostService = /** @class */ (function () {
4010
- function HostService(environmentService) {
4011
- this.environmentService = environmentService;
3485
+ var BasePersona = /** @class */ (function () {
3486
+ function BasePersona() {
4012
3487
  }
4013
- HostService.prototype.host = function () {
4014
- if (this._host) {
4015
- return this._host;
4016
- }
4017
- switch (this.environmentService.getEnvironment()) {
4018
- case core.Environment.LOCAL:
4019
- this._host = 'iam.vendasta-local.com';
4020
- break;
4021
- case core.Environment.TEST:
4022
- this._host = '';
4023
- break;
4024
- case core.Environment.DEMO:
4025
- this._host = 'iam-api-demo.apigateway.co';
4026
- break;
4027
- case core.Environment.PROD:
4028
- this._host = 'iam-api-prod.apigateway.co';
4029
- break;
4030
- }
4031
- return this._host;
3488
+ BasePersona.prototype.fromPersona = function (p) {
3489
+ var s = p.subject;
3490
+ this.subjectId = s.subjectId;
3491
+ this.email = s.email;
3492
+ this.created = s.created;
3493
+ this.updated = s.updated;
3494
+ this.lastLogin = s.lastLogin;
3495
+ this.userId = s.userId;
3496
+ return this.readAttributes(s.structAttributes);
4032
3497
  };
4033
- HostService.prototype.httpsHost = function () {
4034
- if (this._httpsHost) {
4035
- return this._httpsHost;
4036
- }
4037
- switch (this.environmentService.getEnvironment()) {
4038
- case core.Environment.LOCAL:
4039
- this._httpsHost = 'iam.vendasta-local.com';
4040
- break;
4041
- case core.Environment.TEST:
4042
- this._httpsHost = '';
4043
- break;
4044
- case core.Environment.DEMO:
4045
- this._httpsHost = 'iam-demo.apigateway.co';
4046
- break;
4047
- case core.Environment.PROD:
4048
- this._httpsHost = 'iam-prod.apigateway.co';
4049
- break;
3498
+ BasePersona.prototype.readAttributes = function (attributes) {
3499
+ if (!attributes) {
3500
+ return this;
4050
3501
  }
4051
- return this._httpsHost;
4052
- };
4053
- HostService.prototype.hostWithScheme = function () {
4054
- var scheme = this.environmentService.getEnvironment() === core.Environment.LOCAL ? 'http://' : 'https://';
4055
- return scheme + this.host();
4056
- };
4057
- HostService.prototype.httpsHostWithScheme = function () {
4058
- var scheme = this.environmentService.getEnvironment() === core.Environment.LOCAL ? 'http://' : 'https://';
4059
- return scheme + this.httpsHost();
3502
+ var attrs = getValueFromAttribute({ structAttribute: { attributes: attributes.attributes } });
3503
+ Object.assign(this, attrs);
3504
+ return this;
4060
3505
  };
4061
- return HostService;
3506
+ return BasePersona;
4062
3507
  }());
4063
- HostService.decorators = [
4064
- { type: core$1.Injectable }
4065
- ];
4066
- HostService.ctorParameters = function () { return [
4067
- { type: core.EnvironmentService }
4068
- ]; };
4069
-
4070
- // *********************************
4071
- var UserIAMApiService = /** @class */ (function () {
4072
- function UserIAMApiService(http, hostService) {
4073
- this.http = http;
4074
- this.hostService = hostService;
3508
+ var TypedPersona = /** @class */ (function (_super) {
3509
+ __extends(TypedPersona, _super);
3510
+ function TypedPersona() {
3511
+ return _super !== null && _super.apply(this, arguments) || this;
4075
3512
  }
4076
- UserIAMApiService.prototype.apiOptions = function () {
4077
- return {
4078
- headers: new http.HttpHeaders({
4079
- 'Content-Type': 'application/json'
4080
- }),
4081
- withCredentials: true
4082
- };
4083
- };
4084
- UserIAMApiService.prototype.getSubjectBySession = function (r) {
4085
- var request = (r.toApiJson) ? r : new GetSubjectBySessionRequest(r);
4086
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetSubjectBySession", request.toApiJson(), this.apiOptions())
4087
- .pipe(operators.map(function (resp) { return GetSubjectResponse.fromProto(resp); }), operators.share());
4088
- };
4089
- UserIAMApiService.prototype.listPersonas = function (r) {
4090
- var request = (r.toApiJson) ? r : new ListPersonasRequest(r);
4091
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/ListPersonas", request.toApiJson(), this.apiOptions())
4092
- .pipe(operators.map(function (resp) { return ListPersonasResponse.fromProto(resp); }), operators.share());
4093
- };
4094
- UserIAMApiService.prototype.getToken = function (r) {
4095
- var request = (r.toApiJson) ? r : new GetTokenRequest(r);
4096
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetToken", request.toApiJson(), this.apiOptions())
4097
- .pipe(operators.map(function (resp) { return GetTokenResponse.fromProto(resp); }), operators.share());
4098
- };
4099
- UserIAMApiService.prototype.getSessionToken = function (r) {
4100
- var request = (r.toApiJson) ? r : new GetSessionTokenRequest(r);
4101
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetSessionToken", request.toApiJson(), this.apiOptions())
4102
- .pipe(operators.map(function (resp) { return GetTokenResponse.fromProto(resp); }), operators.share());
4103
- };
4104
- UserIAMApiService.prototype.resetPasswordWithToken = function (r) {
4105
- var request = (r.toApiJson) ? r : new ResetPasswordWithTokenRequest(r);
4106
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/ResetPasswordWithToken", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
4107
- };
4108
- UserIAMApiService.prototype.getImpersonationToken = function (r) {
4109
- var request = (r.toApiJson) ? r : new GetImpersonationTokenRequest(r);
4110
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetImpersonationToken", request.toApiJson(), this.apiOptions())
4111
- .pipe(operators.map(function (resp) { return GetImpersonationTokenResponse.fromProto(resp); }), operators.share());
4112
- };
4113
- return UserIAMApiService;
4114
- }());
4115
- UserIAMApiService.decorators = [
4116
- { type: core$1.Injectable }
4117
- ];
4118
- UserIAMApiService.ctorParameters = function () { return [
4119
- { type: http.HttpClient },
4120
- { type: HostService }
4121
- ]; };
4122
-
4123
- var LoginRequest = /** @class */ (function () {
4124
- function LoginRequest(kwargs) {
4125
- if (!kwargs) {
4126
- return;
4127
- }
4128
- Object.assign(this, kwargs);
4129
- }
4130
- LoginRequest.fromProto = function (proto) {
4131
- if (!proto) {
4132
- return new LoginRequest();
4133
- }
4134
- var m = new LoginRequest();
4135
- m = Object.assign(m, proto);
4136
- return m;
4137
- };
4138
- LoginRequest.prototype.toApiJson = function () {
4139
- if (typeof this.namespace === 'undefined' &&
4140
- typeof this.type === 'undefined' &&
4141
- typeof this.email === 'undefined' &&
4142
- typeof this.password === 'undefined' &&
4143
- typeof this.providerIdToken === 'undefined' &&
4144
- typeof this.provider === 'undefined') {
4145
- return {};
4146
- }
4147
- return {
4148
- 'namespace': (typeof this.namespace !== 'undefined') ? this.namespace : null,
4149
- 'type': (typeof this.type !== 'undefined') ? this.type : null,
4150
- 'email': (typeof this.email !== 'undefined') ? this.email : null,
4151
- 'password': (typeof this.password !== 'undefined') ? this.password : null,
4152
- 'provider_id_token': (typeof this.providerIdToken !== 'undefined') ? this.providerIdToken : null,
4153
- 'provider': (typeof this.provider !== 'undefined') ? this.provider : null
4154
- };
4155
- };
4156
- return LoginRequest;
4157
- }());
4158
- var LoginResponse = /** @class */ (function () {
4159
- function LoginResponse(kwargs) {
4160
- if (!kwargs) {
4161
- return;
4162
- }
4163
- Object.assign(this, kwargs);
4164
- }
4165
- LoginResponse.fromProto = function (proto) {
4166
- var m = new LoginResponse();
4167
- m.sessionId = proto['session_id'];
4168
- return m;
4169
- };
4170
- LoginResponse.prototype.toApiJson = function () {
4171
- if (typeof this.sessionId === 'undefined') {
4172
- return {};
4173
- }
4174
- return {
4175
- 'sessionId': (typeof this.sessionId !== 'undefined') ? this.sessionId : null
4176
- };
4177
- };
4178
- return LoginResponse;
4179
- }());
4180
- var LogoutResponse = /** @class */ (function () {
4181
- function LogoutResponse(kwargs) {
4182
- if (!kwargs) {
4183
- return;
4184
- }
4185
- Object.assign(this, kwargs);
4186
- }
4187
- LogoutResponse.fromProto = function (proto) {
4188
- var m = new LogoutResponse();
4189
- m = Object.assign(m, proto);
4190
- return m;
4191
- };
4192
- LogoutResponse.prototype.toApiJson = function () {
4193
- if (typeof this.success === 'undefined') {
4194
- return {};
4195
- }
4196
- return {
4197
- 'success': (typeof this.success !== 'undefined') ? this.success : null
4198
- };
4199
- };
4200
- return LogoutResponse;
4201
- }());
4202
- var SSOLoginRequest = /** @class */ (function () {
4203
- function SSOLoginRequest(kwargs) {
4204
- if (!kwargs) {
4205
- return;
4206
- }
4207
- Object.assign(this, kwargs);
4208
- }
4209
- SSOLoginRequest.fromProto = function (proto) {
4210
- var m = new SSOLoginRequest();
4211
- m = Object.assign(m, proto);
4212
- return m;
4213
- };
4214
- SSOLoginRequest.prototype.toApiJson = function () {
4215
- if (typeof this.nextUrl === 'undefined' &&
4216
- typeof this.namespace === 'undefined' &&
4217
- typeof this.type === 'undefined') {
4218
- return null;
4219
- }
4220
- return {
4221
- 'next_url': (typeof this.nextUrl !== 'undefined') ? this.nextUrl : null,
4222
- 'namespace': (typeof this.namespace !== 'undefined') ? this.namespace : null,
4223
- 'type': (typeof this.type !== 'undefined') ? this.type : null
4224
- };
4225
- };
4226
- return SSOLoginRequest;
4227
- }());
4228
-
4229
- var IamHttpApiService = /** @class */ (function () {
4230
- function IamHttpApiService(http, hostService) {
4231
- this.http = http;
4232
- this.hostService = hostService;
4233
- }
4234
- IamHttpApiService.prototype.apiOptions = function (includeCredentials) {
4235
- if (includeCredentials) {
4236
- return {
4237
- headers: new http.HttpHeaders({
4238
- 'Content-Type': 'application/x-www-form-urlencoded'
4239
- }),
4240
- withCredentials: true
4241
- };
4242
- }
4243
- return {
4244
- headers: new http.HttpHeaders({
4245
- 'Content-Type': 'application/x-www-form-urlencoded'
4246
- })
4247
- };
4248
- };
4249
- IamHttpApiService.prototype.login = function (r) {
4250
- var request = (r.toApiJson) ? r : new LoginRequest(r);
4251
- return this.http
4252
- .post(this.hostService.httpsHostWithScheme() + '/_ajax/v1/login', request.toApiJson(), this.apiOptions())
4253
- .pipe(operators.map(function (resp) { return LoginResponse.fromProto(resp); }), operators.share());
4254
- };
4255
- IamHttpApiService.prototype.logout = function () {
4256
- return this.http
4257
- .post(this.hostService.httpsHostWithScheme() + '/_ajax/v1/logout', {}, this.apiOptions(true))
4258
- .pipe(operators.map(function (resp) { return LogoutResponse.fromProto(resp); }), operators.share());
4259
- };
4260
- IamHttpApiService.prototype.ssoLogin = function (r) {
4261
- var request = (r.toApiJson) ? r : new SSOLoginRequest(r);
4262
- var params = '';
4263
- var apiJson = request.toApiJson();
4264
- for (var key in apiJson) {
4265
- if (!apiJson.hasOwnProperty(key)) {
4266
- continue;
4267
- }
4268
- var value = apiJson[key];
4269
- if (value === null) {
4270
- continue;
4271
- }
4272
- if (params.length > 0) {
4273
- params += '&';
4274
- }
4275
- params += key + "=" + value;
4276
- }
4277
- window.location.href = this.hostService.httpsHostWithScheme() + "/sso-login" + (params.length > 0 ? '?' : '') + params;
4278
- };
4279
- return IamHttpApiService;
4280
- }());
4281
- IamHttpApiService.decorators = [
4282
- { type: core$1.Injectable }
4283
- ];
4284
- IamHttpApiService.ctorParameters = function () { return [
4285
- { type: http.HttpClient },
4286
- { type: HostService }
4287
- ]; };
4288
-
4289
- (function (PersonaType) {
4290
- PersonaType["partner"] = "partner";
4291
- PersonaType["partner_app"] = "partner_app";
4292
- PersonaType["sales_person"] = "sales_person";
4293
- PersonaType["smb"] = "smb";
4294
- PersonaType["vendor"] = "vendor";
4295
- PersonaType["digital_agent"] = "digital_agent";
4296
- PersonaType["developer"] = "developer";
4297
- PersonaType["success"] = "success";
4298
- PersonaType["account_group"] = "account_group";
4299
- })(exports.PersonaType || (exports.PersonaType = {}));
4300
-
4301
- var BasePersona = /** @class */ (function () {
4302
- function BasePersona() {
4303
- }
4304
- BasePersona.prototype.fromPersona = function (p) {
4305
- var s = p.subject;
4306
- this.subjectId = s.subjectId;
4307
- this.email = s.email;
4308
- this.created = s.created;
4309
- this.updated = s.updated;
4310
- this.lastLogin = s.lastLogin;
4311
- this.userId = s.userId;
4312
- return this.readAttributes(s.structAttributes);
4313
- };
4314
- BasePersona.prototype.readAttributes = function (attributes) {
4315
- if (!attributes) {
4316
- return this;
4317
- }
4318
- var attrs = getValueFromAttribute({ structAttribute: { attributes: attributes.attributes } });
4319
- Object.assign(this, attrs);
4320
- return this;
4321
- };
4322
- return BasePersona;
4323
- }());
4324
- var TypedPersona = /** @class */ (function (_super) {
4325
- __extends(TypedPersona, _super);
4326
- function TypedPersona() {
4327
- return _super !== null && _super.apply(this, arguments) || this;
4328
- }
4329
- return TypedPersona;
4330
- }(BasePersona));
4331
- var NamespacedPersona = /** @class */ (function (_super) {
4332
- __extends(NamespacedPersona, _super);
4333
- function NamespacedPersona() {
4334
- var _this = _super.apply(this, __spread(arguments)) || this;
4335
- _this.partnerId = '';
4336
- return _this;
4337
- }
4338
- NamespacedPersona.prototype.fromPersona = function (p) {
4339
- this.partnerId = p.context.namespaced.namespace;
4340
- return _super.prototype.fromPersona.call(this, p);
3513
+ return TypedPersona;
3514
+ }(BasePersona));
3515
+ var NamespacedPersona = /** @class */ (function (_super) {
3516
+ __extends(NamespacedPersona, _super);
3517
+ function NamespacedPersona() {
3518
+ var _this = _super.apply(this, __spread(arguments)) || this;
3519
+ _this.partnerId = '';
3520
+ return _this;
3521
+ }
3522
+ NamespacedPersona.prototype.fromPersona = function (p) {
3523
+ this.partnerId = p.context.namespaced.namespace;
3524
+ return _super.prototype.fromPersona.call(this, p);
4341
3525
  };
4342
3526
  return NamespacedPersona;
4343
3527
  }(BasePersona));
@@ -4427,18 +3611,19 @@
4427
3611
  _this.isSuperAdmin = false;
4428
3612
  _this.isAdmin = false;
4429
3613
  _this.canCustomizeWhitelabel = false;
4430
- _this.canAccessBilling = true;
4431
- _this.canAccessAccounts = true;
4432
- _this.canAccessMarketing = true;
4433
- _this.canAccessSales = true;
4434
- _this.canAccessConcierge = true;
4435
- _this.canAccessBrands = true;
4436
- _this.canAccessDashboard = true;
4437
- _this.canAccessOrders = true;
4438
- _this.canAccessCompanyProfile = true;
4439
- _this.canAccessAutomations = true;
4440
- _this.canAccessMarketplace = true;
4441
- _this.canEnableApps = true;
3614
+ _this.canAccessBilling = false;
3615
+ _this.canAccessAccounts = false;
3616
+ _this.canAccessMarketing = false;
3617
+ _this.canAccessSales = false;
3618
+ _this.canAccessConcierge = false;
3619
+ _this.canAccessBrands = false;
3620
+ _this.canAccessDashboard = false;
3621
+ _this.canAccessOrders = false;
3622
+ _this.canAccessCompanyProfile = false;
3623
+ _this.canAccessAutomations = false;
3624
+ _this.canAccessMarketplace = false;
3625
+ _this.canEnableApps = false;
3626
+ _this.canAccessRetailBilling = false;
4442
3627
  return _this;
4443
3628
  }
4444
3629
  return PartnerPersona;
@@ -4481,92 +3666,408 @@
4481
3666
  return SMBPersona;
4482
3667
  }(NamespacedPersona));
4483
3668
 
4484
- var VendorPersona = /** @class */ (function (_super) {
4485
- __extends(VendorPersona, _super);
4486
- function VendorPersona() {
4487
- var _this = _super.apply(this, __spread(arguments)) || this;
4488
- _this.type = exports.PersonaType.vendor;
4489
- return _this;
3669
+ var VendorPersona = /** @class */ (function (_super) {
3670
+ __extends(VendorPersona, _super);
3671
+ function VendorPersona() {
3672
+ var _this = _super.apply(this, __spread(arguments)) || this;
3673
+ _this.type = exports.PersonaType.vendor;
3674
+ return _this;
3675
+ }
3676
+ return VendorPersona;
3677
+ }(TypedPersona));
3678
+
3679
+ var DigitalAgentPersona = /** @class */ (function (_super) {
3680
+ __extends(DigitalAgentPersona, _super);
3681
+ function DigitalAgentPersona() {
3682
+ var _this = _super.apply(this, __spread(arguments)) || this;
3683
+ _this.type = exports.PersonaType.digital_agent;
3684
+ return _this;
3685
+ }
3686
+ return DigitalAgentPersona;
3687
+ }(TypedPersona));
3688
+
3689
+ var SuccessPersona = /** @class */ (function (_super) {
3690
+ __extends(SuccessPersona, _super);
3691
+ function SuccessPersona() {
3692
+ var _this = _super.apply(this, __spread(arguments)) || this;
3693
+ _this.type = exports.PersonaType.success;
3694
+ return _this;
3695
+ }
3696
+ return SuccessPersona;
3697
+ }(TypedPersona));
3698
+
3699
+ var AccountGroupPersona = /** @class */ (function (_super) {
3700
+ __extends(AccountGroupPersona, _super);
3701
+ function AccountGroupPersona() {
3702
+ var _this = _super.apply(this, __spread(arguments)) || this;
3703
+ _this.type = exports.PersonaType.account_group;
3704
+ return _this;
3705
+ }
3706
+ return AccountGroupPersona;
3707
+ }(TypedPersona));
3708
+
3709
+ function fromPersona(persona) {
3710
+ var type = getTypeFromContext(persona.context);
3711
+ if (type === null) {
3712
+ return null;
3713
+ }
3714
+ var personaCls = getPersonaFromType(type);
3715
+ personaCls.fromPersona(persona);
3716
+ return personaCls;
3717
+ }
3718
+ function getTypeFromContext(ctx) {
3719
+ var type = (!!ctx.namespaced) ? ctx.namespaced.type : ctx.typed.type;
3720
+ switch (type) {
3721
+ case 'partner':
3722
+ return exports.PersonaType.partner;
3723
+ case 'partner_app':
3724
+ return exports.PersonaType.partner_app;
3725
+ case 'sales_person':
3726
+ return exports.PersonaType.sales_person;
3727
+ case 'smb':
3728
+ return exports.PersonaType.smb;
3729
+ case 'vendor':
3730
+ return exports.PersonaType.vendor;
3731
+ case 'digital_agent':
3732
+ return exports.PersonaType.digital_agent;
3733
+ case 'developer':
3734
+ return exports.PersonaType.developer;
3735
+ case 'success':
3736
+ return exports.PersonaType.success;
3737
+ case 'account_group':
3738
+ return exports.PersonaType.account_group;
3739
+ }
3740
+ return null;
3741
+ }
3742
+ function getPersonaFromType(personaType) {
3743
+ return new {
3744
+ 'partner': PartnerPersona,
3745
+ 'partner_app': PartnerAppPersona,
3746
+ 'sales_person': SalespersonPersona,
3747
+ 'smb': SMBPersona,
3748
+ 'vendor': VendorPersona,
3749
+ 'digital_agent': DigitalAgentPersona,
3750
+ 'developer': DeveloperPersona,
3751
+ 'success': SuccessPersona,
3752
+ 'account_group': AccountGroupPersona
3753
+ }[personaType]();
3754
+ }
3755
+
3756
+ function enumStringToValue$8(enumRef, value) {
3757
+ if (typeof value === 'number') {
3758
+ return value;
3759
+ }
3760
+ return enumRef[value];
3761
+ }
3762
+ var Access = /** @class */ (function () {
3763
+ function Access(kwargs) {
3764
+ if (!kwargs) {
3765
+ return;
3766
+ }
3767
+ Object.assign(this, kwargs);
3768
+ }
3769
+ Access.fromProto = function (proto) {
3770
+ var m = new Access();
3771
+ m = Object.assign(m, proto);
3772
+ return m;
3773
+ };
3774
+ Access.prototype.toApiJson = function () {
3775
+ var toReturn = {};
3776
+ if (typeof this.scope !== 'undefined') {
3777
+ toReturn['scope'] = this.scope;
3778
+ }
3779
+ if (typeof this.public !== 'undefined') {
3780
+ toReturn['public'] = this.public;
3781
+ }
3782
+ return toReturn;
3783
+ };
3784
+ return Access;
3785
+ }());
3786
+
3787
+ // *********************************
3788
+
3789
+ var HostService = /** @class */ (function () {
3790
+ function HostService(environmentService) {
3791
+ this.environmentService = environmentService;
3792
+ }
3793
+ HostService.prototype.host = function () {
3794
+ if (this._host) {
3795
+ return this._host;
3796
+ }
3797
+ switch (this.environmentService.getEnvironment()) {
3798
+ case i1.Environment.LOCAL:
3799
+ this._host = 'iam.vendasta-local.com';
3800
+ break;
3801
+ case i1.Environment.TEST:
3802
+ this._host = '';
3803
+ break;
3804
+ case i1.Environment.DEMO:
3805
+ this._host = 'iam-api-demo.apigateway.co';
3806
+ break;
3807
+ case i1.Environment.PROD:
3808
+ this._host = 'iam-api-prod.apigateway.co';
3809
+ break;
3810
+ }
3811
+ return this._host;
3812
+ };
3813
+ HostService.prototype.httpsHost = function () {
3814
+ if (this._httpsHost) {
3815
+ return this._httpsHost;
3816
+ }
3817
+ switch (this.environmentService.getEnvironment()) {
3818
+ case i1.Environment.LOCAL:
3819
+ this._httpsHost = 'iam.vendasta-local.com';
3820
+ break;
3821
+ case i1.Environment.TEST:
3822
+ this._httpsHost = '';
3823
+ break;
3824
+ case i1.Environment.DEMO:
3825
+ this._httpsHost = 'iam-demo.apigateway.co';
3826
+ break;
3827
+ case i1.Environment.PROD:
3828
+ this._httpsHost = 'iam-prod.apigateway.co';
3829
+ break;
3830
+ }
3831
+ return this._httpsHost;
3832
+ };
3833
+ HostService.prototype.hostWithScheme = function () {
3834
+ var scheme = this.environmentService.getEnvironment() === i1.Environment.LOCAL ? 'http://' : 'https://';
3835
+ return scheme + this.host();
3836
+ };
3837
+ HostService.prototype.httpsHostWithScheme = function () {
3838
+ var scheme = this.environmentService.getEnvironment() === i1.Environment.LOCAL ? 'http://' : 'https://';
3839
+ return scheme + this.httpsHost();
3840
+ };
3841
+ return HostService;
3842
+ }());
3843
+ HostService.ɵfac = function HostService_Factory(t) { return new (t || HostService)(i0.ɵɵinject(i1.EnvironmentService)); };
3844
+ HostService.ɵprov = i0.ɵɵdefineInjectable({ token: HostService, factory: HostService.ɵfac, providedIn: 'root' });
3845
+ /*@__PURE__*/ (function () {
3846
+ i0.ɵsetClassMetadata(HostService, [{
3847
+ type: i0.Injectable,
3848
+ args: [{ providedIn: 'root' }]
3849
+ }], function () { return [{ type: i1.EnvironmentService }]; }, null);
3850
+ })();
3851
+
3852
+ // *********************************
3853
+ var UserIAMApiService = /** @class */ (function () {
3854
+ function UserIAMApiService(http, hostService) {
3855
+ this.http = http;
3856
+ this.hostService = hostService;
3857
+ }
3858
+ UserIAMApiService.prototype.apiOptions = function () {
3859
+ return {
3860
+ headers: new i1$1.HttpHeaders({
3861
+ 'Content-Type': 'application/json'
3862
+ }),
3863
+ withCredentials: true
3864
+ };
3865
+ };
3866
+ UserIAMApiService.prototype.getSubjectBySession = function (r) {
3867
+ var request = (r.toApiJson) ? r : new GetSubjectBySessionRequest(r);
3868
+ return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetSubjectBySession", request.toApiJson(), this.apiOptions())
3869
+ .pipe(operators.map(function (resp) { return GetSubjectResponse.fromProto(resp); }), operators.share());
3870
+ };
3871
+ UserIAMApiService.prototype.listPersonas = function (r) {
3872
+ var request = (r.toApiJson) ? r : new ListPersonasRequest(r);
3873
+ return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/ListPersonas", request.toApiJson(), this.apiOptions())
3874
+ .pipe(operators.map(function (resp) { return ListPersonasResponse.fromProto(resp); }), operators.share());
3875
+ };
3876
+ UserIAMApiService.prototype.getToken = function (r) {
3877
+ var request = (r.toApiJson) ? r : new GetTokenRequest(r);
3878
+ return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetToken", request.toApiJson(), this.apiOptions())
3879
+ .pipe(operators.map(function (resp) { return GetTokenResponse.fromProto(resp); }), operators.share());
3880
+ };
3881
+ UserIAMApiService.prototype.getSessionToken = function (r) {
3882
+ var request = (r.toApiJson) ? r : new GetSessionTokenRequest(r);
3883
+ return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetSessionToken", request.toApiJson(), this.apiOptions())
3884
+ .pipe(operators.map(function (resp) { return GetTokenResponse.fromProto(resp); }), operators.share());
3885
+ };
3886
+ UserIAMApiService.prototype.resetPasswordWithToken = function (r) {
3887
+ var request = (r.toApiJson) ? r : new ResetPasswordWithTokenRequest(r);
3888
+ return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/ResetPasswordWithToken", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
3889
+ };
3890
+ UserIAMApiService.prototype.getImpersonationToken = function (r) {
3891
+ var request = (r.toApiJson) ? r : new GetImpersonationTokenRequest(r);
3892
+ return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.UserIAM/GetImpersonationToken", request.toApiJson(), this.apiOptions())
3893
+ .pipe(operators.map(function (resp) { return GetImpersonationTokenResponse.fromProto(resp); }), operators.share());
3894
+ };
3895
+ return UserIAMApiService;
3896
+ }());
3897
+ UserIAMApiService.ɵfac = function UserIAMApiService_Factory(t) { return new (t || UserIAMApiService)(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); };
3898
+ UserIAMApiService.ɵprov = i0.ɵɵdefineInjectable({ token: UserIAMApiService, factory: UserIAMApiService.ɵfac, providedIn: 'root' });
3899
+ /*@__PURE__*/ (function () {
3900
+ i0.ɵsetClassMetadata(UserIAMApiService, [{
3901
+ type: i0.Injectable,
3902
+ args: [{ providedIn: 'root' }]
3903
+ }], function () { return [{ type: i1$1.HttpClient }, { type: HostService }]; }, null);
3904
+ })();
3905
+
3906
+ var LoginRequest = /** @class */ (function () {
3907
+ function LoginRequest(kwargs) {
3908
+ if (!kwargs) {
3909
+ return;
3910
+ }
3911
+ Object.assign(this, kwargs);
4490
3912
  }
4491
- return VendorPersona;
4492
- }(TypedPersona));
4493
-
4494
- var DigitalAgentPersona = /** @class */ (function (_super) {
4495
- __extends(DigitalAgentPersona, _super);
4496
- function DigitalAgentPersona() {
4497
- var _this = _super.apply(this, __spread(arguments)) || this;
4498
- _this.type = exports.PersonaType.digital_agent;
4499
- return _this;
3913
+ LoginRequest.fromProto = function (proto) {
3914
+ if (!proto) {
3915
+ return new LoginRequest();
3916
+ }
3917
+ var m = new LoginRequest();
3918
+ m = Object.assign(m, proto);
3919
+ return m;
3920
+ };
3921
+ LoginRequest.prototype.toApiJson = function () {
3922
+ if (typeof this.namespace === 'undefined' &&
3923
+ typeof this.type === 'undefined' &&
3924
+ typeof this.email === 'undefined' &&
3925
+ typeof this.password === 'undefined' &&
3926
+ typeof this.providerIdToken === 'undefined' &&
3927
+ typeof this.provider === 'undefined') {
3928
+ return {};
3929
+ }
3930
+ return {
3931
+ 'namespace': (typeof this.namespace !== 'undefined') ? this.namespace : null,
3932
+ 'type': (typeof this.type !== 'undefined') ? this.type : null,
3933
+ 'email': (typeof this.email !== 'undefined') ? this.email : null,
3934
+ 'password': (typeof this.password !== 'undefined') ? this.password : null,
3935
+ 'provider_id_token': (typeof this.providerIdToken !== 'undefined') ? this.providerIdToken : null,
3936
+ 'provider': (typeof this.provider !== 'undefined') ? this.provider : null
3937
+ };
3938
+ };
3939
+ return LoginRequest;
3940
+ }());
3941
+ var LoginResponse = /** @class */ (function () {
3942
+ function LoginResponse(kwargs) {
3943
+ if (!kwargs) {
3944
+ return;
3945
+ }
3946
+ Object.assign(this, kwargs);
4500
3947
  }
4501
- return DigitalAgentPersona;
4502
- }(TypedPersona));
4503
-
4504
- var SuccessPersona = /** @class */ (function (_super) {
4505
- __extends(SuccessPersona, _super);
4506
- function SuccessPersona() {
4507
- var _this = _super.apply(this, __spread(arguments)) || this;
4508
- _this.type = exports.PersonaType.success;
4509
- return _this;
3948
+ LoginResponse.fromProto = function (proto) {
3949
+ var m = new LoginResponse();
3950
+ m.sessionId = proto['session_id'];
3951
+ return m;
3952
+ };
3953
+ LoginResponse.prototype.toApiJson = function () {
3954
+ if (typeof this.sessionId === 'undefined') {
3955
+ return {};
3956
+ }
3957
+ return {
3958
+ 'sessionId': (typeof this.sessionId !== 'undefined') ? this.sessionId : null
3959
+ };
3960
+ };
3961
+ return LoginResponse;
3962
+ }());
3963
+ var LogoutResponse = /** @class */ (function () {
3964
+ function LogoutResponse(kwargs) {
3965
+ if (!kwargs) {
3966
+ return;
3967
+ }
3968
+ Object.assign(this, kwargs);
4510
3969
  }
4511
- return SuccessPersona;
4512
- }(TypedPersona));
4513
-
4514
- var AccountGroupPersona = /** @class */ (function (_super) {
4515
- __extends(AccountGroupPersona, _super);
4516
- function AccountGroupPersona() {
4517
- var _this = _super.apply(this, __spread(arguments)) || this;
4518
- _this.type = exports.PersonaType.account_group;
4519
- return _this;
3970
+ LogoutResponse.fromProto = function (proto) {
3971
+ var m = new LogoutResponse();
3972
+ m = Object.assign(m, proto);
3973
+ return m;
3974
+ };
3975
+ LogoutResponse.prototype.toApiJson = function () {
3976
+ if (typeof this.success === 'undefined') {
3977
+ return {};
3978
+ }
3979
+ return {
3980
+ 'success': (typeof this.success !== 'undefined') ? this.success : null
3981
+ };
3982
+ };
3983
+ return LogoutResponse;
3984
+ }());
3985
+ var SSOLoginRequest = /** @class */ (function () {
3986
+ function SSOLoginRequest(kwargs) {
3987
+ if (!kwargs) {
3988
+ return;
3989
+ }
3990
+ Object.assign(this, kwargs);
4520
3991
  }
4521
- return AccountGroupPersona;
4522
- }(TypedPersona));
3992
+ SSOLoginRequest.fromProto = function (proto) {
3993
+ var m = new SSOLoginRequest();
3994
+ m = Object.assign(m, proto);
3995
+ return m;
3996
+ };
3997
+ SSOLoginRequest.prototype.toApiJson = function () {
3998
+ if (typeof this.nextUrl === 'undefined' &&
3999
+ typeof this.namespace === 'undefined' &&
4000
+ typeof this.type === 'undefined') {
4001
+ return null;
4002
+ }
4003
+ return {
4004
+ 'next_url': (typeof this.nextUrl !== 'undefined') ? this.nextUrl : null,
4005
+ 'namespace': (typeof this.namespace !== 'undefined') ? this.namespace : null,
4006
+ 'type': (typeof this.type !== 'undefined') ? this.type : null
4007
+ };
4008
+ };
4009
+ return SSOLoginRequest;
4010
+ }());
4523
4011
 
4524
- function fromPersona(persona) {
4525
- var type = getTypeFromContext(persona.context);
4526
- if (type === null) {
4527
- return null;
4528
- }
4529
- var personaCls = getPersonaFromType(type);
4530
- personaCls.fromPersona(persona);
4531
- return personaCls;
4532
- }
4533
- function getTypeFromContext(ctx) {
4534
- var type = (!!ctx.namespaced) ? ctx.namespaced.type : ctx.typed.type;
4535
- switch (type) {
4536
- case 'partner':
4537
- return exports.PersonaType.partner;
4538
- case 'partner_app':
4539
- return exports.PersonaType.partner_app;
4540
- case 'sales_person':
4541
- return exports.PersonaType.sales_person;
4542
- case 'smb':
4543
- return exports.PersonaType.smb;
4544
- case 'vendor':
4545
- return exports.PersonaType.vendor;
4546
- case 'digital_agent':
4547
- return exports.PersonaType.digital_agent;
4548
- case 'developer':
4549
- return exports.PersonaType.developer;
4550
- case 'success':
4551
- return exports.PersonaType.success;
4552
- case 'account_group':
4553
- return exports.PersonaType.account_group;
4012
+ var IamHttpApiService = /** @class */ (function () {
4013
+ function IamHttpApiService(http, hostService) {
4014
+ this.http = http;
4015
+ this.hostService = hostService;
4554
4016
  }
4555
- return null;
4556
- }
4557
- function getPersonaFromType(personaType) {
4558
- return new {
4559
- 'partner': PartnerPersona,
4560
- 'partner_app': PartnerAppPersona,
4561
- 'sales_person': SalespersonPersona,
4562
- 'smb': SMBPersona,
4563
- 'vendor': VendorPersona,
4564
- 'digital_agent': DigitalAgentPersona,
4565
- 'developer': DeveloperPersona,
4566
- 'success': SuccessPersona,
4567
- 'account_group': AccountGroupPersona
4568
- }[personaType]();
4569
- }
4017
+ IamHttpApiService.prototype.apiOptions = function (includeCredentials) {
4018
+ if (includeCredentials) {
4019
+ return {
4020
+ headers: new i1$1.HttpHeaders({
4021
+ 'Content-Type': 'application/x-www-form-urlencoded',
4022
+ }),
4023
+ withCredentials: true,
4024
+ };
4025
+ }
4026
+ return {
4027
+ headers: new i1$1.HttpHeaders({
4028
+ 'Content-Type': 'application/x-www-form-urlencoded',
4029
+ }),
4030
+ };
4031
+ };
4032
+ IamHttpApiService.prototype.login = function (r) {
4033
+ var toApiJson = r.toApiJson;
4034
+ var request = typeof toApiJson !== 'undefined' ? r : new LoginRequest(r);
4035
+ return this.http
4036
+ .post(this.hostService.httpsHostWithScheme() + '/_ajax/v1/login', request.toApiJson(), this.apiOptions())
4037
+ .pipe(operators.map(function (resp) { return LoginResponse.fromProto(resp); }), operators.share());
4038
+ };
4039
+ IamHttpApiService.prototype.logout = function () {
4040
+ return this.http
4041
+ .post(this.hostService.httpsHostWithScheme() + '/_ajax/v1/logout', {}, this.apiOptions(true))
4042
+ .pipe(operators.map(function (resp) { return LogoutResponse.fromProto(resp); }), operators.share());
4043
+ };
4044
+ IamHttpApiService.prototype.ssoLogin = function (r) {
4045
+ var toApiJson = r.toApiJson;
4046
+ var request = typeof toApiJson !== 'undefined' ? r : new SSOLoginRequest(r);
4047
+ var params = new URLSearchParams();
4048
+ var apiJson = request.toApiJson();
4049
+ for (var key in apiJson) {
4050
+ if (!apiJson.hasOwnProperty(key)) {
4051
+ continue;
4052
+ }
4053
+ var value = apiJson[key];
4054
+ if (value === null) {
4055
+ continue;
4056
+ }
4057
+ params.append(key, value);
4058
+ }
4059
+ window.location.href = this.hostService.httpsHostWithScheme() + "/sso-login?" + params.toString();
4060
+ };
4061
+ return IamHttpApiService;
4062
+ }());
4063
+ IamHttpApiService.ɵfac = function IamHttpApiService_Factory(t) { return new (t || IamHttpApiService)(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); };
4064
+ IamHttpApiService.ɵprov = i0.ɵɵdefineInjectable({ token: IamHttpApiService, factory: IamHttpApiService.ɵfac, providedIn: 'root' });
4065
+ /*@__PURE__*/ (function () {
4066
+ i0.ɵsetClassMetadata(IamHttpApiService, [{
4067
+ type: i0.Injectable,
4068
+ args: [{ providedIn: 'root' }]
4069
+ }], function () { return [{ type: i1$1.HttpClient }, { type: HostService }]; }, null);
4070
+ })();
4570
4071
 
4571
4072
  // *********************************
4572
4073
  var IAMApiService = /** @class */ (function () {
@@ -4576,7 +4077,7 @@
4576
4077
  }
4577
4078
  IAMApiService.prototype.apiOptions = function () {
4578
4079
  return {
4579
- headers: new http.HttpHeaders({
4080
+ headers: new i1$1.HttpHeaders({
4580
4081
  'Content-Type': 'application/json'
4581
4082
  }),
4582
4083
  withCredentials: true
@@ -4737,13 +4238,14 @@
4737
4238
  };
4738
4239
  return IAMApiService;
4739
4240
  }());
4740
- IAMApiService.decorators = [
4741
- { type: core$1.Injectable }
4742
- ];
4743
- IAMApiService.ctorParameters = function () { return [
4744
- { type: http.HttpClient },
4745
- { type: HostService }
4746
- ]; };
4241
+ IAMApiService.ɵfac = function IAMApiService_Factory(t) { return new (t || IAMApiService)(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(HostService)); };
4242
+ IAMApiService.ɵprov = i0.ɵɵdefineInjectable({ token: IAMApiService, factory: IAMApiService.ɵfac, providedIn: 'root' });
4243
+ /*@__PURE__*/ (function () {
4244
+ i0.ɵsetClassMetadata(IAMApiService, [{
4245
+ type: i0.Injectable,
4246
+ args: [{ providedIn: 'root' }]
4247
+ }], function () { return [{ type: i1$1.HttpClient }, { type: HostService }]; }, null);
4248
+ })();
4747
4249
 
4748
4250
  var IAMService = /** @class */ (function () {
4749
4251
  function IAMService(api, httpApi, sessionService, iamApi) {
@@ -4890,80 +4392,14 @@
4890
4392
  };
4891
4393
  return IAMService;
4892
4394
  }());
4893
- IAMService.decorators = [
4894
- { type: core$1.Injectable }
4895
- ];
4896
- IAMService.ctorParameters = function () { return [
4897
- { type: UserIAMApiService },
4898
- { type: IamHttpApiService },
4899
- { type: core.SessionService },
4900
- { type: IAMApiService }
4901
- ]; };
4902
-
4903
- // *********************************
4904
- var IAMSsoApiService = /** @class */ (function () {
4905
- function IAMSsoApiService(http, hostService) {
4906
- this.http = http;
4907
- this.hostService = hostService;
4908
- }
4909
- IAMSsoApiService.prototype.apiOptions = function () {
4910
- return {
4911
- headers: new http.HttpHeaders({
4912
- 'Content-Type': 'application/json'
4913
- }),
4914
- withCredentials: true
4915
- };
4916
- };
4917
- IAMSsoApiService.prototype.getSessionForUser = function (r) {
4918
- var request = (r.toApiJson) ? r : new GetSessionForUserRequest(r);
4919
- return this.http.post(this.hostService.hostWithScheme() + "/iam.v1.IAMSso/GetSessionForUser", request.toApiJson(), this.apiOptions())
4920
- .pipe(operators.map(function (resp) { return GetSessionForUserResponse.fromProto(resp); }), operators.share());
4921
- };
4922
- return IAMSsoApiService;
4923
- }());
4924
- IAMSsoApiService.decorators = [
4925
- { type: core$1.Injectable }
4926
- ];
4927
- IAMSsoApiService.ctorParameters = function () { return [
4928
- { type: http.HttpClient },
4929
- { type: HostService }
4930
- ]; };
4931
-
4932
- // *********************************
4933
- var IamInternalModule = /** @class */ (function () {
4934
- function IamInternalModule() {
4935
- }
4936
- return IamInternalModule;
4937
- }());
4938
- IamInternalModule.decorators = [
4939
- { type: core$1.NgModule, args: [{
4940
- imports: [core.SessionServiceModule, core.EnvironmentServiceModule],
4941
- providers: [
4942
- IAMApiService,
4943
- IAMSsoApiService,
4944
- UserIAMApiService,
4945
- HostService
4946
- ],
4947
- declarations: [],
4948
- exports: [],
4949
- entryComponents: []
4950
- },] }
4951
- ];
4952
-
4953
- var IamModule = /** @class */ (function () {
4954
- function IamModule() {
4955
- }
4956
- return IamModule;
4957
- }());
4958
- IamModule.decorators = [
4959
- { type: core$1.NgModule, args: [{
4960
- imports: [IamInternalModule],
4961
- providers: [IAMService, IamHttpApiService],
4962
- declarations: [],
4963
- exports: [],
4964
- entryComponents: []
4965
- },] }
4966
- ];
4395
+ IAMService.ɵfac = function IAMService_Factory(t) { return new (t || IAMService)(i0.ɵɵinject(UserIAMApiService), i0.ɵɵinject(IamHttpApiService), i0.ɵɵinject(i1.SessionService), i0.ɵɵinject(IAMApiService)); };
4396
+ IAMService.ɵprov = i0.ɵɵdefineInjectable({ token: IAMService, factory: IAMService.ɵfac, providedIn: 'root' });
4397
+ /*@__PURE__*/ (function () {
4398
+ i0.ɵsetClassMetadata(IAMService, [{
4399
+ type: i0.Injectable,
4400
+ args: [{ providedIn: 'root' }]
4401
+ }], function () { return [{ type: UserIAMApiService }, { type: IamHttpApiService }, { type: i1.SessionService }, { type: IAMApiService }]; }, null);
4402
+ })();
4967
4403
 
4968
4404
  // *********************************
4969
4405
 
@@ -4971,6 +4407,7 @@
4971
4407
  * Generated bundle index. Do not edit.
4972
4408
  */
4973
4409
 
4410
+ exports.Access = Access;
4974
4411
  exports.AccessCheckFailures = AccessCheckFailures;
4975
4412
  exports.AccessResourceRequest = AccessResourceRequest;
4976
4413
  exports.AccessResourceRequestResourceEntityIdentifierEntry = AccessResourceRequestResourceEntityIdentifierEntry;
@@ -5001,8 +4438,6 @@
5001
4438
  exports.GetMultiUsersResponse = GetMultiUsersResponse;
5002
4439
  exports.GetMultiUsersResponseUserContainer = GetMultiUsersResponseUserContainer;
5003
4440
  exports.GetResetPasswordTokenRequest = GetResetPasswordTokenRequest;
5004
- exports.GetSessionForUserRequest = GetSessionForUserRequest;
5005
- exports.GetSessionForUserResponse = GetSessionForUserResponse;
5006
4441
  exports.GetSessionTokenRequest = GetSessionTokenRequest;
5007
4442
  exports.GetShortLivedTokenRequest = GetShortLivedTokenRequest;
5008
4443
  exports.GetSubjectBySessionRequest = GetSubjectBySessionRequest;
@@ -5018,8 +4453,6 @@
5018
4453
  exports.IAMApiService = IAMApiService;
5019
4454
  exports.IAMListPersonasRequest = IAMListPersonasRequest;
5020
4455
  exports.IAMService = IAMService;
5021
- exports.IAMSsoApiService = IAMSsoApiService;
5022
- exports.IamModule = IamModule;
5023
4456
  exports.Identifier = Identifier;
5024
4457
  exports.IfClause = IfClause;
5025
4458
  exports.ListAttribute = ListAttribute;
@@ -5091,11 +4524,6 @@
5091
4524
  exports.VendorPersona = VendorPersona;
5092
4525
  exports.VerifyEmailRequest = VerifyEmailRequest;
5093
4526
  exports.fromPersona = fromPersona;
5094
- exports.ɵa = UserIAMApiService;
5095
- exports.ɵb = IamHttpApiService;
5096
- exports.ɵc = IAMApiService;
5097
- exports.ɵd = IamInternalModule;
5098
- exports.ɵe = IAMSsoApiService;
5099
4527
 
5100
4528
  Object.defineProperty(exports, '__esModule', { value: true });
5101
4529