@vendasta/iam 2.0.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 (89) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +113 -0
  3. package/bundles/vendasta-iam.umd.js +815 -1350
  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 +7 -8
  8. package/esm2015/lib/_generated/index.js +1 -1
  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 +7 -9
  16. package/esm2015/lib/_internal/index.js +1 -2
  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 +14 -380
  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 +5 -320
  34. package/esm2015/lib/_internal/objects/security-logs.js +1 -8
  35. package/esm2015/lib/_internal/objects/subjects.js +2 -232
  36. package/esm2015/lib/_internal/objects/users.js +1 -32
  37. package/esm2015/lib/_internal/user-iam.api.service.js +7 -9
  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 +7 -9
  41. package/esm2015/lib/iam.service.js +7 -11
  42. package/esm2015/lib/index.js +1 -1
  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 +2 -1
  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 +1 -1
  57. package/esm2015/vendasta-iam.js +1 -1
  58. package/fesm2015/vendasta-iam.js +377 -913
  59. package/fesm2015/vendasta-iam.js.map +1 -1
  60. package/lib/_generated/host.service.d.ts +3 -0
  61. package/lib/_internal/enums/index.d.ts +2 -1
  62. package/lib/_internal/enums/policies.enum.d.ts +9 -0
  63. package/lib/_internal/enums/resources.enum.d.ts +0 -9
  64. package/lib/_internal/iam.api.service.d.ts +3 -0
  65. package/lib/_internal/index.d.ts +0 -1
  66. package/lib/_internal/interfaces/annotations.interface.d.ts +4 -0
  67. package/lib/_internal/interfaces/api.interface.d.ts +5 -17
  68. package/lib/_internal/interfaces/attributes.interface.d.ts +26 -0
  69. package/lib/_internal/interfaces/index.d.ts +6 -3
  70. package/lib/_internal/interfaces/policies.interface.d.ts +42 -0
  71. package/lib/_internal/interfaces/resources.interface.d.ts +2 -41
  72. package/lib/_internal/interfaces/subjects.interface.d.ts +1 -26
  73. package/lib/_internal/objects/annotations.d.ts +9 -0
  74. package/lib/_internal/objects/api.d.ts +5 -23
  75. package/lib/_internal/objects/attributes.d.ts +43 -0
  76. package/lib/_internal/objects/index.d.ts +6 -3
  77. package/lib/_internal/objects/policies.d.ts +68 -0
  78. package/lib/_internal/objects/resources.d.ts +2 -65
  79. package/lib/_internal/objects/subjects.d.ts +1 -41
  80. package/lib/_internal/user-iam.api.service.d.ts +3 -0
  81. package/lib/http/iam.http.api.service.d.ts +3 -0
  82. package/lib/iam.service.d.ts +3 -0
  83. package/lib/personas/base-personas.d.ts +1 -1
  84. package/lib/personas/partner.d.ts +1 -0
  85. package/package.json +5 -3
  86. package/vendasta-iam.d.ts +1 -0
  87. package/esm2015/lib/_internal/iam-sso.api.service.js +0 -42
  88. package/lib/_internal/iam-sso.api.service.d.ts +0 -12
  89. package/vendasta-iam.metadata.json +0 -1
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@vendasta/core"),require("rxjs/operators"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@vendasta/iam",["exports","@angular/core","@vendasta/core","rxjs/operators","@angular/common/http"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).vendasta=t.vendasta||{},t.vendasta.iam={}),t.ng.core,t.i1,t.rxjs.operators,t.ng.common.http)}(this,(function(t,e,i,s,o){"use strict";
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs/operators"),require("@angular/common/http"),require("@vendasta/core")):"function"==typeof define&&define.amd?define("@vendasta/iam",["exports","@angular/core","rxjs/operators","@angular/common/http","@vendasta/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).vendasta=t.vendasta||{},t.vendasta.iam={}),t.ng.core,t.rxjs.operators,t.ng.common.http,t.i1)}(this,(function(t,e,i,s,o){"use strict";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function n(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}Object.create;function u(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,o,r=i.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(s=r.next()).done;)n.push(s.value)}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return n}function c(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}var h,p,d,f,v,l,b,m;Object.create;(h=t.AlgorithmType||(t.AlgorithmType={}))[h.ALGORITHM_TYPE_ES256=0]="ALGORITHM_TYPE_ES256",h[h.ALGORITHM_TYPE_RS256=1]="ALGORITHM_TYPE_RS256",(p=t.OrderByDirection||(t.OrderByDirection={}))[p.ASCENDING=0]="ASCENDING",p[p.DESCENDING=1]="DESCENDING",(d=t.AccessScope||(t.AccessScope={}))[d.READ=0]="READ",d[d.WRITE=1]="WRITE",d[d.DELETE=2]="DELETE",d[d.LIST=3]="LIST",(f=t.BooleanOperator||(t.BooleanOperator={}))[f.AND=0]="AND",f[f.OR=1]="OR",f[f.NOT=2]="NOT",(v=t.ForOperator||(t.ForOperator={}))[v.ANY=0]="ANY",v[v.ALL=1]="ALL",(l=t.RestrictionType||(t.RestrictionType={}))[l.RESTRICTION_TYPE_UNSET=0]="RESTRICTION_TYPE_UNSET",l[l.RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN=1]="RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN",l[l.RESTRICTION_TYPE_FROZEN=2]="RESTRICTION_TYPE_FROZEN",(b=t.SortDirection||(t.SortDirection={}))[b.SORT_DIRECTION_INVALID=0]="SORT_DIRECTION_INVALID",b[b.SORT_DIRECTION_ASCENDING=1]="SORT_DIRECTION_ASCENDING",b[b.SORT_DIRECTION_DESCENDING=2]="SORT_DIRECTION_DESCENDING",(m=t.UserSortField||(t.UserSortField={}))[m.USER_SORT_FIELD_INVALID=0]="USER_SORT_FIELD_INVALID",m[m.USER_SORT_FIELD_CREATED=1]="USER_SORT_FIELD_CREATED",m[m.USER_SORT_FIELD_FIRST_NAME=2]="USER_SORT_FIELD_FIRST_NAME",m[m.USER_SORT_FIELD_LAST_NAME=3]="USER_SORT_FIELD_LAST_NAME",m[m.USER_SORT_FIELD_EMAIL=4]="USER_SORT_FIELD_EMAIL",m[m.USER_SORT_FIELD_LAST_LOGIN=5]="USER_SORT_FIELD_LAST_LOGIN";var A=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.intAttribute&&(i.intAttribute=parseInt(e.intAttribute,10)),e.structAttribute&&(i.structAttribute=T.fromProto(e.structAttribute)),e.listAttribute&&(i.listAttribute=I.fromProto(e.listAttribute)),e.timestampAttribute&&(i.timestampAttribute=new Date(e.timestampAttribute)),e.geopointAttribute&&(i.geopointAttribute=j.fromProto(e.geopointAttribute)),i},t.prototype.toApiJson=function(){if(void 0===this.intAttribute&&void 0===this.doubleAttribute&&void 0===this.stringAttribute&&void 0===this.boolAttribute&&void 0===this.structAttribute&&void 0===this.listAttribute&&void 0===this.timestampAttribute&&void 0===this.geopointAttribute)return{};var t={};return void 0!==this.intAttribute&&(t.intAttribute=this.intAttribute),void 0!==this.doubleAttribute&&(t.doubleAttribute=this.doubleAttribute),void 0!==this.stringAttribute&&(t.stringAttribute=this.stringAttribute),void 0!==this.boolAttribute&&(t.boolAttribute=this.boolAttribute),void 0!==this.structAttribute&&null!==this.structAttribute&&(t.structAttribute="toApiJson"in this.structAttribute?this.structAttribute.toApiJson():this.structAttribute),void 0!==this.listAttribute&&null!==this.listAttribute&&(t.listAttribute="toApiJson"in this.listAttribute?this.listAttribute.toApiJson():this.listAttribute),void 0!==this.timestampAttribute&&null!==this.timestampAttribute&&(t.timestampAttribute="toApiJson"in this.timestampAttribute?this.timestampAttribute.toApiJson():this.timestampAttribute),void 0!==this.geopointAttribute&&null!==this.geopointAttribute&&(t.geopointAttribute="toApiJson"in this.geopointAttribute?this.geopointAttribute.toApiJson():this.geopointAttribute),t},t}(),y=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.value&&(i.value=A.fromProto(e.value)),i},t.prototype.toApiJson=function(){if(void 0===this.key&&void 0===this.value)return{};var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&null!==this.value&&(t.value="toApiJson"in this.value?this.value.toApiJson():this.value),t},t}(),g=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.namespaced&&(i.namespaced=S.fromProto(e.namespaced)),e.typed&&(i.typed=M.fromProto(e.typed)),i},t.prototype.toApiJson=function(){if(void 0===this.namespaced&&void 0===this.typed)return{};var t={};return void 0!==this.namespaced&&null!==this.namespaced&&(t.namespaced="toApiJson"in this.namespaced?this.namespaced.toApiJson():this.namespaced),void 0!==this.typed&&null!==this.typed&&(t.typed="toApiJson"in this.typed?this.typed.toApiJson():this.typed),t},t}(),j=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.latitude&&void 0===this.longitude)return{};var t={};return void 0!==this.latitude&&(t.latitude=this.latitude),void 0!==this.longitude&&(t.longitude=this.longitude),t},t}(),I=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.attributes&&(i.attributes=e.attributes.map(A.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.attributes)return{};var t={};return void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),t},t}(),J=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.key&&void 0===this.values)return{};var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.values&&(t.values=this.values),t},t}(),O=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.add&&(i.add=R.fromProto(e.add)),e.replace&&(i.replace=J.fromProto(e.replace)),e.remove&&(i.remove=R.fromProto(e.remove)),e.replaceAttributes&&(i.replaceAttributes=T.fromProto(e.replaceAttributes)),e.addAttributes&&(i.addAttributes=T.fromProto(e.addAttributes)),e.removeAttributes&&(i.removeAttributes=T.fromProto(e.removeAttributes)),i},t.prototype.toApiJson=function(){if(void 0===this.add&&void 0===this.replace&&void 0===this.remove&&void 0===this.dropKey&&void 0===this.replaceAttributes&&void 0===this.addAttributes&&void 0===this.removeAttributes)return{};var t={};return void 0!==this.add&&null!==this.add&&(t.add="toApiJson"in this.add?this.add.toApiJson():this.add),void 0!==this.replace&&null!==this.replace&&(t.replace="toApiJson"in this.replace?this.replace.toApiJson():this.replace),void 0!==this.remove&&null!==this.remove&&(t.remove="toApiJson"in this.remove?this.remove.toApiJson():this.remove),void 0!==this.dropKey&&(t.dropKey=this.dropKey),void 0!==this.replaceAttributes&&null!==this.replaceAttributes&&(t.replaceAttributes="toApiJson"in this.replaceAttributes?this.replaceAttributes.toApiJson():this.replaceAttributes),void 0!==this.addAttributes&&null!==this.addAttributes&&(t.addAttributes="toApiJson"in this.addAttributes?this.addAttributes.toApiJson():this.addAttributes),void 0!==this.removeAttributes&&null!==this.removeAttributes&&(t.removeAttributes="toApiJson"in this.removeAttributes?this.removeAttributes.toApiJson():this.removeAttributes),t},t}(),S=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.namespace&&void 0===this.type)return{};var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.type&&(t.type=this.type),t},t}(),P=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subject&&(i.subject=E.fromProto(e.subject)),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.subject&&void 0===this.context)return{};var t={};return void 0!==this.subject&&null!==this.subject&&(t.subject="toApiJson"in this.subject?this.subject.toApiJson():this.subject),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),t},t}(),x=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s,o,r=new e;return r=Object.assign(r,i),i.algorithmType&&(r.algorithmType=(s=t.AlgorithmType,"number"==typeof(o=i.algorithmType)?o:s[o])),r},e.prototype.toApiJson=function(){if(void 0===this.key&&void 0===this.id&&void 0===this.algorithmType)return{};var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.id&&(t.id=this.id),void 0!==this.algorithmType&&(t.algorithmType=this.algorithmType),t},e}(),w=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.searchTerm&&void 0===this.attributeKeys)return{};var t={};return void 0!==this.searchTerm&&(t.searchTerm=this.searchTerm),void 0!==this.attributeKeys&&(t.attributeKeys=this.attributeKeys),t},t}(),R=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.key&&void 0===this.value)return{};var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&(t.value=this.value),t},t}(),T=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.attributes&&(i.attributes=Object.keys(e.attributes).reduce((function(t,i){return t[i]=A.fromProto(e.attributes[i]),t}),{})),i},t.prototype.toApiJson=function(){if(void 0===this.attributes)return{};var t={};return void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),t},t}(),E=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.attributes&&(i.attributes=e.attributes.map(J.fromProto)),e.created&&(i.created=new Date(e.created)),e.updated&&(i.updated=new Date(e.updated)),e.lastLogin&&(i.lastLogin=new Date(e.lastLogin)),e.publicKeys&&(i.publicKeys=e.publicKeys.map(x.fromProto)),e.structAttributes&&(i.structAttributes=T.fromProto(e.structAttributes)),i},t.prototype.toApiJson=function(){if(void 0===this.subjectId&&void 0===this.email&&void 0===this.userId&&void 0===this.partnerId&&void 0===this.attributes&&void 0===this.created&&void 0===this.updated&&void 0===this.lastLogin&&void 0===this.publicKeys&&void 0===this.structAttributes)return{};var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.email&&(t.email=this.email),void 0!==this.userId&&(t.userId=this.userId),void 0!==this.partnerId&&(t.partnerId=this.partnerId),void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),void 0!==this.created&&null!==this.created&&(t.created="toApiJson"in this.created?this.created.toApiJson():this.created),void 0!==this.updated&&null!==this.updated&&(t.updated="toApiJson"in this.updated?this.updated.toApiJson():this.updated),void 0!==this.lastLogin&&null!==this.lastLogin&&(t.lastLogin="toApiJson"in this.lastLogin?this.lastLogin.toApiJson():this.lastLogin),void 0!==this.publicKeys&&null!==this.publicKeys&&(t.publicKeys="toApiJson"in this.publicKeys?this.publicKeys.toApiJson():this.publicKeys),void 0!==this.structAttributes&&null!==this.structAttributes&&(t.structAttributes="toApiJson"in this.structAttributes?this.structAttributes.toApiJson():this.structAttributes),t},t}(),k=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subject&&(i.subject=E.fromProto(e.subject)),i},t.prototype.toApiJson=function(){if(void 0===this.subject)return{};var t={};return void 0!==this.subject&&null!==this.subject&&(t.subject="toApiJson"in this.subject?this.subject.toApiJson():this.subject),t},t}(),M=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.type)return{};var t={};return void 0!==this.type&&(t.type=this.type),t},t}();var _=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.paths)return{};var t={};return void 0!==this.paths&&(t.paths=this.paths),t},t}();function C(t,e){return"number"==typeof e?e:t[e]}var N=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.failures&&(i.failures=e.failures.map(F.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.failures)return{};var t={};return void 0!==this.failures&&null!==this.failures&&(t.failures="toApiJson"in this.failures?this.failures.toApiJson():this.failures),t},t}(),L=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.value&&(i.value=Y.fromProto(e.value)),i},t.prototype.toApiJson=function(){if(void 0===this.key&&void 0===this.value)return{};var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&null!==this.value&&(t.value="toApiJson"in this.value?this.value.toApiJson():this.value),t},t}(),D=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.resourceAttributeValue&&(i.resourceAttributeValue=A.fromProto(e.resourceAttributeValue)),e.thenPolicy&&(i.thenPolicy=q.fromProto(e.thenPolicy)),e.elsePolicy&&(i.elsePolicy=q.fromProto(e.elsePolicy)),i},t.prototype.toApiJson=function(){if(void 0===this.resourceAttributeName&&void 0===this.resourceAttributeValue&&void 0===this.thenPolicy&&void 0===this.elsePolicy)return{};var t={};return void 0!==this.resourceAttributeName&&(t.resourceAttributeName=this.resourceAttributeName),void 0!==this.resourceAttributeValue&&null!==this.resourceAttributeValue&&(t.resourceAttributeValue="toApiJson"in this.resourceAttributeValue?this.resourceAttributeValue.toApiJson():this.resourceAttributeValue),void 0!==this.thenPolicy&&null!==this.thenPolicy&&(t.thenPolicy="toApiJson"in this.thenPolicy?this.thenPolicy.toApiJson():this.thenPolicy),void 0!==this.elsePolicy&&null!==this.elsePolicy&&(t.elsePolicy="toApiJson"in this.elsePolicy?this.elsePolicy.toApiJson():this.elsePolicy),t},t}(),U=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.operator&&(s.operator=C(t.BooleanOperator,i.operator)),i.children&&(s.children=i.children.map(q.fromProto)),s},e.prototype.toApiJson=function(){if(void 0===this.operator&&void 0===this.children)return{};var t={};return void 0!==this.operator&&(t.operator=this.operator),void 0!==this.children&&null!==this.children&&(t.children="toApiJson"in this.children?this.children.toApiJson():this.children),t},e}(),V=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.operations&&(s.operations=i.operations.map((function(e){return C(t.AccessScope,e)}))),i.policy&&(s.policy=q.fromProto(i.policy)),s},e.prototype.toApiJson=function(){if(void 0===this.appId&&void 0===this.resourceId&&void 0===this.policyId&&void 0===this.policyName&&void 0===this.operations&&void 0===this.policy)return{};var t={};return void 0!==this.appId&&(t.appId=this.appId),void 0!==this.resourceId&&(t.resourceId=this.resourceId),void 0!==this.policyId&&(t.policyId=this.policyId),void 0!==this.policyName&&(t.policyName=this.policyName),void 0!==this.operations&&(t.operations=this.operations),void 0!==this.policy&&null!==this.policy&&(t.policy="toApiJson"in this.policy?this.policy.toApiJson():this.policy),t},e}(),q=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subjectResourceIntersection&&(i.subjectResourceIntersection=K.fromProto(e.subjectResourceIntersection)),e.operator&&(i.operator=U.fromProto(e.operator)),e.subjectValueIntersection&&(i.subjectValueIntersection=B.fromProto(e.subjectValueIntersection)),e.subjectMissingValue&&(i.subjectMissingValue=G.fromProto(e.subjectMissingValue)),e.subjectResourceSubset&&(i.subjectResourceSubset=H.fromProto(e.subjectResourceSubset)),e.subjectResourceFor&&(i.subjectResourceFor=z.fromProto(e.subjectResourceFor)),e.ifClause&&(i.ifClause=D.fromProto(e.ifClause)),i},t.prototype.toApiJson=function(){if(void 0===this.subjectResourceIntersection&&void 0===this.operator&&void 0===this.subjectValueIntersection&&void 0===this.subjectMissingValue&&void 0===this.subjectResourceSubset&&void 0===this.subjectResourceFor&&void 0===this.ifClause)return{};var t={};return void 0!==this.subjectResourceIntersection&&null!==this.subjectResourceIntersection&&(t.subjectResourceIntersection="toApiJson"in this.subjectResourceIntersection?this.subjectResourceIntersection.toApiJson():this.subjectResourceIntersection),void 0!==this.operator&&null!==this.operator&&(t.operator="toApiJson"in this.operator?this.operator.toApiJson():this.operator),void 0!==this.subjectValueIntersection&&null!==this.subjectValueIntersection&&(t.subjectValueIntersection="toApiJson"in this.subjectValueIntersection?this.subjectValueIntersection.toApiJson():this.subjectValueIntersection),void 0!==this.subjectMissingValue&&null!==this.subjectMissingValue&&(t.subjectMissingValue="toApiJson"in this.subjectMissingValue?this.subjectMissingValue.toApiJson():this.subjectMissingValue),void 0!==this.subjectResourceSubset&&null!==this.subjectResourceSubset&&(t.subjectResourceSubset="toApiJson"in this.subjectResourceSubset?this.subjectResourceSubset.toApiJson():this.subjectResourceSubset),void 0!==this.subjectResourceFor&&null!==this.subjectResourceFor&&(t.subjectResourceFor="toApiJson"in this.subjectResourceFor?this.subjectResourceFor.toApiJson():this.subjectResourceFor),void 0!==this.ifClause&&null!==this.ifClause&&(t.ifClause="toApiJson"in this.ifClause?this.ifClause.toApiJson():this.ifClause),t},t}(),F=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.identifiers&&(i.identifiers=Object.keys(e.identifiers).reduce((function(t,i){return t[i]=Y.fromProto(e.identifiers[i]),t}),{})),i},t.prototype.toApiJson=function(){if(void 0===this.identifiers)return{};var t={};return void 0!==this.identifiers&&null!==this.identifiers&&(t.identifiers="toApiJson"in this.identifiers?this.identifiers.toApiJson():this.identifiers),t},t}(),W=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.appId&&void 0===this.appName)return{};var t={};return void 0!==this.appId&&(t.appId=this.appId),void 0!==this.appName&&(t.appName=this.appName),t},t}(),G=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.attributeName)return{};var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),t},t}(),z=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.operator&&(s.operator=C(t.ForOperator,i.operator)),i.rules&&(s.rules=q.fromProto(i.rules)),s},e.prototype.toApiJson=function(){if(void 0===this.attributeName&&void 0===this.operator&&void 0===this.rules)return{};var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.operator&&(t.operator=this.operator),void 0!==this.rules&&null!==this.rules&&(t.rules="toApiJson"in this.rules?this.rules.toApiJson():this.rules),t},e}(),K=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.attributeName&&void 0===this.resourceAttributeName)return{};var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.resourceAttributeName&&(t.resourceAttributeName=this.resourceAttributeName),t},t}(),H=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.attributeName&&void 0===this.resourceAttributeName)return{};var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.resourceAttributeName&&(t.resourceAttributeName=this.resourceAttributeName),t},t}(),B=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.structuredAttributeValue&&(i.structuredAttributeValue=A.fromProto(e.structuredAttributeValue)),i},t.prototype.toApiJson=function(){if(void 0===this.attributeName&&void 0===this.attributeValue&&void 0===this.structuredAttributeValue)return{};var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.attributeValue&&(t.attributeValue=this.attributeValue),void 0!==this.structuredAttributeValue&&null!==this.structuredAttributeValue&&(t.structuredAttributeValue="toApiJson"in this.structuredAttributeValue?this.structuredAttributeValue.toApiJson():this.structuredAttributeValue),t},t}(),Y=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.values)return{};var t={};return void 0!==this.values&&(t.values=this.values),t},t}();var Z=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.created&&(i.created=new Date(e.created)),i},t.prototype.toApiJson=function(){if(void 0===this.userId&&void 0===this.actionId&&void 0===this.logId&&void 0===this.description&&void 0===this.created)return{};var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.actionId&&(t.actionId=this.actionId),void 0!==this.logId&&(t.logId=this.logId),void 0!==this.description&&(t.description=this.description),void 0!==this.created&&null!==this.created&&(t.created="toApiJson"in this.created?this.created.toApiJson():this.created),t},t}();var Q=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.subjectId&&void 0===this.userId)return{};var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.userId&&(t.userId=this.userId),t},t}(),X=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.namespace&&void 0===this.email)return{};var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.email&&(t.email=this.email),t},t}(),$=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.namespace&&void 0===this.session)return{};var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.session&&(t.session=this.session),t},t}(),tt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.externalIdType&&void 0===this.externalId)return{};var t={};return void 0!==this.externalIdType&&(t.externalIdType=this.externalIdType),void 0!==this.externalId&&(t.externalId=this.externalId),t},t}(),et=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.created&&(i.created=new Date(e.created)),e.updated&&(i.updated=new Date(e.updated)),e.lastLogin&&(i.lastLogin=new Date(e.lastLogin)),e.publicKeys&&(i.publicKeys=e.publicKeys.map(x.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.userId&&void 0===this.namespace&&void 0===this.email&&void 0===this.created&&void 0===this.updated&&void 0===this.firstName&&void 0===this.greetingName&&void 0===this.lastName&&void 0===this.languageCode&&void 0===this.emailVerified&&void 0===this.roles&&void 0===this.lastLogin&&void 0===this.publicKeys)return{};var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.email&&(t.email=this.email),void 0!==this.created&&null!==this.created&&(t.created="toApiJson"in this.created?this.created.toApiJson():this.created),void 0!==this.updated&&null!==this.updated&&(t.updated="toApiJson"in this.updated?this.updated.toApiJson():this.updated),void 0!==this.firstName&&(t.firstName=this.firstName),void 0!==this.greetingName&&(t.greetingName=this.greetingName),void 0!==this.lastName&&(t.lastName=this.lastName),void 0!==this.languageCode&&(t.languageCode=this.languageCode),void 0!==this.emailVerified&&(t.emailVerified=this.emailVerified),void 0!==this.roles&&(t.roles=this.roles),void 0!==this.lastLogin&&null!==this.lastLogin&&(t.lastLogin="toApiJson"in this.lastLogin?this.lastLogin.toApiJson():this.lastLogin),void 0!==this.publicKeys&&null!==this.publicKeys&&(t.publicKeys="toApiJson"in this.publicKeys?this.publicKeys.toApiJson():this.publicKeys),t},t}();function it(t,e){return"number"==typeof e?e:t[e]}var st=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.context&&(s.context=g.fromProto(i.context)),i.resourceEntityIdentifier&&(s.resourceEntityIdentifier=Object.keys(i.resourceEntityIdentifier).reduce((function(t,e){return t[e]=Y.fromProto(i.resourceEntityIdentifier[e]),t}),{})),i.accessScope&&(s.accessScope=i.accessScope.map((function(e){return it(t.AccessScope,e)}))),i.resourceEntityIdentifiers&&(s.resourceEntityIdentifiers=i.resourceEntityIdentifiers.map(F.fromProto)),i.resourceAttributes&&(s.resourceAttributes=T.fromProto(i.resourceAttributes)),s},e.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subjectId&&void 0===this.email&&void 0===this.userId&&void 0===this.session&&void 0===this.ownerId&&void 0===this.resourceId&&void 0===this.resourceEntityIdentifier&&void 0===this.accessScope&&void 0===this.resourceEntityIdentifiers&&void 0===this.resourceAttributes)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.email&&(t.email=this.email),void 0!==this.userId&&(t.userId=this.userId),void 0!==this.session&&(t.session=this.session),void 0!==this.ownerId&&(t.ownerId=this.ownerId),void 0!==this.resourceId&&(t.resourceId=this.resourceId),void 0!==this.resourceEntityIdentifier&&null!==this.resourceEntityIdentifier&&(t.resourceEntityIdentifier="toApiJson"in this.resourceEntityIdentifier?this.resourceEntityIdentifier.toApiJson():this.resourceEntityIdentifier),void 0!==this.accessScope&&(t.accessScope=this.accessScope),void 0!==this.resourceEntityIdentifiers&&null!==this.resourceEntityIdentifiers&&(t.resourceEntityIdentifiers="toApiJson"in this.resourceEntityIdentifiers?this.resourceEntityIdentifiers.toApiJson():this.resourceEntityIdentifiers),void 0!==this.resourceAttributes&&null!==this.resourceAttributes&&(t.resourceAttributes="toApiJson"in this.resourceAttributes?this.resourceAttributes.toApiJson():this.resourceAttributes),t},e}(),ot=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.context&&(s.context=g.fromProto(i.context)),i.algorithmType&&(s.algorithmType=it(t.AlgorithmType,i.algorithmType)),i.userIdentifier&&(s.userIdentifier=de.fromProto(i.userIdentifier)),s},e.prototype.toApiJson=function(){if(void 0===this.email&&void 0===this.context&&void 0===this.algorithmType&&void 0===this.userIdentifier)return{};var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.algorithmType&&(t.algorithmType=this.algorithmType),void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},e}(),rt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.privateKey&&void 0===this.keyId)return{};var t={};return void 0!==this.privateKey&&(t.privateKey=this.privateKey),void 0!==this.keyId&&(t.keyId=this.keyId),t},t}(),nt=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.userIdentifiers&&(s.userIdentifiers=i.userIdentifiers.map(de.fromProto)),i.restrictionType&&(s.restrictionType=it(t.RestrictionType,i.restrictionType)),s},e.prototype.toApiJson=function(){if(void 0===this.userIdentifiers&&void 0===this.restrictionType)return{};var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),void 0!==this.restrictionType&&(t.restrictionType=this.restrictionType),t},e}(),ut=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.email&&void 0===this.password)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),void 0!==this.password&&(t.password=this.password),t},t}(),at=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subjectId&&void 0===this.newEmail)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.newEmail&&(t.newEmail=this.newEmail),t},t}(),ct=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifier&&(i.userIdentifier=de.fromProto(e.userIdentifier)),e.typedExternalIdentifier&&(i.typedExternalIdentifier=tt.fromProto(e.typedExternalIdentifier)),i},t.prototype.toApiJson=function(){if(void 0===this.userIdentifier&&void 0===this.typedExternalIdentifier)return{};var t={};return void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),void 0!==this.typedExternalIdentifier&&null!==this.typedExternalIdentifier&&(t.typedExternalIdentifier="toApiJson"in this.typedExternalIdentifier?this.typedExternalIdentifier.toApiJson():this.typedExternalIdentifier),t},t}(),ht=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.oauthCredentials&&(i.oauthCredentials=Kt.fromProto(e.oauthCredentials)),e.subjectCredentials&&(i.subjectCredentials=ae.fromProto(e.subjectCredentials)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.oauthCredentials&&void 0===this.subjectCredentials)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.oauthCredentials&&null!==this.oauthCredentials&&(t.oauthCredentials="toApiJson"in this.oauthCredentials?this.oauthCredentials.toApiJson():this.oauthCredentials),void 0!==this.subjectCredentials&&null!==this.subjectCredentials&&(t.subjectCredentials="toApiJson"in this.subjectCredentials?this.subjectCredentials.toApiJson():this.subjectCredentials),t},t}(),pt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.session)return{};var t={};return void 0!==this.session&&(t.session=this.session),t},t}(),dt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.attributes&&(i.attributes=T.fromProto(e.attributes)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subject&&void 0===this.attributes)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subject&&(t.subject=this.subject),void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),t},t}(),ft=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.session)return{};var t={};return void 0!==this.session&&(t.session=this.session),t},t}(),vt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subjectId)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),lt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifier&&(i.userIdentifier=de.fromProto(e.userIdentifier)),i},t.prototype.toApiJson=function(){if(void 0===this.userIdentifier)return{};var t={};return void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},t}(),bt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.actionId)return{};var t={};return void 0!==this.actionId&&(t.actionId=this.actionId),t},t}(),mt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.impersonatee&&(i.impersonatee=de.fromProto(e.impersonatee)),e.impersonator&&(i.impersonator=de.fromProto(e.impersonator)),i},t.prototype.toApiJson=function(){if(void 0===this.impersonatee&&void 0===this.impersonator)return{};var t={};return void 0!==this.impersonatee&&null!==this.impersonatee&&(t.impersonatee="toApiJson"in this.impersonatee?this.impersonatee.toApiJson():this.impersonatee),void 0!==this.impersonator&&null!==this.impersonator&&(t.impersonator="toApiJson"in this.impersonator?this.impersonator.toApiJson():this.impersonator),t},t}(),At=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.token)return{};var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),yt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifiers&&(i.userIdentifiers=e.userIdentifiers.map(de.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.userIdentifiers&&void 0===this.externalIdType)return{};var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),void 0!==this.externalIdType&&(t.externalIdType=this.externalIdType),t},t}(),gt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.externalIds)return{};var t={};return void 0!==this.externalIds&&(t.externalIds=this.externalIds),t},t}(),jt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifiers&&(i.userIdentifiers=e.userIdentifiers.map(de.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.userIdentifiers)return{};var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),t},t}(),It=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.users&&(i.users=e.users.map(he.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.users)return{};var t={};return void 0!==this.users&&null!==this.users&&(t.users="toApiJson"in this.users?this.users.toApiJson():this.users),t},t}(),Jt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.email)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),t},t}(),Ot=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.subjectId&&void 0===this.email&&void 0===this.userId&&void 0===this.refreshToken&&void 0===this.clientAssertion&&void 0===this.federatedIdentityProvider&&void 0===this.scopes&&void 0===this.clientId&&void 0===this.nonce)return{};var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.email&&(t.email=this.email),void 0!==this.userId&&(t.userId=this.userId),void 0!==this.refreshToken&&(t.refreshToken=this.refreshToken),void 0!==this.clientAssertion&&(t.clientAssertion=this.clientAssertion),void 0!==this.federatedIdentityProvider&&(t.federatedIdentityProvider=this.federatedIdentityProvider),void 0!==this.scopes&&(t.scopes=this.scopes),void 0!==this.clientId&&(t.clientId=this.clientId),void 0!==this.nonce&&(t.nonce=this.nonce),t},t}(),St=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.session&&void 0===this.accessToken&&void 0===this.refreshToken)return{};var t={};return void 0!==this.session&&(t.session=this.session),void 0!==this.accessToken&&(t.accessToken=this.accessToken),void 0!==this.refreshToken&&(t.refreshToken=this.refreshToken),t},t}(),Pt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.token)return{};var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),xt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.email)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),t},t}(),wt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.session&&void 0===this.context)return{};var t={};return void 0!==this.session&&(t.session=this.session),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),t},t}(),Rt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.subjectId)return{};var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),Tt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),t},t}(),Et=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subject&&(i.subject=k.fromProto(e.subject)),i},t.prototype.toApiJson=function(){if(void 0===this.subject)return{};var t={};return void 0!==this.subject&&null!==this.subject&&(t.subject="toApiJson"in this.subject?this.subject.toApiJson():this.subject),t},t}(),kt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.fieldMask&&(i.fieldMask=_.fromProto(e.fieldMask)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.emails&&void 0===this.fieldMask)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.emails&&(t.emails=this.emails),void 0!==this.fieldMask&&null!==this.fieldMask&&(t.fieldMask="toApiJson"in this.fieldMask?this.fieldMask.toApiJson():this.fieldMask),t},t}(),Mt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.fieldMask&&(i.fieldMask=_.fromProto(e.fieldMask)),e.identifiers&&(i.identifiers=e.identifiers.map(Q.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subjectIds&&void 0===this.fieldMask&&void 0===this.identifiers)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectIds&&(t.subjectIds=this.subjectIds),void 0!==this.fieldMask&&null!==this.fieldMask&&(t.fieldMask="toApiJson"in this.fieldMask?this.fieldMask.toApiJson():this.fieldMask),void 0!==this.identifiers&&null!==this.identifiers&&(t.identifiers="toApiJson"in this.identifiers?this.identifiers.toApiJson():this.identifiers),t},t}(),_t=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subjects&&(i.subjects=e.subjects.map(k.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.subjects)return{};var t={};return void 0!==this.subjects&&null!==this.subjects&&(t.subjects="toApiJson"in this.subjects?this.subjects.toApiJson():this.subjects),t},t}(),Ct=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return{}},t}(),Nt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.token)return{};var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),Lt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifier&&(i.userIdentifier=de.fromProto(e.userIdentifier)),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){if(void 0===this.userIdentifier&&void 0===this.cursor&&void 0===this.pageSize&&void 0===this.type&&void 0===this.namespace)return{};var t={};return void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.type&&(t.type=this.type),void 0!==this.namespace&&(t.namespace=this.namespace),t},t}(),Dt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){if(void 0===this.email&&void 0===this.cursor&&void 0===this.pageSize&&void 0===this.type&&void 0===this.namespace)return{};var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.type&&(t.type=this.type),void 0!==this.namespace&&(t.namespace=this.namespace),t},t}(),Ut=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){if(void 0===this.session&&void 0===this.cursor&&void 0===this.pageSize&&void 0===this.type&&void 0===this.namespace)return{};var t={};return void 0!==this.session&&(t.session=this.session),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.type&&(t.type=this.type),void 0!==this.namespace&&(t.namespace=this.namespace),t},t}(),Vt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.personas&&(i.personas=e.personas.map(P.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.personas&&void 0===this.nextCursor&&void 0===this.hasMore)return{};var t={};return void 0!==this.personas&&null!==this.personas&&(t.personas="toApiJson"in this.personas?this.personas.toApiJson():this.personas),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),t},t}(),qt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.filters&&(i.filters=bt.fromProto(e.filters)),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){if(void 0===this.userId&&void 0===this.filters&&void 0===this.pageSize&&void 0===this.cursor)return{};var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.filters&&null!==this.filters&&(t.filters="toApiJson"in this.filters?this.filters.toApiJson():this.filters),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.cursor&&(t.cursor=this.cursor),t},t}(),Ft=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.logs&&(i.logs=e.logs.map(Z.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.logs&&void 0===this.nextCursor&&void 0===this.hasMore)return{};var t={};return void 0!==this.logs&&null!==this.logs&&(t.logs="toApiJson"in this.logs?this.logs.toApiJson():this.logs),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),t},t}(),Wt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),e.userFilter&&(i.userFilter=pe.fromProto(e.userFilter)),e.sortOptions&&(i.sortOptions=e.sortOptions.map(fe.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.namespace&&void 0===this.email&&void 0===this.cursor&&void 0===this.pageSize&&void 0===this.userFilter&&void 0===this.sortOptions)return{};var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.email&&(t.email=this.email),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.userFilter&&null!==this.userFilter&&(t.userFilter="toApiJson"in this.userFilter?this.userFilter.toApiJson():this.userFilter),void 0!==this.sortOptions&&null!==this.sortOptions&&(t.sortOptions="toApiJson"in this.sortOptions?this.sortOptions.toApiJson():this.sortOptions),t},t}(),Gt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.users&&(i.users=e.users.map(et.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.users&&void 0===this.nextCursor&&void 0===this.hasMore)return{};var t={};return void 0!==this.users&&null!==this.users&&(t.users="toApiJson"in this.users?this.users.toApiJson():this.users),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),t},t}(),zt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.mutations&&(i.mutations=e.mutations.map(O.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subjectId&&void 0===this.mutations)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.mutations&&null!==this.mutations&&(t.mutations="toApiJson"in this.mutations?this.mutations.toApiJson():this.mutations),t},t}(),Kt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.provider&&void 0===this.idToken&&void 0===this.accessToken)return{};var t={};return void 0!==this.provider&&(t.provider=this.provider),void 0!==this.idToken&&(t.idToken=this.idToken),void 0!==this.accessToken&&(t.accessToken=this.accessToken),t},t}(),Ht=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.firstName&&void 0===this.greetingName&&void 0===this.lastName&&void 0===this.languageCode)return{};var t={};return void 0!==this.firstName&&(t.firstName=this.firstName),void 0!==this.greetingName&&(t.greetingName=this.greetingName),void 0!==this.lastName&&(t.lastName=this.lastName),void 0!==this.languageCode&&(t.languageCode=this.languageCode),t},t}(),Bt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.policy&&(i.policy=V.fromProto(e.policy)),i},t.prototype.toApiJson=function(){if(void 0===this.policy)return{};var t={};return void 0!==this.policy&&null!==this.policy&&(t.policy="toApiJson"in this.policy?this.policy.toApiJson():this.policy),t},t}(),Yt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.owner&&(i.owner=W.fromProto(e.owner)),i},t.prototype.toApiJson=function(){if(void 0===this.owner)return{};var t={};return void 0!==this.owner&&null!==this.owner&&(t.owner="toApiJson"in this.owner?this.owner.toApiJson():this.owner),t},t}(),Zt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.appId&&void 0===this.resourceId&&void 0===this.resourceName&&void 0===this.resourceOwnerServiceUrl&&void 0===this.requiredResourceParams&&void 0===this.resourceOwnerAudience)return{};var t={};return void 0!==this.appId&&(t.appId=this.appId),void 0!==this.resourceId&&(t.resourceId=this.resourceId),void 0!==this.resourceName&&(t.resourceName=this.resourceName),void 0!==this.resourceOwnerServiceUrl&&(t.resourceOwnerServiceUrl=this.resourceOwnerServiceUrl),void 0!==this.requiredResourceParams&&(t.requiredResourceParams=this.requiredResourceParams),void 0!==this.resourceOwnerAudience&&(t.resourceOwnerAudience=this.resourceOwnerAudience),t},t}(),Qt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.attributes&&(i.attributes=e.attributes.map(J.fromProto)),e.structAttributes&&(i.structAttributes=T.fromProto(e.structAttributes)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.email&&void 0===this.password&&void 0===this.attributes&&void 0===this.structAttributes)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),void 0!==this.password&&(t.password=this.password),void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),void 0!==this.structAttributes&&null!==this.structAttributes&&(t.structAttributes="toApiJson"in this.structAttributes?this.structAttributes.toApiJson():this.structAttributes),t},t}(),Xt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.subjectId)return{};var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),$t=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),e.userIdentifier&&(i.userIdentifier=de.fromProto(e.userIdentifier)),i},t.prototype.toApiJson=function(){if(void 0===this.email&&void 0===this.context&&void 0===this.keyId&&void 0===this.userIdentifier)return{};var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.keyId&&(t.keyId=this.keyId),void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},t}(),te=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.userIdentifiers&&(s.userIdentifiers=i.userIdentifiers.map(de.fromProto)),i.restrictionType&&(s.restrictionType=it(t.RestrictionType,i.restrictionType)),s},e.prototype.toApiJson=function(){if(void 0===this.userIdentifiers&&void 0===this.restrictionType)return{};var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),void 0!==this.restrictionType&&(t.restrictionType=this.restrictionType),t},e}(),ee=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.token)return{};var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),ie=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.token&&void 0===this.password)return{};var t={};return void 0!==this.token&&(t.token=this.token),void 0!==this.password&&(t.password=this.password),t},t}(),se=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=g.fromProto(e.context)),i},t.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.subjectId&&void 0===this.newPassword)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.newPassword&&(t.newPassword=this.newPassword),t},t}(),oe=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.value&&(i.value=Y.fromProto(e.value)),i},t.prototype.toApiJson=function(){if(void 0===this.key&&void 0===this.value)return{};var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&null!==this.value&&(t.value="toApiJson"in this.value?this.value.toApiJson():this.value),t},t}(),re=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.context&&(s.context=g.fromProto(i.context)),i.query&&(s.query=w.fromProto(i.query)),i.filters&&(s.filters=i.filters.map(R.fromProto)),i.orderByDirection&&(s.orderByDirection=it(t.OrderByDirection,i.orderByDirection)),i.pageSize&&(s.pageSize=parseInt(i.pageSize,10)),i.fieldMask&&(s.fieldMask=_.fromProto(i.fieldMask)),s},e.prototype.toApiJson=function(){if(void 0===this.context&&void 0===this.query&&void 0===this.filters&&void 0===this.orderBy&&void 0===this.orderByDirection&&void 0===this.cursor&&void 0===this.pageSize&&void 0===this.fieldMask)return{};var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.query&&null!==this.query&&(t.query="toApiJson"in this.query?this.query.toApiJson():this.query),void 0!==this.filters&&null!==this.filters&&(t.filters="toApiJson"in this.filters?this.filters.toApiJson():this.filters),void 0!==this.orderBy&&(t.orderBy=this.orderBy),void 0!==this.orderByDirection&&(t.orderByDirection=this.orderByDirection),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.fieldMask&&null!==this.fieldMask&&(t.fieldMask="toApiJson"in this.fieldMask?this.fieldMask.toApiJson():this.fieldMask),t},e}(),ne=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.result&&(i.result=e.result.map(k.fromProto)),e.totalResults&&(i.totalResults=parseInt(e.totalResults,10)),i},t.prototype.toApiJson=function(){if(void 0===this.result&&void 0===this.nextCursor&&void 0===this.hasMore&&void 0===this.totalResults)return{};var t={};return void 0!==this.result&&null!==this.result&&(t.result="toApiJson"in this.result?this.result.toApiJson():this.result),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),void 0!==this.totalResults&&(t.totalResults=this.totalResults),t},t}(),ue=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.userId)return{};var t={};return void 0!==this.userId&&(t.userId=this.userId),t},t}(),ae=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.email&&void 0===this.password)return{};var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.password&&(t.password=this.password),t},t}(),ce=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.operations&&(i.operations=e.operations.map(Ht.fromProto)),i},t.prototype.toApiJson=function(){if(void 0===this.userId&&void 0===this.operations)return{};var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.operations&&null!==this.operations&&(t.operations="toApiJson"in this.operations?this.operations.toApiJson():this.operations),t},t}(),he=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.user&&(i.user=et.fromProto(e.user)),i},t.prototype.toApiJson=function(){if(void 0===this.user)return{};var t={};return void 0!==this.user&&null!==this.user&&(t.user="toApiJson"in this.user?this.user.toApiJson():this.user),t},t}(),pe=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.subjectTypes&&void 0===this.searchTerms)return{};var t={};return void 0!==this.subjectTypes&&(t.subjectTypes=this.subjectTypes),void 0!==this.searchTerms&&(t.searchTerms=this.searchTerms),t},t}(),de=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.namespacedEmail&&(i.namespacedEmail=X.fromProto(e.namespacedEmail)),e.namespacedSession&&(i.namespacedSession=$.fromProto(e.namespacedSession)),e.typedExternalIdentifier&&(i.typedExternalIdentifier=tt.fromProto(e.typedExternalIdentifier)),i},t.prototype.toApiJson=function(){if(void 0===this.userId&&void 0===this.namespacedEmail&&void 0===this.namespacedSession&&void 0===this.token&&void 0===this.typedExternalIdentifier&&void 0===this.subjectId)return{};var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.namespacedEmail&&null!==this.namespacedEmail&&(t.namespacedEmail="toApiJson"in this.namespacedEmail?this.namespacedEmail.toApiJson():this.namespacedEmail),void 0!==this.namespacedSession&&null!==this.namespacedSession&&(t.namespacedSession="toApiJson"in this.namespacedSession?this.namespacedSession.toApiJson():this.namespacedSession),void 0!==this.token&&(t.token=this.token),void 0!==this.typedExternalIdentifier&&null!==this.typedExternalIdentifier&&(t.typedExternalIdentifier="toApiJson"in this.typedExternalIdentifier?this.typedExternalIdentifier.toApiJson():this.typedExternalIdentifier),void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),fe=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.direction&&(s.direction=it(t.SortDirection,i.direction)),i.field&&(s.field=it(t.UserSortField,i.field)),s},e.prototype.toApiJson=function(){if(void 0===this.direction&&void 0===this.field)return{};var t={};return void 0!==this.direction&&(t.direction=this.direction),void 0!==this.field&&(t.field=this.field),t},e}(),ve=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){if(void 0===this.token)return{};var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),le=function(){function t(t){this.environmentService=t}return t.prototype.host=function(){if(this._host)return this._host;switch(this.environmentService.getEnvironment()){case i.Environment.LOCAL:this._host="iam.vendasta-local.com";break;case i.Environment.TEST:this._host="";break;case i.Environment.DEMO:this._host="iam-api-demo.apigateway.co";break;case i.Environment.PROD:this._host="iam-api-prod.apigateway.co"}return this._host},t.prototype.httpsHost=function(){if(this._httpsHost)return this._httpsHost;switch(this.environmentService.getEnvironment()){case i.Environment.LOCAL:this._httpsHost="iam.vendasta-local.com";break;case i.Environment.TEST:this._httpsHost="";break;case i.Environment.DEMO:this._httpsHost="iam-demo.apigateway.co";break;case i.Environment.PROD:this._httpsHost="iam-prod.apigateway.co"}return this._httpsHost},t.prototype.hostWithScheme=function(){return(this.environmentService.getEnvironment()===i.Environment.LOCAL?"http://":"https://")+this.host()},t.prototype.httpsHostWithScheme=function(){return(this.environmentService.getEnvironment()===i.Environment.LOCAL?"http://":"https://")+this.httpsHost()},t}();le.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new le(e.ɵɵinject(i.EnvironmentService))},token:le,providedIn:"root"}),le.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],le.ctorParameters=function(){return[{type:i.EnvironmentService}]};var be=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(){return{headers:new o.HttpHeaders({"Content-Type":"application/json"}),withCredentials:!0}},t.prototype.getSubjectBySession=function(t){var e=t.toApiJson?t:new wt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetSubjectBySession",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Et.fromProto(t)})),s.share())},t.prototype.listPersonas=function(t){var e=t.toApiJson?t:new Ut(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/ListPersonas",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Vt.fromProto(t)})),s.share())},t.prototype.getToken=function(t){var e=t.toApiJson?t:new Ct(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetToken",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Nt.fromProto(t)})),s.share())},t.prototype.getSessionToken=function(t){var e=t.toApiJson?t:new Pt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetSessionToken",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Nt.fromProto(t)})),s.share())},t.prototype.resetPasswordWithToken=function(t){var e=t.toApiJson?t:new ie(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/ResetPasswordWithToken",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getImpersonationToken=function(t){var e=t.toApiJson?t:new mt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetImpersonationToken",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return At.fromProto(t)})),s.share())},t}();be.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new be(e.ɵɵinject(o.HttpClient),e.ɵɵinject(le))},token:be,providedIn:"root"}),be.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],be.ctorParameters=function(){return[{type:o.HttpClient},{type:le}]};var me,Ae=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){if(!e)return new t;var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return void 0===this.namespace&&void 0===this.type&&void 0===this.email&&void 0===this.password&&void 0===this.providerIdToken&&void 0===this.provider?{}:{namespace:void 0!==this.namespace?this.namespace:null,type:void 0!==this.type?this.type:null,email:void 0!==this.email?this.email:null,password:void 0!==this.password?this.password:null,provider_id_token:void 0!==this.providerIdToken?this.providerIdToken:null,provider:void 0!==this.provider?this.provider:null}},t}(),ye=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i.sessionId=e.session_id,i},t.prototype.toApiJson=function(){return void 0===this.sessionId?{}:{sessionId:void 0!==this.sessionId?this.sessionId:null}},t}(),ge=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return void 0===this.success?{}:{success:void 0!==this.success?this.success:null}},t}(),je=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return void 0===this.nextUrl&&void 0===this.namespace&&void 0===this.type?null:{next_url:void 0!==this.nextUrl?this.nextUrl:null,namespace:void 0!==this.namespace?this.namespace:null,type:void 0!==this.type?this.type:null}},t}(),Ie=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(t){return t?{headers:new o.HttpHeaders({"Content-Type":"application/x-www-form-urlencoded"}),withCredentials:!0}:{headers:new o.HttpHeaders({"Content-Type":"application/x-www-form-urlencoded"})}},t.prototype.login=function(t){var e=void 0!==t.toApiJson?t:new Ae(t);return this.http.post(this.hostService.httpsHostWithScheme()+"/_ajax/v1/login",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return ye.fromProto(t)})),s.share())},t.prototype.logout=function(){return this.http.post(this.hostService.httpsHostWithScheme()+"/_ajax/v1/logout",{},this.apiOptions(!0)).pipe(s.map((function(t){return ge.fromProto(t)})),s.share())},t.prototype.ssoLogin=function(t){var e=void 0!==t.toApiJson?t:new je(t),i=new URLSearchParams,s=e.toApiJson();for(var o in s)if(s.hasOwnProperty(o)){var r=s[o];null!==r&&i.append(o,r)}window.location.href=this.hostService.httpsHostWithScheme()+"/sso-login?"+i.toString()},t}();Ie.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ie(e.ɵɵinject(o.HttpClient),e.ɵɵinject(le))},token:Ie,providedIn:"root"}),Ie.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ie.ctorParameters=function(){return[{type:o.HttpClient},{type:le}]},(me=t.PersonaType||(t.PersonaType={})).partner="partner",me.partner_app="partner_app",me.sales_person="sales_person",me.smb="smb",me.vendor="vendor",me.digital_agent="digital_agent",me.developer="developer",me.success="success",me.account_group="account_group";var Je=function(){function t(){}return t.prototype.fromPersona=function(t){var e=t.subject;return this.subjectId=e.subjectId,this.email=e.email,this.created=e.created,this.updated=e.updated,this.lastLogin=e.lastLogin,this.userId=e.userId,this.readAttributes(e.structAttributes)},t.prototype.readAttributes=function(t){if(!t)return this;var e=function t(e){var i,s;if(void 0===e)return null;if(void 0!==e.stringAttribute)return e.stringAttribute;if(void 0!==e.intAttribute)return e.intAttribute;if(void 0!==e.doubleAttribute)return e.doubleAttribute;if(void 0!==e.boolAttribute)return e.boolAttribute;if(void 0!==e.listAttribute){var o=[];if(void 0===e.listAttribute.attributes)return o;try{for(var r=u(e.listAttribute.attributes),n=r.next();!n.done;n=r.next()){var a=n.value;o.push(t(a))}}catch(t){i={error:t}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(i)throw i.error}}return o}if(void 0!==e.timestampAttribute)return e.timestampAttribute;if(void 0!==e.geopointAttribute)return e.geopointAttribute;if(void 0!==e.structAttribute){var c={};for(var h in e.structAttribute.attributes)e.structAttribute.attributes.hasOwnProperty(h)&&(c[Pe(h)]=t(e.structAttribute.attributes[h]));return c}}({structAttribute:{attributes:t.attributes}});return Object.assign(this,e),this},t}(),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(Je),Se=function(t){function e(){var e=t.apply(this,c(arguments))||this;return e.partnerId="",e}return n(e,t),e.prototype.fromPersona=function(e){return this.partnerId=e.context.namespaced.namespace,t.prototype.fromPersona.call(this,e)},e}(Je);function Pe(t){for(var e="",i=0;i<t.length;i++)"_"===t[i]?(e+=t[i+1].toUpperCase(),i++):e+=t[i];return e}var xe=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.developer,i}return n(i,e),i}(Oe),we=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.partner,i.isSuperAdmin=!1,i.isAdmin=!1,i.canCustomizeWhitelabel=!1,i.canAccessBilling=!1,i.canAccessAccounts=!1,i.canAccessMarketing=!1,i.canAccessSales=!1,i.canAccessConcierge=!1,i.canAccessBrands=!1,i.canAccessDashboard=!1,i.canAccessOrders=!1,i.canAccessCompanyProfile=!1,i.canAccessAutomations=!1,i.canAccessMarketplace=!1,i.canEnableApps=!1,i}return n(i,e),i}(Oe),Re=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.partner_app,i}return n(i,e),i}(Se),Te="partnerForSmb",Ee=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.sales_person,i.titleChoice=Te,i}return n(i,e),i}(Se),ke=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.smb,i.notificationsEnabled=!0,i}return n(i,e),i}(Se),Me=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.vendor,i}return n(i,e),i}(Oe),_e=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.digital_agent,i}return n(i,e),i}(Oe),Ce=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.success,i}return n(i,e),i}(Oe),Ne=function(e){function i(){var i=e.apply(this,c(arguments))||this;return i.type=t.PersonaType.account_group,i}return n(i,e),i}(Oe);function Le(e){var i=function(e){switch(e.namespaced?e.namespaced.type:e.typed.type){case"partner":return t.PersonaType.partner;case"partner_app":return t.PersonaType.partner_app;case"sales_person":return t.PersonaType.sales_person;case"smb":return t.PersonaType.smb;case"vendor":return t.PersonaType.vendor;case"digital_agent":return t.PersonaType.digital_agent;case"developer":return t.PersonaType.developer;case"success":return t.PersonaType.success;case"account_group":return t.PersonaType.account_group}return null}(e.context);if(null===i)return null;var s=new{partner:we,partner_app:Re,sales_person:Ee,smb:ke,vendor:Me,digital_agent:_e,developer:xe,success:Ce,account_group:Ne}[i];return s.fromPersona(e),s}var De=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(){return{headers:new o.HttpHeaders({"Content-Type":"application/json"}),withCredentials:!0}},t.prototype.registerSubject=function(t){var e=t.toApiJson?t:new Qt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterSubject",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Xt.fromProto(t)})),s.share())},t.prototype.authenticateSubject=function(t){var e=t.toApiJson?t:new ut(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AuthenticateSubject",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getSubjects=function(t){var e=t.toApiJson?t:new Mt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSubjects",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return _t.fromProto(t)})),s.share())},t.prototype.getSubjectsByEmail=function(t){var e=t.toApiJson?t:new kt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSubjectsByEmail",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return _t.fromProto(t)})),s.share())},t.prototype.mutateAttributes=function(t){var e=t.toApiJson?t:new zt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/MutateAttributes",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.resetSubjectPassword=function(t){var e=t.toApiJson?t:new se(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ResetSubjectPassword",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.changeSubjectEmail=function(t){var e=t.toApiJson?t:new at(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ChangeSubjectEmail",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.deleteSubject=function(t){var e=t.toApiJson?t:new vt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/DeleteSubject",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.searchSubject=function(t){var e=t.toApiJson?t:new re(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/SearchSubject",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return ne.fromProto(t)})),s.share())},t.prototype.getSubjectContext=function(t){var e=t.toApiJson?t:new Rt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSubjectContext",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Tt.fromProto(t)})),s.share())},t.prototype.registerResourceOwner=function(t){var e=t.toApiJson?t:new Yt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterResourceOwner",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.registerResource=function(t){var e=t.toApiJson?t:new Zt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterResource",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.registerPolicy=function(t){var e=t.toApiJson?t:new Bt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterPolicy",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.accessResource=function(t){var e=t.toApiJson?t:new st(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AccessResource",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getShortLivedToken=function(t){var e=t.toApiJson?t:new xt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetShortLivedToken",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Nt.fromProto(t)})),s.share())},t.prototype.getSessionToken=function(t){var e=t.toApiJson?t:new Pt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSessionToken",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Nt.fromProto(t)})),s.share())},t.prototype.addKey=function(t){var e=t.toApiJson?t:new ot(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AddKey",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return rt.fromProto(t)})),s.share())},t.prototype.removeKey=function(t){var e=t.toApiJson?t:new $t(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RemoveKey",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.createSession=function(t){var e=t.toApiJson?t:new ht(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/CreateSession",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return pt.fromProto(t)})),s.share())},t.prototype.getResetPasswordToken=function(t){var e=t.toApiJson?t:new Jt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetResetPasswordToken",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return ee.fromProto(t)})),s.share())},t.prototype.listPersonasByEmail=function(t){var e=t.toApiJson?t:new Dt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListPersonasByEmail",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Vt.fromProto(t)})),s.share())},t.prototype.listPersonas=function(t){var e=t.toApiJson?t:new Lt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListPersonas",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Vt.fromProto(t)})),s.share())},t.prototype.createTemporarySubject=function(t){var e=t.toApiJson?t:new dt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/CreateTemporarySubject",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return ft.fromProto(t)})),s.share())},t.prototype.getMultiUsers=function(t){var e=t.toApiJson?t:new jt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetMultiUsers",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return It.fromProto(t)})),s.share())},t.prototype.listUsers=function(t){var e=t.toApiJson?t:new Wt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListUsers",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Gt.fromProto(t)})),s.share())},t.prototype.updateUser=function(t){var e=t.toApiJson?t:new ce(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/UpdateUser",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.deleteUser=function(t){var e=t.toApiJson?t:new lt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/DeleteUser",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.listSecurityLogs=function(t){var e=t.toApiJson?t:new qt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListSecurityLogs",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return Ft.fromProto(t)})),s.share())},t.prototype.verifyEmail=function(t){var e=t.toApiJson?t:new ve(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/VerifyEmail",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.sendEmailVerification=function(t){var e=t.toApiJson?t:new ue(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/SendEmailVerification",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getMultiExternalId=function(t){var e=t.toApiJson?t:new yt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetMultiExternalID",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return gt.fromProto(t)})),s.share())},t.prototype.createExternalId=function(t){var e=t.toApiJson?t:new ct(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/CreateExternalID",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.addMultiUserRestriction=function(t){var e=t.toApiJson?t:new nt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AddMultiUserRestriction",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.removeMultiUserRestriction=function(t){var e=t.toApiJson?t:new te(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RemoveMultiUserRestriction",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t}();De.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new De(e.ɵɵinject(o.HttpClient),e.ɵɵinject(le))},token:De,providedIn:"root"}),De.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],De.ctorParameters=function(){return[{type:o.HttpClient},{type:le}]};var Ue=function(){function e(t,e,i,s){this.api=t,this.httpApi=e,this.sessionService=i,this.iamApi=s}return e.prototype.getSubjectBySession=function(e,i,o){var r;return r=new g(o?{namespaced:new S({namespace:o,type:t.PersonaType[i]})}:{typed:new M({type:t.PersonaType[i]})}),this.api.getSubjectBySession({session:e,context:r}).pipe(s.map((function(t){return Le(new P({subject:t.subject.subject,context:r}))})))},e.prototype.getLoggedInSubject=function(t,e){var i=this;return this.sessionService.getSessionId().pipe(s.switchMap((function(s){return i.getSubjectBySession(s,t,e)})))},e.prototype.listPersonas=function(t,e){return this.api.listPersonas({session:t,pageSize:100,type:e}).pipe(s.map((function(t){var e,i,s=[];if(!t||!t.personas)return[];try{for(var o=u(t.personas),r=o.next();!r.done;r=o.next()){var n=Le(r.value);n&&s.push(n)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}return s})))},e.prototype.listLoggedInPersonas=function(t){var e=this;return this.sessionService.getSessionId().pipe(s.switchMap((function(i){return e.listPersonas(i,t)})))},e.prototype.getToken=function(){return this.api.getToken({}).pipe(s.map((function(t){return t.token})))},e.prototype.login=function(t,e,i,o){return this.httpApi.login({email:t,password:e,namespace:o,type:i}).pipe(s.map((function(t){return t.sessionId||""})))},e.prototype.logout=function(){return this.httpApi.logout().pipe(s.map((function(t){return t.success})))},e.prototype.ssoLogin=function(t,e,i){this.httpApi.ssoLogin({nextUrl:t,namespace:i,type:e})},e.prototype.getMultiUsers=function(t){return this.iamApi.getMultiUsers({userIdentifiers:t}).pipe(s.map((function(t){return t.users?t.users:[]})),s.map((function(t){return t.map((function(t){return t.user}))})))},e.prototype.listSecurityLogs=function(t,e,i,s){void 0===s&&(s="");var o={};return""!==s&&(o.filters=new bt({actionId:s})),this.iamApi.listSecurityLogs(Object.assign({userId:t,cursor:e,pageSize:i},o))},e.prototype.listUsers=function(t,e,i,s,o,r,n){var u={};return o&&o.length>0&&(u.subjectTypes=o),r&&r.length>0&&(u.searchTerms=r),this.iamApi.listUsers({namespace:t,email:e,cursor:i,pageSize:s,userFilter:u,sortOptions:n||[]})},e}();Ue.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ue(e.ɵɵinject(be),e.ɵɵinject(Ie),e.ɵɵinject(i.SessionService),e.ɵɵinject(De))},token:Ue,providedIn:"root"}),Ue.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ue.ctorParameters=function(){return[{type:be},{type:Ie},{type:i.SessionService},{type:De}]};var Ve=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(){return{headers:new o.HttpHeaders({"Content-Type":"application/json"}),withCredentials:!0}},t.prototype.getSessionForUser=function(t){var e=t.toApiJson?t:new Ot(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAMSso/GetSessionForUser",e.toApiJson(),this.apiOptions()).pipe(s.map((function(t){return St.fromProto(t)})),s.share())},t}();Ve.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ve(e.ɵɵinject(o.HttpClient),e.ɵɵinject(le))},token:Ve,providedIn:"root"}),Ve.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ve.ctorParameters=function(){return[{type:o.HttpClient},{type:le}]},t.AccessCheckFailures=N,t.AccessResourceRequest=st,t.AccessResourceRequestResourceEntityIdentifierEntry=oe,t.AddKeyRequest=ot,t.AddKeyResponse=rt,t.AddMultiUserRestrictionRequest=nt,t.Attribute=A,t.AuthenticateSubjectRequest=ut,t.BasePersona=Je,t.ChangeSubjectEmailRequest=at,t.Context=g,t.CreateExternalIDRequest=ct,t.CreateSessionRequest=ht,t.CreateSessionResponse=pt,t.CreateTemporarySubjectRequest=dt,t.CreateTemporarySubjectResponse=ft,t.DeleteSubjectRequest=vt,t.DeleteUserRequest=lt,t.DeveloperPersona=xe,t.DigitalAgentPersona=_e,t.FieldMask=_,t.GeoPointAttribute=j,t.GetImpersonationTokenRequest=mt,t.GetImpersonationTokenResponse=At,t.GetMultiExternalIDRequest=yt,t.GetMultiExternalIDResponse=gt,t.GetMultiUsersRequest=jt,t.GetMultiUsersResponse=It,t.GetMultiUsersResponseUserContainer=he,t.GetResetPasswordTokenRequest=Jt,t.GetSessionForUserRequest=Ot,t.GetSessionForUserResponse=St,t.GetSessionTokenRequest=Pt,t.GetShortLivedTokenRequest=xt,t.GetSubjectBySessionRequest=wt,t.GetSubjectContextRequest=Rt,t.GetSubjectContextResponse=Tt,t.GetSubjectResponse=Et,t.GetSubjectsByEmailRequest=kt,t.GetSubjectsRequest=Mt,t.GetSubjectsResponse=_t,t.GetTokenRequest=Ct,t.GetTokenResponse=Nt,t.HostService=le,t.IAMApiService=De,t.IAMListPersonasRequest=Lt,t.IAMService=Ue,t.IAMSsoApiService=Ve,t.Identifier=Q,t.IfClause=D,t.ListAttribute=I,t.ListPersonasByEmailRequest=Dt,t.ListPersonasRequest=Ut,t.ListPersonasResponse=Vt,t.ListSecurityLogsRequest=qt,t.ListSecurityLogsRequestFilters=bt,t.ListSecurityLogsResponse=Ft,t.ListUsersRequest=Wt,t.ListUsersResponse=Gt,t.MultiValueAttribute=J,t.MutateAttributesRequest=zt,t.Mutation=O,t.NamespacedContext=S,t.NamespacedEmail=X,t.NamespacedPersona=Se,t.NamespacedSession=$,t.OAuthCredentials=Kt,t.Operator=U,t.PartnerAppPersona=Re,t.PartnerPersona=we,t.Persona=P,t.Policy=V,t.PolicyNode=q,t.PublicKey=x,t.Query=w,t.RegisterPolicyRequest=Bt,t.RegisterResourceOwnerRequest=Yt,t.RegisterResourceRequest=Zt,t.RegisterSubjectRequest=Qt,t.RegisterSubjectResponse=Xt,t.RemoveKeyRequest=$t,t.RemoveMultiUserRestrictionRequest=te,t.ResetPasswordTokenResponse=ee,t.ResetPasswordWithTokenRequest=ie,t.ResetSubjectPasswordRequest=se,t.ResourceIdentifier=F,t.ResourceIdentifierIdentifiersEntry=L,t.ResourceOwner=W,t.SMBPersona=ke,t.SalespersonPersona=Ee,t.SearchSubjectRequest=re,t.SearchSubjectResponse=ne,t.SecurityLog=Z,t.SendEmailVerificationRequest=ue,t.SingleValueAttribute=R,t.StructAttribute=T,t.StructAttributeAttributesEntry=y,t.Subject=E,t.SubjectCredentials=ae,t.SubjectMissingValueClause=G,t.SubjectResourceForClause=z,t.SubjectResourceIntersectionClause=K,t.SubjectResourceSubsetClause=H,t.SubjectResult=k,t.SubjectValueIntersectionClause=B,t.TypedContext=M,t.TypedExternalIdentifier=tt,t.TypedPersona=Oe,t.UpdateUserRequest=ce,t.UpdateUserRequestOperation=Ht,t.User=et,t.UserFilter=pe,t.UserIAMApiService=be,t.UserIdentifier=de,t.UserSortOptions=fe,t.ValueList=Y,t.VendorPersona=Me,t.VerifyEmailRequest=ve,t.fromPersona=Le,Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function r(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}Object.create;function u(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,o,n=i.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(s=n.next()).done;)r.push(s.value)}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(o)throw o.error}}return r}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}Object.create;var p,h,f,d,l,v,b,m,A=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.intAttribute&&(i.intAttribute=parseInt(e.intAttribute,10)),e.structAttribute&&(i.structAttribute=I.fromProto(e.structAttribute)),e.listAttribute&&(i.listAttribute=j.fromProto(e.listAttribute)),e.timestampAttribute&&(i.timestampAttribute=new Date(e.timestampAttribute)),e.geopointAttribute&&(i.geopointAttribute=g.fromProto(e.geopointAttribute)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.intAttribute&&(t.intAttribute=this.intAttribute),void 0!==this.doubleAttribute&&(t.doubleAttribute=this.doubleAttribute),void 0!==this.stringAttribute&&(t.stringAttribute=this.stringAttribute),void 0!==this.boolAttribute&&(t.boolAttribute=this.boolAttribute),void 0!==this.structAttribute&&null!==this.structAttribute&&(t.structAttribute="toApiJson"in this.structAttribute?this.structAttribute.toApiJson():this.structAttribute),void 0!==this.listAttribute&&null!==this.listAttribute&&(t.listAttribute="toApiJson"in this.listAttribute?this.listAttribute.toApiJson():this.listAttribute),void 0!==this.timestampAttribute&&null!==this.timestampAttribute&&(t.timestampAttribute="toApiJson"in this.timestampAttribute?this.timestampAttribute.toApiJson():this.timestampAttribute),void 0!==this.geopointAttribute&&null!==this.geopointAttribute&&(t.geopointAttribute="toApiJson"in this.geopointAttribute?this.geopointAttribute.toApiJson():this.geopointAttribute),t},t}(),y=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.value&&(i.value=A.fromProto(e.value)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&null!==this.value&&(t.value="toApiJson"in this.value?this.value.toApiJson():this.value),t},t}(),g=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.latitude&&(t.latitude=this.latitude),void 0!==this.longitude&&(t.longitude=this.longitude),t},t}(),j=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.attributes&&(i.attributes=e.attributes.map(A.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),t},t}(),I=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.attributes&&(i.attributes=Object.keys(e.attributes).reduce((function(t,i){return t[i]=A.fromProto(e.attributes[i]),t}),{})),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),t},t}();(p=t.BooleanOperator||(t.BooleanOperator={}))[p.AND=0]="AND",p[p.OR=1]="OR",p[p.NOT=2]="NOT",(h=t.ForOperator||(t.ForOperator={}))[h.ANY=0]="ANY",h[h.ALL=1]="ALL",(f=t.AccessScope||(t.AccessScope={}))[f.READ=0]="READ",f[f.WRITE=1]="WRITE",f[f.DELETE=2]="DELETE",f[f.LIST=3]="LIST",(d=t.AlgorithmType||(t.AlgorithmType={}))[d.ALGORITHM_TYPE_ES256=0]="ALGORITHM_TYPE_ES256",d[d.ALGORITHM_TYPE_RS256=1]="ALGORITHM_TYPE_RS256",(l=t.OrderByDirection||(t.OrderByDirection={}))[l.ASCENDING=0]="ASCENDING",l[l.DESCENDING=1]="DESCENDING",(v=t.RestrictionType||(t.RestrictionType={}))[v.RESTRICTION_TYPE_UNSET=0]="RESTRICTION_TYPE_UNSET",v[v.RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN=1]="RESTRICTION_TYPE_RESET_PASSWORD_BEFORE_LOGIN",v[v.RESTRICTION_TYPE_FROZEN=2]="RESTRICTION_TYPE_FROZEN",(b=t.SortDirection||(t.SortDirection={}))[b.SORT_DIRECTION_INVALID=0]="SORT_DIRECTION_INVALID",b[b.SORT_DIRECTION_ASCENDING=1]="SORT_DIRECTION_ASCENDING",b[b.SORT_DIRECTION_DESCENDING=2]="SORT_DIRECTION_DESCENDING",(m=t.UserSortField||(t.UserSortField={}))[m.USER_SORT_FIELD_INVALID=0]="USER_SORT_FIELD_INVALID",m[m.USER_SORT_FIELD_CREATED=1]="USER_SORT_FIELD_CREATED",m[m.USER_SORT_FIELD_FIRST_NAME=2]="USER_SORT_FIELD_FIRST_NAME",m[m.USER_SORT_FIELD_LAST_NAME=3]="USER_SORT_FIELD_LAST_NAME",m[m.USER_SORT_FIELD_EMAIL=4]="USER_SORT_FIELD_EMAIL",m[m.USER_SORT_FIELD_LAST_LOGIN=5]="USER_SORT_FIELD_LAST_LOGIN";var J=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.namespaced&&(i.namespaced=P.fromProto(e.namespaced)),e.typed&&(i.typed=M.fromProto(e.typed)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.namespaced&&null!==this.namespaced&&(t.namespaced="toApiJson"in this.namespaced?this.namespaced.toApiJson():this.namespaced),void 0!==this.typed&&null!==this.typed&&(t.typed="toApiJson"in this.typed?this.typed.toApiJson():this.typed),t},t}(),O=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.values&&(t.values=this.values),t},t}(),S=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.add&&(i.add=T.fromProto(e.add)),e.replace&&(i.replace=O.fromProto(e.replace)),e.remove&&(i.remove=T.fromProto(e.remove)),e.replaceAttributes&&(i.replaceAttributes=I.fromProto(e.replaceAttributes)),e.addAttributes&&(i.addAttributes=I.fromProto(e.addAttributes)),e.removeAttributes&&(i.removeAttributes=I.fromProto(e.removeAttributes)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.add&&null!==this.add&&(t.add="toApiJson"in this.add?this.add.toApiJson():this.add),void 0!==this.replace&&null!==this.replace&&(t.replace="toApiJson"in this.replace?this.replace.toApiJson():this.replace),void 0!==this.remove&&null!==this.remove&&(t.remove="toApiJson"in this.remove?this.remove.toApiJson():this.remove),void 0!==this.dropKey&&(t.dropKey=this.dropKey),void 0!==this.replaceAttributes&&null!==this.replaceAttributes&&(t.replaceAttributes="toApiJson"in this.replaceAttributes?this.replaceAttributes.toApiJson():this.replaceAttributes),void 0!==this.addAttributes&&null!==this.addAttributes&&(t.addAttributes="toApiJson"in this.addAttributes?this.addAttributes.toApiJson():this.addAttributes),void 0!==this.removeAttributes&&null!==this.removeAttributes&&(t.removeAttributes="toApiJson"in this.removeAttributes?this.removeAttributes.toApiJson():this.removeAttributes),t},t}(),P=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.type&&(t.type=this.type),t},t}(),w=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subject&&(i.subject=E.fromProto(e.subject)),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.subject&&null!==this.subject&&(t.subject="toApiJson"in this.subject?this.subject.toApiJson():this.subject),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),t},t}(),x=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s,o,n=new e;return n=Object.assign(n,i),i.algorithmType&&(n.algorithmType=(s=t.AlgorithmType,"number"==typeof(o=i.algorithmType)?o:s[o])),n},e.prototype.toApiJson=function(){var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.id&&(t.id=this.id),void 0!==this.algorithmType&&(t.algorithmType=this.algorithmType),t},e}(),R=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.searchTerm&&(t.searchTerm=this.searchTerm),void 0!==this.attributeKeys&&(t.attributeKeys=this.attributeKeys),t},t}(),T=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&(t.value=this.value),t},t}(),E=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.attributes&&(i.attributes=e.attributes.map(O.fromProto)),e.created&&(i.created=new Date(e.created)),e.updated&&(i.updated=new Date(e.updated)),e.lastLogin&&(i.lastLogin=new Date(e.lastLogin)),e.publicKeys&&(i.publicKeys=e.publicKeys.map(x.fromProto)),e.structAttributes&&(i.structAttributes=I.fromProto(e.structAttributes)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.email&&(t.email=this.email),void 0!==this.userId&&(t.userId=this.userId),void 0!==this.partnerId&&(t.partnerId=this.partnerId),void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),void 0!==this.created&&null!==this.created&&(t.created="toApiJson"in this.created?this.created.toApiJson():this.created),void 0!==this.updated&&null!==this.updated&&(t.updated="toApiJson"in this.updated?this.updated.toApiJson():this.updated),void 0!==this.lastLogin&&null!==this.lastLogin&&(t.lastLogin="toApiJson"in this.lastLogin?this.lastLogin.toApiJson():this.lastLogin),void 0!==this.publicKeys&&null!==this.publicKeys&&(t.publicKeys="toApiJson"in this.publicKeys?this.publicKeys.toApiJson():this.publicKeys),void 0!==this.structAttributes&&null!==this.structAttributes&&(t.structAttributes="toApiJson"in this.structAttributes?this.structAttributes.toApiJson():this.structAttributes),t},t}(),_=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subject&&(i.subject=E.fromProto(e.subject)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.subject&&null!==this.subject&&(t.subject="toApiJson"in this.subject?this.subject.toApiJson():this.subject),t},t}(),M=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.type&&(t.type=this.type),t},t}();var k=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.paths&&(t.paths=this.paths),t},t}();function C(t,e){return"number"==typeof e?e:t[e]}var N=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.resourceAttributeValue&&(i.resourceAttributeValue=A.fromProto(e.resourceAttributeValue)),e.thenPolicy&&(i.thenPolicy=D.fromProto(e.thenPolicy)),e.elsePolicy&&(i.elsePolicy=D.fromProto(e.elsePolicy)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.resourceAttributeName&&(t.resourceAttributeName=this.resourceAttributeName),void 0!==this.resourceAttributeValue&&null!==this.resourceAttributeValue&&(t.resourceAttributeValue="toApiJson"in this.resourceAttributeValue?this.resourceAttributeValue.toApiJson():this.resourceAttributeValue),void 0!==this.thenPolicy&&null!==this.thenPolicy&&(t.thenPolicy="toApiJson"in this.thenPolicy?this.thenPolicy.toApiJson():this.thenPolicy),void 0!==this.elsePolicy&&null!==this.elsePolicy&&(t.elsePolicy="toApiJson"in this.elsePolicy?this.elsePolicy.toApiJson():this.elsePolicy),t},t}(),L=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.operator&&(s.operator=C(t.BooleanOperator,i.operator)),i.children&&(s.children=i.children.map(D.fromProto)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.operator&&(t.operator=this.operator),void 0!==this.children&&null!==this.children&&(t.children="toApiJson"in this.children?this.children.toApiJson():this.children),t},e}(),D=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subjectResourceIntersection&&(i.subjectResourceIntersection=V.fromProto(e.subjectResourceIntersection)),e.operator&&(i.operator=L.fromProto(e.operator)),e.subjectValueIntersection&&(i.subjectValueIntersection=F.fromProto(e.subjectValueIntersection)),e.subjectMissingValue&&(i.subjectMissingValue=U.fromProto(e.subjectMissingValue)),e.subjectResourceSubset&&(i.subjectResourceSubset=W.fromProto(e.subjectResourceSubset)),e.subjectResourceFor&&(i.subjectResourceFor=q.fromProto(e.subjectResourceFor)),e.ifClause&&(i.ifClause=N.fromProto(e.ifClause)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjectResourceIntersection&&null!==this.subjectResourceIntersection&&(t.subjectResourceIntersection="toApiJson"in this.subjectResourceIntersection?this.subjectResourceIntersection.toApiJson():this.subjectResourceIntersection),void 0!==this.operator&&null!==this.operator&&(t.operator="toApiJson"in this.operator?this.operator.toApiJson():this.operator),void 0!==this.subjectValueIntersection&&null!==this.subjectValueIntersection&&(t.subjectValueIntersection="toApiJson"in this.subjectValueIntersection?this.subjectValueIntersection.toApiJson():this.subjectValueIntersection),void 0!==this.subjectMissingValue&&null!==this.subjectMissingValue&&(t.subjectMissingValue="toApiJson"in this.subjectMissingValue?this.subjectMissingValue.toApiJson():this.subjectMissingValue),void 0!==this.subjectResourceSubset&&null!==this.subjectResourceSubset&&(t.subjectResourceSubset="toApiJson"in this.subjectResourceSubset?this.subjectResourceSubset.toApiJson():this.subjectResourceSubset),void 0!==this.subjectResourceFor&&null!==this.subjectResourceFor&&(t.subjectResourceFor="toApiJson"in this.subjectResourceFor?this.subjectResourceFor.toApiJson():this.subjectResourceFor),void 0!==this.ifClause&&null!==this.ifClause&&(t.ifClause="toApiJson"in this.ifClause?this.ifClause.toApiJson():this.ifClause),t},t}(),U=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),t},t}(),q=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.operator&&(s.operator=C(t.ForOperator,i.operator)),i.rules&&(s.rules=D.fromProto(i.rules)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.operator&&(t.operator=this.operator),void 0!==this.rules&&null!==this.rules&&(t.rules="toApiJson"in this.rules?this.rules.toApiJson():this.rules),t},e}(),V=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.resourceAttributeName&&(t.resourceAttributeName=this.resourceAttributeName),t},t}(),W=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.resourceAttributeName&&(t.resourceAttributeName=this.resourceAttributeName),t},t}(),F=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.structuredAttributeValue&&(i.structuredAttributeValue=A.fromProto(e.structuredAttributeValue)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.attributeName&&(t.attributeName=this.attributeName),void 0!==this.attributeValue&&(t.attributeValue=this.attributeValue),void 0!==this.structuredAttributeValue&&null!==this.structuredAttributeValue&&(t.structuredAttributeValue="toApiJson"in this.structuredAttributeValue?this.structuredAttributeValue.toApiJson():this.structuredAttributeValue),t},t}();var G=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.failures&&(i.failures=e.failures.map(B.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.failures&&null!==this.failures&&(t.failures="toApiJson"in this.failures?this.failures.toApiJson():this.failures),t},t}(),z=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.value&&(i.value=Y.fromProto(e.value)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&null!==this.value&&(t.value="toApiJson"in this.value?this.value.toApiJson():this.value),t},t}(),K=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.operations&&(s.operations=i.operations.map((function(e){return i=t.AccessScope,"number"==typeof(s=e)?s:i[s];var i,s}))),i.policy&&(s.policy=D.fromProto(i.policy)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.appId&&(t.appId=this.appId),void 0!==this.resourceId&&(t.resourceId=this.resourceId),void 0!==this.policyId&&(t.policyId=this.policyId),void 0!==this.policyName&&(t.policyName=this.policyName),void 0!==this.operations&&(t.operations=this.operations),void 0!==this.actions&&(t.actions=this.actions),void 0!==this.policy&&null!==this.policy&&(t.policy="toApiJson"in this.policy?this.policy.toApiJson():this.policy),t},e}(),B=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.identifiers&&(i.identifiers=Object.keys(e.identifiers).reduce((function(t,i){return t[i]=Y.fromProto(e.identifiers[i]),t}),{})),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.identifiers&&null!==this.identifiers&&(t.identifiers="toApiJson"in this.identifiers?this.identifiers.toApiJson():this.identifiers),t},t}(),H=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.appId&&(t.appId=this.appId),void 0!==this.appName&&(t.appName=this.appName),t},t}(),Y=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.values&&(t.values=this.values),t},t}();var Z=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.created&&(i.created=new Date(e.created)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.actionId&&(t.actionId=this.actionId),void 0!==this.logId&&(t.logId=this.logId),void 0!==this.description&&(t.description=this.description),void 0!==this.created&&null!==this.created&&(t.created="toApiJson"in this.created?this.created.toApiJson():this.created),t},t}();var Q=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.userId&&(t.userId=this.userId),t},t}(),X=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.email&&(t.email=this.email),t},t}(),$=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.session&&(t.session=this.session),t},t}(),tt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.externalIdType&&(t.externalIdType=this.externalIdType),void 0!==this.externalId&&(t.externalId=this.externalId),t},t}(),et=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.created&&(i.created=new Date(e.created)),e.updated&&(i.updated=new Date(e.updated)),e.lastLogin&&(i.lastLogin=new Date(e.lastLogin)),e.publicKeys&&(i.publicKeys=e.publicKeys.map(x.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.email&&(t.email=this.email),void 0!==this.created&&null!==this.created&&(t.created="toApiJson"in this.created?this.created.toApiJson():this.created),void 0!==this.updated&&null!==this.updated&&(t.updated="toApiJson"in this.updated?this.updated.toApiJson():this.updated),void 0!==this.firstName&&(t.firstName=this.firstName),void 0!==this.greetingName&&(t.greetingName=this.greetingName),void 0!==this.lastName&&(t.lastName=this.lastName),void 0!==this.languageCode&&(t.languageCode=this.languageCode),void 0!==this.emailVerified&&(t.emailVerified=this.emailVerified),void 0!==this.roles&&(t.roles=this.roles),void 0!==this.lastLogin&&null!==this.lastLogin&&(t.lastLogin="toApiJson"in this.lastLogin?this.lastLogin.toApiJson():this.lastLogin),void 0!==this.publicKeys&&null!==this.publicKeys&&(t.publicKeys="toApiJson"in this.publicKeys?this.publicKeys.toApiJson():this.publicKeys),t},t}();function it(t,e){return"number"==typeof e?e:t[e]}var st,ot=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.context&&(s.context=J.fromProto(i.context)),i.resourceEntityIdentifier&&(s.resourceEntityIdentifier=Object.keys(i.resourceEntityIdentifier).reduce((function(t,e){return t[e]=Y.fromProto(i.resourceEntityIdentifier[e]),t}),{})),i.accessScope&&(s.accessScope=i.accessScope.map((function(e){return it(t.AccessScope,e)}))),i.resourceEntityIdentifiers&&(s.resourceEntityIdentifiers=i.resourceEntityIdentifiers.map(B.fromProto)),i.resourceAttributes&&(s.resourceAttributes=I.fromProto(i.resourceAttributes)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.email&&(t.email=this.email),void 0!==this.userId&&(t.userId=this.userId),void 0!==this.session&&(t.session=this.session),void 0!==this.ownerId&&(t.ownerId=this.ownerId),void 0!==this.resourceId&&(t.resourceId=this.resourceId),void 0!==this.resourceEntityIdentifier&&null!==this.resourceEntityIdentifier&&(t.resourceEntityIdentifier="toApiJson"in this.resourceEntityIdentifier?this.resourceEntityIdentifier.toApiJson():this.resourceEntityIdentifier),void 0!==this.accessScope&&(t.accessScope=this.accessScope),void 0!==this.actions&&(t.actions=this.actions),void 0!==this.resourceEntityIdentifiers&&null!==this.resourceEntityIdentifiers&&(t.resourceEntityIdentifiers="toApiJson"in this.resourceEntityIdentifiers?this.resourceEntityIdentifiers.toApiJson():this.resourceEntityIdentifiers),void 0!==this.resourceAttributes&&null!==this.resourceAttributes&&(t.resourceAttributes="toApiJson"in this.resourceAttributes?this.resourceAttributes.toApiJson():this.resourceAttributes),t},e}(),nt=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.context&&(s.context=J.fromProto(i.context)),i.algorithmType&&(s.algorithmType=it(t.AlgorithmType,i.algorithmType)),i.userIdentifier&&(s.userIdentifier=he.fromProto(i.userIdentifier)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.algorithmType&&(t.algorithmType=this.algorithmType),void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},e}(),rt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.privateKey&&(t.privateKey=this.privateKey),void 0!==this.keyId&&(t.keyId=this.keyId),t},t}(),ut=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.userIdentifiers&&(s.userIdentifiers=i.userIdentifiers.map(he.fromProto)),i.restrictionType&&(s.restrictionType=it(t.RestrictionType,i.restrictionType)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),void 0!==this.restrictionType&&(t.restrictionType=this.restrictionType),t},e}(),ct=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),void 0!==this.password&&(t.password=this.password),t},t}(),at=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.newEmail&&(t.newEmail=this.newEmail),t},t}(),pt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifier&&(i.userIdentifier=he.fromProto(e.userIdentifier)),e.typedExternalIdentifier&&(i.typedExternalIdentifier=tt.fromProto(e.typedExternalIdentifier)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),void 0!==this.typedExternalIdentifier&&null!==this.typedExternalIdentifier&&(t.typedExternalIdentifier="toApiJson"in this.typedExternalIdentifier?this.typedExternalIdentifier.toApiJson():this.typedExternalIdentifier),t},t}(),ht=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.oauthCredentials&&(i.oauthCredentials=zt.fromProto(e.oauthCredentials)),e.subjectCredentials&&(i.subjectCredentials=ue.fromProto(e.subjectCredentials)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.oauthCredentials&&null!==this.oauthCredentials&&(t.oauthCredentials="toApiJson"in this.oauthCredentials?this.oauthCredentials.toApiJson():this.oauthCredentials),void 0!==this.subjectCredentials&&null!==this.subjectCredentials&&(t.subjectCredentials="toApiJson"in this.subjectCredentials?this.subjectCredentials.toApiJson():this.subjectCredentials),t},t}(),ft=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.session&&(t.session=this.session),t},t}(),dt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.attributes&&(i.attributes=I.fromProto(e.attributes)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subject&&(t.subject=this.subject),void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),t},t}(),lt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.session&&(t.session=this.session),t},t}(),vt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),bt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifier&&(i.userIdentifier=he.fromProto(e.userIdentifier)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},t}(),mt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.actionId&&(t.actionId=this.actionId),t},t}(),At=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.impersonatee&&(i.impersonatee=he.fromProto(e.impersonatee)),e.impersonator&&(i.impersonator=he.fromProto(e.impersonator)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.impersonatee&&null!==this.impersonatee&&(t.impersonatee="toApiJson"in this.impersonatee?this.impersonatee.toApiJson():this.impersonatee),void 0!==this.impersonator&&null!==this.impersonator&&(t.impersonator="toApiJson"in this.impersonator?this.impersonator.toApiJson():this.impersonator),t},t}(),yt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),gt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifiers&&(i.userIdentifiers=e.userIdentifiers.map(he.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),void 0!==this.externalIdType&&(t.externalIdType=this.externalIdType),t},t}(),jt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.externalIds&&(t.externalIds=this.externalIds),t},t}(),It=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifiers&&(i.userIdentifiers=e.userIdentifiers.map(he.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),t},t}(),Jt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.users&&(i.users=e.users.map(ae.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.users&&null!==this.users&&(t.users="toApiJson"in this.users?this.users.toApiJson():this.users),t},t}(),Ot=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.userIdentifier&&(i.userIdentifier=he.fromProto(e.userIdentifier)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},t}(),St=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),Pt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),t},t}(),wt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.session&&(t.session=this.session),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),t},t}(),xt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),Rt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),t},t}(),Tt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subject&&(i.subject=_.fromProto(e.subject)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.subject&&null!==this.subject&&(t.subject="toApiJson"in this.subject?this.subject.toApiJson():this.subject),t},t}(),Et=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.fieldMask&&(i.fieldMask=k.fromProto(e.fieldMask)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.emails&&(t.emails=this.emails),void 0!==this.fieldMask&&null!==this.fieldMask&&(t.fieldMask="toApiJson"in this.fieldMask?this.fieldMask.toApiJson():this.fieldMask),t},t}(),_t=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.fieldMask&&(i.fieldMask=k.fromProto(e.fieldMask)),e.identifiers&&(i.identifiers=e.identifiers.map(Q.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectIds&&(t.subjectIds=this.subjectIds),void 0!==this.fieldMask&&null!==this.fieldMask&&(t.fieldMask="toApiJson"in this.fieldMask?this.fieldMask.toApiJson():this.fieldMask),void 0!==this.identifiers&&null!==this.identifiers&&(t.identifiers="toApiJson"in this.identifiers?this.identifiers.toApiJson():this.identifiers),t},t}(),Mt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.subjects&&(i.subjects=e.subjects.map(_.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjects&&null!==this.subjects&&(t.subjects="toApiJson"in this.subjects?this.subjects.toApiJson():this.subjects),t},t}(),kt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return{}},t}(),Ct=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),Nt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.userIdentifier&&(i.userIdentifier=he.fromProto(e.userIdentifier)),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.type&&(t.type=this.type),void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.alwaysIncludeSuperadmin&&(t.alwaysIncludeSuperadmin=this.alwaysIncludeSuperadmin),t},t}(),Lt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.type&&(t.type=this.type),void 0!==this.namespace&&(t.namespace=this.namespace),t},t}(),Dt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.session&&(t.session=this.session),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.type&&(t.type=this.type),void 0!==this.namespace&&(t.namespace=this.namespace),t},t}(),Ut=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.personas&&(i.personas=e.personas.map(w.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.personas&&null!==this.personas&&(t.personas="toApiJson"in this.personas?this.personas.toApiJson():this.personas),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),t},t}(),qt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.filters&&(i.filters=mt.fromProto(e.filters)),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.filters&&null!==this.filters&&(t.filters="toApiJson"in this.filters?this.filters.toApiJson():this.filters),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.cursor&&(t.cursor=this.cursor),t},t}(),Vt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.logs&&(i.logs=e.logs.map(Z.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.logs&&null!==this.logs&&(t.logs="toApiJson"in this.logs?this.logs.toApiJson():this.logs),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),t},t}(),Wt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.pageSize&&(i.pageSize=parseInt(e.pageSize,10)),e.userFilter&&(i.userFilter=pe.fromProto(e.userFilter)),e.sortOptions&&(i.sortOptions=e.sortOptions.map(fe.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.namespace&&(t.namespace=this.namespace),void 0!==this.email&&(t.email=this.email),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.userFilter&&null!==this.userFilter&&(t.userFilter="toApiJson"in this.userFilter?this.userFilter.toApiJson():this.userFilter),void 0!==this.sortOptions&&null!==this.sortOptions&&(t.sortOptions="toApiJson"in this.sortOptions?this.sortOptions.toApiJson():this.sortOptions),t},t}(),Ft=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.users&&(i.users=e.users.map(et.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.users&&null!==this.users&&(t.users="toApiJson"in this.users?this.users.toApiJson():this.users),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),t},t}(),Gt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.mutations&&(i.mutations=e.mutations.map(S.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.mutations&&null!==this.mutations&&(t.mutations="toApiJson"in this.mutations?this.mutations.toApiJson():this.mutations),t},t}(),zt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.provider&&(t.provider=this.provider),void 0!==this.idToken&&(t.idToken=this.idToken),void 0!==this.accessToken&&(t.accessToken=this.accessToken),t},t}(),Kt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.firstName&&(t.firstName=this.firstName),void 0!==this.greetingName&&(t.greetingName=this.greetingName),void 0!==this.lastName&&(t.lastName=this.lastName),void 0!==this.languageCode&&(t.languageCode=this.languageCode),t},t}(),Bt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.policy&&(i.policy=K.fromProto(e.policy)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.policy&&null!==this.policy&&(t.policy="toApiJson"in this.policy?this.policy.toApiJson():this.policy),t},t}(),Ht=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.owner&&(i.owner=H.fromProto(e.owner)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.owner&&null!==this.owner&&(t.owner="toApiJson"in this.owner?this.owner.toApiJson():this.owner),t},t}(),Yt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.appId&&(t.appId=this.appId),void 0!==this.resourceId&&(t.resourceId=this.resourceId),void 0!==this.resourceName&&(t.resourceName=this.resourceName),void 0!==this.resourceOwnerServiceUrl&&(t.resourceOwnerServiceUrl=this.resourceOwnerServiceUrl),void 0!==this.requiredResourceParams&&(t.requiredResourceParams=this.requiredResourceParams),void 0!==this.resourceOwnerAudience&&(t.resourceOwnerAudience=this.resourceOwnerAudience),t},t}(),Zt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.attributes&&(i.attributes=e.attributes.map(O.fromProto)),e.structAttributes&&(i.structAttributes=I.fromProto(e.structAttributes)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.email&&(t.email=this.email),void 0!==this.password&&(t.password=this.password),void 0!==this.attributes&&null!==this.attributes&&(t.attributes="toApiJson"in this.attributes?this.attributes.toApiJson():this.attributes),void 0!==this.structAttributes&&null!==this.structAttributes&&(t.structAttributes="toApiJson"in this.structAttributes?this.structAttributes.toApiJson():this.structAttributes),t},t}(),Qt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),Xt=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),e.userIdentifier&&(i.userIdentifier=he.fromProto(e.userIdentifier)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.keyId&&(t.keyId=this.keyId),void 0!==this.userIdentifier&&null!==this.userIdentifier&&(t.userIdentifier="toApiJson"in this.userIdentifier?this.userIdentifier.toApiJson():this.userIdentifier),t},t}(),$t=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.userIdentifiers&&(s.userIdentifiers=i.userIdentifiers.map(he.fromProto)),i.restrictionType&&(s.restrictionType=it(t.RestrictionType,i.restrictionType)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.userIdentifiers&&null!==this.userIdentifiers&&(t.userIdentifiers="toApiJson"in this.userIdentifiers?this.userIdentifiers.toApiJson():this.userIdentifiers),void 0!==this.restrictionType&&(t.restrictionType=this.restrictionType),t},e}(),te=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.token&&(t.token=this.token),t},t}(),ee=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.token&&(t.token=this.token),void 0!==this.password&&(t.password=this.password),t},t}(),ie=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.context&&(i.context=J.fromProto(e.context)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.subjectId&&(t.subjectId=this.subjectId),void 0!==this.newPassword&&(t.newPassword=this.newPassword),t},t}(),se=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.value&&(i.value=Y.fromProto(e.value)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.key&&(t.key=this.key),void 0!==this.value&&null!==this.value&&(t.value="toApiJson"in this.value?this.value.toApiJson():this.value),t},t}(),oe=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.context&&(s.context=J.fromProto(i.context)),i.query&&(s.query=R.fromProto(i.query)),i.filters&&(s.filters=i.filters.map(T.fromProto)),i.orderByDirection&&(s.orderByDirection=it(t.OrderByDirection,i.orderByDirection)),i.pageSize&&(s.pageSize=parseInt(i.pageSize,10)),i.fieldMask&&(s.fieldMask=k.fromProto(i.fieldMask)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.context&&null!==this.context&&(t.context="toApiJson"in this.context?this.context.toApiJson():this.context),void 0!==this.query&&null!==this.query&&(t.query="toApiJson"in this.query?this.query.toApiJson():this.query),void 0!==this.filters&&null!==this.filters&&(t.filters="toApiJson"in this.filters?this.filters.toApiJson():this.filters),void 0!==this.orderBy&&(t.orderBy=this.orderBy),void 0!==this.orderByDirection&&(t.orderByDirection=this.orderByDirection),void 0!==this.cursor&&(t.cursor=this.cursor),void 0!==this.pageSize&&(t.pageSize=this.pageSize),void 0!==this.fieldMask&&null!==this.fieldMask&&(t.fieldMask="toApiJson"in this.fieldMask?this.fieldMask.toApiJson():this.fieldMask),t},e}(),ne=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.result&&(i.result=e.result.map(_.fromProto)),e.totalResults&&(i.totalResults=parseInt(e.totalResults,10)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.result&&null!==this.result&&(t.result="toApiJson"in this.result?this.result.toApiJson():this.result),void 0!==this.nextCursor&&(t.nextCursor=this.nextCursor),void 0!==this.hasMore&&(t.hasMore=this.hasMore),void 0!==this.totalResults&&(t.totalResults=this.totalResults),t},t}(),re=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.userId&&(t.userId=this.userId),t},t}(),ue=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.email&&(t.email=this.email),void 0!==this.password&&(t.password=this.password),t},t}(),ce=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.operations&&(i.operations=e.operations.map(Kt.fromProto)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.operations&&null!==this.operations&&(t.operations="toApiJson"in this.operations?this.operations.toApiJson():this.operations),t},t}(),ae=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.user&&(i.user=et.fromProto(e.user)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.user&&null!==this.user&&(t.user="toApiJson"in this.user?this.user.toApiJson():this.user),t},t}(),pe=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.subjectTypes&&(t.subjectTypes=this.subjectTypes),void 0!==this.searchTerms&&(t.searchTerms=this.searchTerms),t},t}(),he=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e),e.namespacedEmail&&(i.namespacedEmail=X.fromProto(e.namespacedEmail)),e.namespacedSession&&(i.namespacedSession=$.fromProto(e.namespacedSession)),e.typedExternalIdentifier&&(i.typedExternalIdentifier=tt.fromProto(e.typedExternalIdentifier)),i},t.prototype.toApiJson=function(){var t={};return void 0!==this.userId&&(t.userId=this.userId),void 0!==this.namespacedEmail&&null!==this.namespacedEmail&&(t.namespacedEmail="toApiJson"in this.namespacedEmail?this.namespacedEmail.toApiJson():this.namespacedEmail),void 0!==this.namespacedSession&&null!==this.namespacedSession&&(t.namespacedSession="toApiJson"in this.namespacedSession?this.namespacedSession.toApiJson():this.namespacedSession),void 0!==this.token&&(t.token=this.token),void 0!==this.typedExternalIdentifier&&null!==this.typedExternalIdentifier&&(t.typedExternalIdentifier="toApiJson"in this.typedExternalIdentifier?this.typedExternalIdentifier.toApiJson():this.typedExternalIdentifier),void 0!==this.subjectId&&(t.subjectId=this.subjectId),t},t}(),fe=function(){function e(t){t&&Object.assign(this,t)}return e.fromProto=function(i){var s=new e;return s=Object.assign(s,i),i.direction&&(s.direction=it(t.SortDirection,i.direction)),i.field&&(s.field=it(t.UserSortField,i.field)),s},e.prototype.toApiJson=function(){var t={};return void 0!==this.direction&&(t.direction=this.direction),void 0!==this.field&&(t.field=this.field),t},e}(),de=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.token&&(t.token=this.token),t},t}();(st=t.PersonaType||(t.PersonaType={})).partner="partner",st.partner_app="partner_app",st.sales_person="sales_person",st.smb="smb",st.vendor="vendor",st.digital_agent="digital_agent",st.developer="developer",st.success="success",st.account_group="account_group";var le=function(){function t(){}return t.prototype.fromPersona=function(t){var e=t.subject;return this.subjectId=e.subjectId,this.email=e.email,this.created=e.created,this.updated=e.updated,this.lastLogin=e.lastLogin,this.userId=e.userId,this.readAttributes(e.structAttributes)},t.prototype.readAttributes=function(t){if(!t)return this;var e=function t(e){var i,s;if(void 0===e)return null;if(void 0!==e.stringAttribute)return e.stringAttribute;if(void 0!==e.intAttribute)return e.intAttribute;if(void 0!==e.doubleAttribute)return e.doubleAttribute;if(void 0!==e.boolAttribute)return e.boolAttribute;if(void 0!==e.listAttribute){var o=[];if(void 0===e.listAttribute.attributes)return o;try{for(var n=u(e.listAttribute.attributes),r=n.next();!r.done;r=n.next()){var c=r.value;o.push(t(c))}}catch(t){i={error:t}}finally{try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(i)throw i.error}}return o}if(void 0!==e.timestampAttribute)return e.timestampAttribute;if(void 0!==e.geopointAttribute)return e.geopointAttribute;if(void 0!==e.structAttribute){var a={};for(var p in e.structAttribute.attributes)e.structAttribute.attributes.hasOwnProperty(p)&&(a[me(p)]=t(e.structAttribute.attributes[p]));return a}}({structAttribute:{attributes:t.attributes}});return Object.assign(this,e),this},t}(),ve=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(le),be=function(t){function e(){var e=t.apply(this,a(arguments))||this;return e.partnerId="",e}return r(e,t),e.prototype.fromPersona=function(e){return this.partnerId=e.context.namespaced.namespace,t.prototype.fromPersona.call(this,e)},e}(le);function me(t){for(var e="",i=0;i<t.length;i++)"_"===t[i]?(e+=t[i+1].toUpperCase(),i++):e+=t[i];return e}var Ae=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.developer,i}return r(i,e),i}(ve),ye=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.partner,i.isSuperAdmin=!1,i.isAdmin=!1,i.canCustomizeWhitelabel=!1,i.canAccessBilling=!1,i.canAccessAccounts=!1,i.canAccessMarketing=!1,i.canAccessSales=!1,i.canAccessConcierge=!1,i.canAccessBrands=!1,i.canAccessDashboard=!1,i.canAccessOrders=!1,i.canAccessCompanyProfile=!1,i.canAccessAutomations=!1,i.canAccessMarketplace=!1,i.canEnableApps=!1,i.canAccessRetailBilling=!1,i}return r(i,e),i}(ve),ge=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.partner_app,i}return r(i,e),i}(be),je="partnerForSmb",Ie=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.sales_person,i.titleChoice=je,i}return r(i,e),i}(be),Je=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.smb,i.notificationsEnabled=!0,i}return r(i,e),i}(be),Oe=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.vendor,i}return r(i,e),i}(ve),Se=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.digital_agent,i}return r(i,e),i}(ve),Pe=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.success,i}return r(i,e),i}(ve),we=function(e){function i(){var i=e.apply(this,a(arguments))||this;return i.type=t.PersonaType.account_group,i}return r(i,e),i}(ve);function xe(e){var i=function(e){switch(e.namespaced?e.namespaced.type:e.typed.type){case"partner":return t.PersonaType.partner;case"partner_app":return t.PersonaType.partner_app;case"sales_person":return t.PersonaType.sales_person;case"smb":return t.PersonaType.smb;case"vendor":return t.PersonaType.vendor;case"digital_agent":return t.PersonaType.digital_agent;case"developer":return t.PersonaType.developer;case"success":return t.PersonaType.success;case"account_group":return t.PersonaType.account_group}return null}(e.context);if(null===i)return null;var s=new{partner:ye,partner_app:ge,sales_person:Ie,smb:Je,vendor:Oe,digital_agent:Se,developer:Ae,success:Pe,account_group:we}[i];return s.fromPersona(e),s}var Re=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){var t={};return void 0!==this.scope&&(t.scope=this.scope),void 0!==this.public&&(t.public=this.public),t},t}(),Te=function(){function t(t){this.environmentService=t}return t.prototype.host=function(){if(this._host)return this._host;switch(this.environmentService.getEnvironment()){case o.Environment.LOCAL:this._host="iam.vendasta-local.com";break;case o.Environment.TEST:this._host="";break;case o.Environment.DEMO:this._host="iam-api-demo.apigateway.co";break;case o.Environment.PROD:this._host="iam-api-prod.apigateway.co"}return this._host},t.prototype.httpsHost=function(){if(this._httpsHost)return this._httpsHost;switch(this.environmentService.getEnvironment()){case o.Environment.LOCAL:this._httpsHost="iam.vendasta-local.com";break;case o.Environment.TEST:this._httpsHost="";break;case o.Environment.DEMO:this._httpsHost="iam-demo.apigateway.co";break;case o.Environment.PROD:this._httpsHost="iam-prod.apigateway.co"}return this._httpsHost},t.prototype.hostWithScheme=function(){return(this.environmentService.getEnvironment()===o.Environment.LOCAL?"http://":"https://")+this.host()},t.prototype.httpsHostWithScheme=function(){return(this.environmentService.getEnvironment()===o.Environment.LOCAL?"http://":"https://")+this.httpsHost()},t}();Te.ɵfac=function(t){return new(t||Te)(e.ɵɵinject(o.EnvironmentService))},Te.ɵprov=e.ɵɵdefineInjectable({token:Te,factory:Te.ɵfac,providedIn:"root"});var Ee=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(){return{headers:new s.HttpHeaders({"Content-Type":"application/json"}),withCredentials:!0}},t.prototype.getSubjectBySession=function(t){var e=t.toApiJson?t:new wt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetSubjectBySession",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Tt.fromProto(t)})),i.share())},t.prototype.listPersonas=function(t){var e=t.toApiJson?t:new Dt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/ListPersonas",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ut.fromProto(t)})),i.share())},t.prototype.getToken=function(t){var e=t.toApiJson?t:new kt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetToken",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ct.fromProto(t)})),i.share())},t.prototype.getSessionToken=function(t){var e=t.toApiJson?t:new St(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetSessionToken",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ct.fromProto(t)})),i.share())},t.prototype.resetPasswordWithToken=function(t){var e=t.toApiJson?t:new ee(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/ResetPasswordWithToken",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getImpersonationToken=function(t){var e=t.toApiJson?t:new At(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.UserIAM/GetImpersonationToken",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return yt.fromProto(t)})),i.share())},t}();Ee.ɵfac=function(t){return new(t||Ee)(e.ɵɵinject(s.HttpClient),e.ɵɵinject(Te))},Ee.ɵprov=e.ɵɵdefineInjectable({token:Ee,factory:Ee.ɵfac,providedIn:"root"});var _e=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){if(!e)return new t;var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return void 0===this.namespace&&void 0===this.type&&void 0===this.email&&void 0===this.password&&void 0===this.providerIdToken&&void 0===this.provider?{}:{namespace:void 0!==this.namespace?this.namespace:null,type:void 0!==this.type?this.type:null,email:void 0!==this.email?this.email:null,password:void 0!==this.password?this.password:null,provider_id_token:void 0!==this.providerIdToken?this.providerIdToken:null,provider:void 0!==this.provider?this.provider:null}},t}(),Me=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i.sessionId=e.session_id,i},t.prototype.toApiJson=function(){return void 0===this.sessionId?{}:{sessionId:void 0!==this.sessionId?this.sessionId:null}},t}(),ke=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return void 0===this.success?{}:{success:void 0!==this.success?this.success:null}},t}(),Ce=function(){function t(t){t&&Object.assign(this,t)}return t.fromProto=function(e){var i=new t;return i=Object.assign(i,e)},t.prototype.toApiJson=function(){return void 0===this.nextUrl&&void 0===this.namespace&&void 0===this.type?null:{next_url:void 0!==this.nextUrl?this.nextUrl:null,namespace:void 0!==this.namespace?this.namespace:null,type:void 0!==this.type?this.type:null}},t}(),Ne=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(t){return t?{headers:new s.HttpHeaders({"Content-Type":"application/x-www-form-urlencoded"}),withCredentials:!0}:{headers:new s.HttpHeaders({"Content-Type":"application/x-www-form-urlencoded"})}},t.prototype.login=function(t){var e=void 0!==t.toApiJson?t:new _e(t);return this.http.post(this.hostService.httpsHostWithScheme()+"/_ajax/v1/login",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Me.fromProto(t)})),i.share())},t.prototype.logout=function(){return this.http.post(this.hostService.httpsHostWithScheme()+"/_ajax/v1/logout",{},this.apiOptions(!0)).pipe(i.map((function(t){return ke.fromProto(t)})),i.share())},t.prototype.ssoLogin=function(t){var e=void 0!==t.toApiJson?t:new Ce(t),i=new URLSearchParams,s=e.toApiJson();for(var o in s)if(s.hasOwnProperty(o)){var n=s[o];null!==n&&i.append(o,n)}window.location.href=this.hostService.httpsHostWithScheme()+"/sso-login?"+i.toString()},t}();Ne.ɵfac=function(t){return new(t||Ne)(e.ɵɵinject(s.HttpClient),e.ɵɵinject(Te))},Ne.ɵprov=e.ɵɵdefineInjectable({token:Ne,factory:Ne.ɵfac,providedIn:"root"});var Le=function(){function t(t,e){this.http=t,this.hostService=e}return t.prototype.apiOptions=function(){return{headers:new s.HttpHeaders({"Content-Type":"application/json"}),withCredentials:!0}},t.prototype.registerSubject=function(t){var e=t.toApiJson?t:new Zt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterSubject",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Qt.fromProto(t)})),i.share())},t.prototype.authenticateSubject=function(t){var e=t.toApiJson?t:new ct(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AuthenticateSubject",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getSubjects=function(t){var e=t.toApiJson?t:new _t(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSubjects",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Mt.fromProto(t)})),i.share())},t.prototype.getSubjectsByEmail=function(t){var e=t.toApiJson?t:new Et(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSubjectsByEmail",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Mt.fromProto(t)})),i.share())},t.prototype.mutateAttributes=function(t){var e=t.toApiJson?t:new Gt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/MutateAttributes",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.resetSubjectPassword=function(t){var e=t.toApiJson?t:new ie(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ResetSubjectPassword",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.changeSubjectEmail=function(t){var e=t.toApiJson?t:new at(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ChangeSubjectEmail",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.deleteSubject=function(t){var e=t.toApiJson?t:new vt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/DeleteSubject",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.searchSubject=function(t){var e=t.toApiJson?t:new oe(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/SearchSubject",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return ne.fromProto(t)})),i.share())},t.prototype.getSubjectContext=function(t){var e=t.toApiJson?t:new xt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSubjectContext",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Rt.fromProto(t)})),i.share())},t.prototype.registerResourceOwner=function(t){var e=t.toApiJson?t:new Ht(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterResourceOwner",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.registerResource=function(t){var e=t.toApiJson?t:new Yt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterResource",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.registerPolicy=function(t){var e=t.toApiJson?t:new Bt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RegisterPolicy",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.accessResource=function(t){var e=t.toApiJson?t:new ot(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AccessResource",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getShortLivedToken=function(t){var e=t.toApiJson?t:new Pt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetShortLivedToken",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ct.fromProto(t)})),i.share())},t.prototype.getSessionToken=function(t){var e=t.toApiJson?t:new St(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetSessionToken",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ct.fromProto(t)})),i.share())},t.prototype.addKey=function(t){var e=t.toApiJson?t:new nt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AddKey",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return rt.fromProto(t)})),i.share())},t.prototype.removeKey=function(t){var e=t.toApiJson?t:new Xt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RemoveKey",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.createSession=function(t){var e=t.toApiJson?t:new ht(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/CreateSession",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return ft.fromProto(t)})),i.share())},t.prototype.getResetPasswordToken=function(t){var e=t.toApiJson?t:new Ot(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetResetPasswordToken",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return te.fromProto(t)})),i.share())},t.prototype.listPersonasByEmail=function(t){var e=t.toApiJson?t:new Lt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListPersonasByEmail",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ut.fromProto(t)})),i.share())},t.prototype.listPersonas=function(t){var e=t.toApiJson?t:new Nt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListPersonas",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ut.fromProto(t)})),i.share())},t.prototype.createTemporarySubject=function(t){var e=t.toApiJson?t:new dt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/CreateTemporarySubject",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return lt.fromProto(t)})),i.share())},t.prototype.getMultiUsers=function(t){var e=t.toApiJson?t:new It(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetMultiUsers",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Jt.fromProto(t)})),i.share())},t.prototype.listUsers=function(t){var e=t.toApiJson?t:new Wt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListUsers",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Ft.fromProto(t)})),i.share())},t.prototype.updateUser=function(t){var e=t.toApiJson?t:new ce(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/UpdateUser",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.deleteUser=function(t){var e=t.toApiJson?t:new bt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/DeleteUser",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.listSecurityLogs=function(t){var e=t.toApiJson?t:new qt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/ListSecurityLogs",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return Vt.fromProto(t)})),i.share())},t.prototype.verifyEmail=function(t){var e=t.toApiJson?t:new de(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/VerifyEmail",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.sendEmailVerification=function(t){var e=t.toApiJson?t:new re(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/SendEmailVerification",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.getMultiExternalId=function(t){var e=t.toApiJson?t:new gt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/GetMultiExternalID",e.toApiJson(),this.apiOptions()).pipe(i.map((function(t){return jt.fromProto(t)})),i.share())},t.prototype.createExternalId=function(t){var e=t.toApiJson?t:new pt(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/CreateExternalID",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.addMultiUserRestriction=function(t){var e=t.toApiJson?t:new ut(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/AddMultiUserRestriction",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t.prototype.removeMultiUserRestriction=function(t){var e=t.toApiJson?t:new $t(t);return this.http.post(this.hostService.hostWithScheme()+"/iam.v1.IAM/RemoveMultiUserRestriction",e.toApiJson(),Object.assign(Object.assign({},this.apiOptions()),{observe:"response"}))},t}();Le.ɵfac=function(t){return new(t||Le)(e.ɵɵinject(s.HttpClient),e.ɵɵinject(Te))},Le.ɵprov=e.ɵɵdefineInjectable({token:Le,factory:Le.ɵfac,providedIn:"root"});var De=function(){function e(t,e,i,s){this.api=t,this.httpApi=e,this.sessionService=i,this.iamApi=s}return e.prototype.getSubjectBySession=function(e,s,o){var n;return n=new J(o?{namespaced:new P({namespace:o,type:t.PersonaType[s]})}:{typed:new M({type:t.PersonaType[s]})}),this.api.getSubjectBySession({session:e,context:n}).pipe(i.map((function(t){return xe(new w({subject:t.subject.subject,context:n}))})))},e.prototype.getLoggedInSubject=function(t,e){var s=this;return this.sessionService.getSessionId().pipe(i.switchMap((function(i){return s.getSubjectBySession(i,t,e)})))},e.prototype.listPersonas=function(t,e){return this.api.listPersonas({session:t,pageSize:100,type:e}).pipe(i.map((function(t){var e,i,s=[];if(!t||!t.personas)return[];try{for(var o=u(t.personas),n=o.next();!n.done;n=o.next()){var r=xe(n.value);r&&s.push(r)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}return s})))},e.prototype.listLoggedInPersonas=function(t){var e=this;return this.sessionService.getSessionId().pipe(i.switchMap((function(i){return e.listPersonas(i,t)})))},e.prototype.getToken=function(){return this.api.getToken({}).pipe(i.map((function(t){return t.token})))},e.prototype.login=function(t,e,s,o){return this.httpApi.login({email:t,password:e,namespace:o,type:s}).pipe(i.map((function(t){return t.sessionId||""})))},e.prototype.logout=function(){return this.httpApi.logout().pipe(i.map((function(t){return t.success})))},e.prototype.ssoLogin=function(t,e,i){this.httpApi.ssoLogin({nextUrl:t,namespace:i,type:e})},e.prototype.getMultiUsers=function(t){return this.iamApi.getMultiUsers({userIdentifiers:t}).pipe(i.map((function(t){return t.users?t.users:[]})),i.map((function(t){return t.map((function(t){return t.user}))})))},e.prototype.listSecurityLogs=function(t,e,i,s){void 0===s&&(s="");var o={};return""!==s&&(o.filters=new mt({actionId:s})),this.iamApi.listSecurityLogs(Object.assign({userId:t,cursor:e,pageSize:i},o))},e.prototype.listUsers=function(t,e,i,s,o,n,r){var u={};return o&&o.length>0&&(u.subjectTypes=o),n&&n.length>0&&(u.searchTerms=n),this.iamApi.listUsers({namespace:t,email:e,cursor:i,pageSize:s,userFilter:u,sortOptions:r||[]})},e}();De.ɵfac=function(t){return new(t||De)(e.ɵɵinject(Ee),e.ɵɵinject(Ne),e.ɵɵinject(o.SessionService),e.ɵɵinject(Le))},De.ɵprov=e.ɵɵdefineInjectable({token:De,factory:De.ɵfac,providedIn:"root"}),t.Access=Re,t.AccessCheckFailures=G,t.AccessResourceRequest=ot,t.AccessResourceRequestResourceEntityIdentifierEntry=se,t.AddKeyRequest=nt,t.AddKeyResponse=rt,t.AddMultiUserRestrictionRequest=ut,t.Attribute=A,t.AuthenticateSubjectRequest=ct,t.BasePersona=le,t.ChangeSubjectEmailRequest=at,t.Context=J,t.CreateExternalIDRequest=pt,t.CreateSessionRequest=ht,t.CreateSessionResponse=ft,t.CreateTemporarySubjectRequest=dt,t.CreateTemporarySubjectResponse=lt,t.DeleteSubjectRequest=vt,t.DeleteUserRequest=bt,t.DeveloperPersona=Ae,t.DigitalAgentPersona=Se,t.FieldMask=k,t.GeoPointAttribute=g,t.GetImpersonationTokenRequest=At,t.GetImpersonationTokenResponse=yt,t.GetMultiExternalIDRequest=gt,t.GetMultiExternalIDResponse=jt,t.GetMultiUsersRequest=It,t.GetMultiUsersResponse=Jt,t.GetMultiUsersResponseUserContainer=ae,t.GetResetPasswordTokenRequest=Ot,t.GetSessionTokenRequest=St,t.GetShortLivedTokenRequest=Pt,t.GetSubjectBySessionRequest=wt,t.GetSubjectContextRequest=xt,t.GetSubjectContextResponse=Rt,t.GetSubjectResponse=Tt,t.GetSubjectsByEmailRequest=Et,t.GetSubjectsRequest=_t,t.GetSubjectsResponse=Mt,t.GetTokenRequest=kt,t.GetTokenResponse=Ct,t.HostService=Te,t.IAMApiService=Le,t.IAMListPersonasRequest=Nt,t.IAMService=De,t.Identifier=Q,t.IfClause=N,t.ListAttribute=j,t.ListPersonasByEmailRequest=Lt,t.ListPersonasRequest=Dt,t.ListPersonasResponse=Ut,t.ListSecurityLogsRequest=qt,t.ListSecurityLogsRequestFilters=mt,t.ListSecurityLogsResponse=Vt,t.ListUsersRequest=Wt,t.ListUsersResponse=Ft,t.MultiValueAttribute=O,t.MutateAttributesRequest=Gt,t.Mutation=S,t.NamespacedContext=P,t.NamespacedEmail=X,t.NamespacedPersona=be,t.NamespacedSession=$,t.OAuthCredentials=zt,t.Operator=L,t.PartnerAppPersona=ge,t.PartnerPersona=ye,t.Persona=w,t.Policy=K,t.PolicyNode=D,t.PublicKey=x,t.Query=R,t.RegisterPolicyRequest=Bt,t.RegisterResourceOwnerRequest=Ht,t.RegisterResourceRequest=Yt,t.RegisterSubjectRequest=Zt,t.RegisterSubjectResponse=Qt,t.RemoveKeyRequest=Xt,t.RemoveMultiUserRestrictionRequest=$t,t.ResetPasswordTokenResponse=te,t.ResetPasswordWithTokenRequest=ee,t.ResetSubjectPasswordRequest=ie,t.ResourceIdentifier=B,t.ResourceIdentifierIdentifiersEntry=z,t.ResourceOwner=H,t.SMBPersona=Je,t.SalespersonPersona=Ie,t.SearchSubjectRequest=oe,t.SearchSubjectResponse=ne,t.SecurityLog=Z,t.SendEmailVerificationRequest=re,t.SingleValueAttribute=T,t.StructAttribute=I,t.StructAttributeAttributesEntry=y,t.Subject=E,t.SubjectCredentials=ue,t.SubjectMissingValueClause=U,t.SubjectResourceForClause=q,t.SubjectResourceIntersectionClause=V,t.SubjectResourceSubsetClause=W,t.SubjectResult=_,t.SubjectValueIntersectionClause=F,t.TypedContext=M,t.TypedExternalIdentifier=tt,t.TypedPersona=ve,t.UpdateUserRequest=ce,t.UpdateUserRequestOperation=Kt,t.User=et,t.UserFilter=pe,t.UserIAMApiService=Ee,t.UserIdentifier=he,t.UserSortOptions=fe,t.ValueList=Y,t.VendorPersona=Oe,t.VerifyEmailRequest=de,t.fromPersona=xe,Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=vendasta-iam.umd.min.js.map